diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 11a663780cc..464f7e8afab 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1118,8 +1118,8 @@ class Adherent extends CommonObject * * @param User $user Object user de l'utilisateur qui fait la modification * @param string $password New password (to generate if empty) - * @param int $isencrypted 0 ou 1 si il faut crypter le mot de passe en base (0 par defaut) - * @param int $notrigger 1=Ne declenche pas les triggers + * @param int $isencrypted 0 ou 1 if the password needs to be encrypted in the DB (default: 0) + * @param int $notrigger 1=Does not raise the triggers * @param int $nosyncuser Do not synchronize linked user * @return string If OK return clear password, 0 if no change, < 0 if error */ @@ -2812,7 +2812,7 @@ class Adherent extends CommonObject // When password is modified if (!empty($this->pass)) { if (getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD')) { - $info[getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD')] = $this->pass; // this->pass = mot de passe non crypte + $info[getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD')] = $this->pass; // this->pass = Unencrypted password } if (getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD_CRYPTED')) { $info[getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD_CRYPTED')] = dol_hash($this->pass, 'openldap'); // Create OpenLDAP password (see LDAP_PASSWORD_HASH_TYPE) @@ -2832,7 +2832,7 @@ class Adherent extends CommonObject } elseif (!empty($this->pass_indatabase)) { // Use $this->pass_indatabase value if exists if (getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD')) { - $info[getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD')] = $this->pass_indatabase; // $this->pass_indatabase = mot de passe non crypte + $info[getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD')] = $this->pass_indatabase; // $this->pass_indatabase = Unencrypted password } if (getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD_CRYPTED')) { $info[getDolGlobalString('LDAP_MEMBER_FIELD_PASSWORD_CRYPTED')] = dol_hash($this->pass_indatabase, 'openldap'); // Create OpenLDAP password (see LDAP_PASSWORD_HASH_TYPE) diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 124a4b20f51..37a294740e8 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -122,7 +122,7 @@ print '
| '.$langs->trans("Login").' / '.$langs->trans("Id").' | '.$object->login.' | |||
| '.$langs->trans("LDAPFieldPasswordNotCrypted").' | '; print ''.$object->pass.' | '; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 469d8f1735d..7e1828d6a69 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -268,14 +268,14 @@ print ''.$langs->trans("LDAPFieldLoginSambaExample").' | '; print 'global->LDAP_KEY_MEMBERS && $conf->global->LDAP_KEY_MEMBERS == $conf->global->LDAP_MEMBER_FIELD_LOGIN_SAMBA) ? ' checked' : '')."> | "; print '|
| '.$langs->trans("LDAPFieldPasswordNotCrypted").' | '; print ''; print ' | '.$langs->trans("LDAPFieldPasswordExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldPasswordCrypted").' | '; print ''; print ' | '.$langs->trans("LDAPFieldPasswordExample").' | '; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index ca84c912a5e..aa71d0381b6 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -256,14 +256,14 @@ print ''.$langs->trans("LDAPFieldLoginSambaExample").' | '; print '"; print ' |
| '.$langs->trans("LDAPFieldPasswordNotCrypted").' | '; print ''; print ' | '.$langs->trans("LDAPFieldPasswordExample").' | '; print ''; print ' | |
| '.$langs->trans("LDAPFieldPasswordCrypted").' | '; print ''; print ' | '.$langs->trans("LDAPFieldPasswordExample").' | '; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 42945587fee..1fe0d90511e 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -37,7 +37,7 @@ if (!$user->admin) { accessforbidden(); } -// Allow/Disallow change to clear passwords once passwords are crypted +// Allow/Disallow change to clear passwords once passwords are encrypted $allow_disable_encryption = true; diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 4c612256c23..d0ca5f7142e 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -319,7 +319,7 @@ $dolibarr_main_restrict_ip=''; // This might be required if you access Dolibarr behind a proxy that make bad URL rewriting, to avoid false alarms. // In most cases, you should always keep this to 0. // Default value: 0 -// Possible values: 0 or 1 (no strict CSRF test, only test on referer) or 2 (no CSRF test at all) +// Possible values: 0 or 1 (no strict CSRF test, only test on referrer) or 2 (no CSRF test at all) // Examples: // $dolibarr_nocsrfcheck='0'; // diff --git a/htdocs/contrat/ticket.php b/htdocs/contrat/ticket.php index a0c16407247..539b5d0ac98 100644 --- a/htdocs/contrat/ticket.php +++ b/htdocs/contrat/ticket.php @@ -158,7 +158,7 @@ print ''; /* - * Referers types + * Referrers types */ $title=$langs->trans("ListTicketsLinkToContract"); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 395306e1ff2..dc1b14b3813 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6469,7 +6469,7 @@ abstract class CommonObject case 'password': $algo = ''; if ($this->array_options[$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options'])) { - // If there is an encryption choice, we use it to crypt data before insert + // If there is an encryption choice, we use it to encrypt data before insert $tmparrays = array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']); $algo = reset($tmparrays); if ($algo != '') { @@ -6479,7 +6479,7 @@ abstract class CommonObject if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value //var_dump('iii'.$algo.' '.$this->oldcopy->array_options[$key].' -> '.$this->array_options[$key]); if (isset($this->oldcopy->array_options[$key]) && $this->array_options[$key] == $this->oldcopy->array_options[$key]) { - // If old value crypted in database is same than submitted new value, it means we don't change it, so we don't update. + // If old value encrypted in database is same than submited new value, it means we don't change it, so we don't update. if ($algo == 'dolcrypt') { // dolibarr reversible encryption if (!preg_match('/^dolcrypt:/', $this->array_options[$key])) { $new_array_options[$key] = dolEncrypt($this->array_options[$key]); // warning, must be called when on the master @@ -6893,7 +6893,7 @@ abstract class CommonObject case 'password': $algo = ''; if ($this->array_options["options_".$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options'])) { - // If there is an encryption choice, we use it to crypt data before insert + // If there is an encryption choice, we use it to encrypt data before insert $tmparrays = array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']); $algo = reset($tmparrays); if ($algo != '') { @@ -6903,7 +6903,7 @@ abstract class CommonObject //var_dump($key.' '.$this->array_options["options_".$key].' '.$algo); if (is_object($this->oldcopy)) { // If this->oldcopy is not defined, we can't know if we change attribute or not, so we must keep value //var_dump($this->oldcopy->array_options["options_".$key]); var_dump($this->array_options["options_".$key]); - if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value crypted in database is same than submitted new value, it means we don't change it, so we don't update. + if (isset($this->oldcopy->array_options["options_".$key]) && $this->array_options["options_".$key] == $this->oldcopy->array_options["options_".$key]) { // If old value encrypted in database is same than submited new value, it means we don't change it, so we don't update. if ($algo == 'dolcrypt') { // dolibarr reversible encryption if (!preg_match('/^dolcrypt:/', $this->array_options["options_".$key])) { $new_array_options["options_".$key] = dolEncrypt($this->array_options["options_".$key]); // warning, must be called when on the master diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 76af618a070..ff149b232db 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -92,7 +92,7 @@ function dol_decode($chain, $key = '1') } /** - * Return a string of random bytes (hexa string) with length = $length fro cryptographic purposes. + * Return a string of random bytes (hexa string) with length = $length for cryptographic purposes. * * @param int $length Length of random string * @return string Random string @@ -130,7 +130,7 @@ function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed = $reg = array(); if (preg_match('/^dolcrypt:([^:]+):(.+)$/', $chain, $reg)) { - // The $chain is already a crypted string + // The $chain is already a encrypted string return $chain; } diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 2f4ac6ac540..3405ba614e6 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -335,11 +335,11 @@ if (!function_exists('dol_loginfunction')) { } /** - * Fonction pour initialiser un salt pour la fonction crypt. + * Initialise the salt for the crypt function. * - * @param int $type 2=>renvoi un salt pour cryptage DES - * 12=>renvoi un salt pour cryptage MD5 - * non defini=>renvoi un salt pour cryptage par defaut + * @param int $type 2 =>Return a salt for DES encryption + * 12=>Return a salt for MD5 encryption + * Undefined=>Return a salt for default encryption * @return string Salt string */ function makesalt($type = CRYPT_SALT_LENGTH) @@ -351,7 +351,7 @@ function makesalt($type = CRYPT_SALT_LENGTH) $saltprefix = '$1$'; $saltsuffix = '$'; break; - case 8: // 8 (Pour compatibilite, ne devrait pas etre utilise) + case 8: // 8 (For compatibility, do not use this) $saltlen = 8; $saltprefix = '$1$'; $saltsuffix = '$'; @@ -393,7 +393,7 @@ function encodedecode_dbpassconf($level = 0) $lineofpass = 0; $reg = array(); - if (preg_match('/^[^#]*dolibarr_main_db_encrypted_pass[\s]*=[\s]*(.*)/i', $buffer, $reg)) { // Old way to save crypted value + if (preg_match('/^[^#]*dolibarr_main_db_encrypted_pass[\s]*=[\s]*(.*)/i', $buffer, $reg)) { // Old way to save encrypted value $val = trim($reg[1]); // This also remove CR/LF $val = preg_replace('/^["\']/', '', $val); $val = preg_replace('/["\'][\s;]*$/', '', $val); diff --git a/htdocs/core/login/functions_dolibarr.php b/htdocs/core/login/functions_dolibarr.php index f5594e54a93..143dcd33779 100644 --- a/htdocs/core/login/functions_dolibarr.php +++ b/htdocs/core/login/functions_dolibarr.php @@ -110,7 +110,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes if (!in_array($cryptType, array('auto'))) { $cryptType = 'auto'; } - // Check crypted password according to crypt algorithm + // Check encrypted password according to encryption algorithm if ($cryptType == 'auto') { if ($passcrypted && dol_verifyHash($passtyped, $passcrypted, '0')) { $passok = true; diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index e46e2f23fad..2f220f9f878 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -236,8 +236,8 @@ if (!defined('NOCSRFCHECK') && isset($dolibarr_nocsrfcheck) && $dolibarr_nocsrfc if ($csrfattack) { //print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER']; // Note: We can't use dol_escape_htmltag here to escape output because lib functions.lib.ph is not yet loaded. - dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (Bad referer).", LOG_WARNING); - print "Access refused by CSRF protection in main.inc.php. Referer of form (".htmlentities($_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8').") is outside the server that serve this page (with method = ".htmlentities($_SERVER['REQUEST_METHOD'], ENT_COMPAT, 'UTF-8').").\n"; + dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"])?'':$_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (Bad referrer).", LOG_WARNING); + print "Access refused by CSRF protection in main.inc.php. Referrer of form (".htmlentities($_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8').") is outside the server that serve this page (with method = ".htmlentities($_SERVER['REQUEST_METHOD'], ENT_COMPAT, 'UTF-8').").\n"; print "If you access your server behind a proxy using url rewriting, you might check that all HTTP headers are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file to remove this security check).\n"; die; } @@ -372,7 +372,7 @@ if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_ if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass); - $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially crypted + $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially encrypted } else { $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass); } diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index ebeb21f2cd6..389c43738b0 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -187,7 +187,7 @@ if (!function_exists('ftp_connect')) { print '||
| '.$langs->trans("Port").' | '; print ''; - print ' | 21 for pure non crypted FTP or if option FTP_CONNECT_WITH_SSL (See Home-Setup-Other) is on (FTPS) 22 if option FTP_CONNECT_WITH_SFTP (See Home-Setup-Other) is on (SFTP) | ';
+ print '21 for pure non encrypted FTP or if option FTP_CONNECT_WITH_SSL (See Home-Setup-Other) is on (FTPS) 22 if option FTP_CONNECT_WITH_SFTP (See Home-Setup-Other) is on (SFTP) | ';
print '|