diff --git a/htdocs/conf/conf.class.php3.sample b/htdocs/conf/conf.class.php3.sample index 0cd8c8ebd2b..e8909cde045 100644 --- a/htdocs/conf/conf.class.php3.sample +++ b/htdocs/conf/conf.class.php3.sample @@ -49,6 +49,8 @@ class Conf { $this->years = 2001; + $this->password_encrypted = 1; + $this->css = "theme/dolibarr/dolibarr.css"; } } diff --git a/htdocs/user.class.php3 b/htdocs/user.class.php3 index 7fc959a096e..179555258dd 100644 --- a/htdocs/user.class.php3 +++ b/htdocs/user.class.php3 @@ -190,7 +190,16 @@ class User { $password = substr(crypt(uniqid("")),0,8); } - $sql = "UPDATE llx_user SET pass = '".crypt($password, "CRYPT_STD_DES")."'"; + if ($conf->password_encrypted) + { + $sqlpass = crypt($password, "CRYPT_STD_DES"); + } + else + { + $sqlpass = $password; + } + + $sql = "UPDATE llx_user SET pass = '".$sqlpass."'"; $sql .= " WHERE rowid = $this->id"; $result = $this->db->query($sql);