diff --git a/dev/setup/apache/virtualhost b/dev/setup/apache/virtualhost new file mode 100644 index 00000000000..c3a2dff3e43 --- /dev/null +++ b/dev/setup/apache/virtualhost @@ -0,0 +1,62 @@ + +#php_admin_value sendmail_path "/usr/sbin/sendmail -t -i" +#php_admin_value mail.force_extra_parameters "-f postmaster@mydomain.com" +php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f postmaster@mydomain.com" +php_admin_value open_basedir /tmp/:/home/../htdocs + +ServerName myvirtualalias +ServerAlias myvirtualalias + +UseCanonicalName On + +AddDefaultCharset UTF-8 + +DocumentRoot "/home/.../htdocs" + + + AllowOverride None + Options -Indexes -MultiViews +FollowSymLinks -ExecCGI + Require all granted + + + + Deny from all + RemoveHandler .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml + AddType application/x-httpd-php-source .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml + + + +ErrorLog /var/log/apache2/myvirtualalias_error_log +TransferLog /var/log/apache2/myvirtualalias_access_log + +# Compress returned resources of type php pages, text file export, css and javascript +AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript + +AddType text/javascript .jgz +AddEncoding gzip .jgz +ExpiresActive On +ExpiresByType image/x-icon A2592000 +ExpiresByType image/gif A2592000 +ExpiresByType image/png A2592000 +ExpiresByType image/jpeg A2592000 +ExpiresByType text/css A2592000 +ExpiresByType text/javascript A2592000 +ExpiresByType application/x-javascript A2592000 +ExpiresByType application/javascript A2592000 + +SSLEngine On + +# A self-signed (snakeoil) certificate can be created by installing +# the ssl-cert package. See +# /usr/share/doc/apache2.2-common/README.Debian.gz for more info. +# If both key and certificate are stored in the same file, only the +# SSLCertificateFile directive is needed. +SSLCertificateFile /etc/letsencrypt/live/www.mydomain.com/cert.pem +SSLCertificateKeyFile /etc/letsencrypt/live/www.mydomain.com/privkey.pem +SSLCertificateChainFile /etc/letsencrypt/live/www.mydomain.com/chain.pem + +#RewriteEngine on +#RewriteCond %{SERVER_PORT} ^80$ +#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R] + + diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 216c321499b..e2106051ce9 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -389,7 +389,7 @@ function societe_admin_prepare_head() * Return country label, code or id from an id, code or label * * @param int $searchkey Id or code of country to search - * @param int $withcode '0'=Return label, + * @param string $withcode '0'=Return label, * '1'=Return code + label, * '2'=Return code from id, * '3'=Return id from code, @@ -400,7 +400,7 @@ function societe_admin_prepare_head() * @param int $searchlabel Label of country to search (warning: searching on label is not reliable) * @return mixed String with country code or translated country name or Array('id','code','label') */ -function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv=1,$searchlabel='') +function getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='') { global $db,$langs; diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index c3899e7c142..75edcab3c9b 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -176,17 +176,18 @@ ALTER TABLE llx_menu MODIFY fk_leftmenu varchar(100); CREATE TABLE llx_websiteaccount( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, login varchar(64) NOT NULL, + pass_encoding varchar(24) NOT NULL, pass_crypted varchar(128), pass_temp varchar(128), -- temporary password when asked for forget password fk_soc integer, - fk_website integer, + fk_website integer NOT NULL, date_last_login datetime, date_previous_login datetime, - date_creation datetime NOT NULL, - tms timestamp NOT NULL, - fk_user_creat integer NOT NULL, - fk_user_modif integer, - import_key varchar(14), + date_creation datetime NOT NULL, + tms timestamp NOT NULL, + fk_user_creat integer NOT NULL, + fk_user_modif integer, + import_key varchar(14), status integer ) ENGINE=innodb; @@ -197,6 +198,10 @@ ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_import_key (import_k ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_status (status); ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_fk_soc (fk_soc); +ALTER TABLE llx_websiteaccount ADD UNIQUE INDEX uk_websiteaccount_login_website_soc(login, fk_website, fk_soc); + +ALTER TABLE llx_websiteaccount ADD CONSTRAINT llx_websiteaccount_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid); + create table llx_websiteaccount_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -206,7 +211,7 @@ create table llx_websiteaccount_extrafields ) ENGINE=innodb; - +alter table llx_user add column pass_encoding varchar(24) NULL; diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 71ea5a559f5..27732169bd1 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -34,6 +34,7 @@ create table llx_user fk_user_creat integer, fk_user_modif integer, login varchar(50) NOT NULL, + pass_encoding varchar(24); pass varchar(128), pass_crypted varchar(128), pass_temp varchar(128), -- temporary password when asked for forget password diff --git a/htdocs/install/mysql/tables/llx_websiteaccount.key.sql b/htdocs/install/mysql/tables/llx_websiteaccount.key.sql index 463218b04cd..7b455be2df4 100644 --- a/htdocs/install/mysql/tables/llx_websiteaccount.key.sql +++ b/htdocs/install/mysql/tables/llx_websiteaccount.key.sql @@ -24,5 +24,5 @@ ALTER TABLE llx_websiteaccount ADD INDEX idx_websiteaccount_fk_soc (fk_soc); ALTER TABLE llx_websiteaccount ADD UNIQUE INDEX uk_websiteaccount_login_website_soc(login, fk_website, fk_soc); ---ALTER TABLE llx_websiteaccount ADD CONSTRAINT llx_websiteaccount_field_id FOREIGN KEY (fk_field) REFERENCES llx_myotherobject(rowid); +ALTER TABLE llx_websiteaccount ADD CONSTRAINT llx_websiteaccount_fk_website FOREIGN KEY (fk_website) REFERENCES llx_website(rowid); diff --git a/htdocs/install/mysql/tables/llx_websiteaccount.sql b/htdocs/install/mysql/tables/llx_websiteaccount.sql index 838fc170595..f48d3f31845 100644 --- a/htdocs/install/mysql/tables/llx_websiteaccount.sql +++ b/htdocs/install/mysql/tables/llx_websiteaccount.sql @@ -18,11 +18,13 @@ CREATE TABLE llx_websiteaccount( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, login varchar(64) NOT NULL, + pass_encoding varchar(24) NOT NULL, pass_crypted varchar(128), pass_temp varchar(128), -- temporary password when asked for forget password fk_soc integer, - fk_website integer, - date_last_login datetime, + fk_website integer NOT NULL, + note_private text, + date_last_login datetime, date_previous_login datetime, date_creation datetime NOT NULL, tms timestamp NOT NULL, diff --git a/htdocs/website/class/websiteaccount.class.php b/htdocs/website/class/websiteaccount.class.php index f420c8abcf8..5e3a80fff81 100644 --- a/htdocs/website/class/websiteaccount.class.php +++ b/htdocs/website/class/websiteaccount.class.php @@ -84,7 +84,7 @@ class WebsiteAccount extends CommonObject 'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,), 'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,), //'note_public' => array('type'=>'text', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,), - //'note_private' => array('type'=>'text', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>46, 'notnull'=>-1,), + 'note_private' => array('type'=>'text', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>46, 'notnull'=>-1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), @@ -97,6 +97,7 @@ class WebsiteAccount extends CommonObject public $pass_crypted; public $date_last_login; public $date_previous_login; + public $note_private; public $date_creation; public $tms; public $fk_user_creat;