diff options
-rw-r--r-- | templates/settings.php | 2 | ||||
-rw-r--r-- | user_sql.php | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/templates/settings.php b/templates/settings.php index c555c5c..b6be2c3 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -66,7 +66,7 @@ $cfgClass = $ocVersion >= 7 ? 'section' : 'personalblock'; <p><label for="col_displayname"><?php p($l -> t('Real Name Column')); ?></label><input type="text" id="col_displayname" name="col_displayname" value="<?php p($_['col_displayname']); ?>" /></p> <p><label for="set_crypt_type"><?php p($l -> t('Encryption Type')); ?></label> - <?php $crypt_types = array('md5' => 'MD5', 'md5crypt' => 'MD5 Crypt', 'cleartext' => 'Cleartext', 'mysql_encrypt' => 'mySQL ENCRYPT()', 'system' => 'System (crypt)', 'mysql_password' => 'mySQL PASSWORD()', 'joomla' => 'Joomla MD5 Encryption', 'joomla2' => 'Joomla > 2.5.18 phpass', 'ssha256' => 'Salted SSHA256', 'redmine' => 'Redmine'); ?> + <?php $crypt_types = array('md5' => 'MD5', 'md5crypt' => 'MD5 Crypt', 'cleartext' => 'Cleartext', 'mysql_encrypt' => 'mySQL ENCRYPT()', 'system' => 'System (crypt)', 'mysql_password' => 'mySQL PASSWORD()', 'joomla' => 'Joomla MD5 Encryption', 'joomla2' => 'Joomla > 2.5.18 phpass', 'ssha256' => 'Salted SSHA256', 'redmine' => 'Redmine', 'sha1' => 'SHA1'); ?> <select id="set_crypt_type" name="set_crypt_type"> <?php foreach ($crypt_types as $driver => $name): diff --git a/user_sql.php b/user_sql.php index 9283c66..d54c99e 100644 --- a/user_sql.php +++ b/user_sql.php @@ -268,6 +268,10 @@ class OC_USER_SQL extends \OC_User_Backend implements \OCP\IUserBackend, \OCP\Us if(!$salt) return false; $enc_password = sha1($salt['salt'].sha1($password)); + } + elseif($this -> settings['set_crypt_type'] === 'sha1') + { + $enc_password = sha1($password); } else { $enc_password = $this -> pacrypt($password, $old_password); @@ -321,6 +325,10 @@ class OC_USER_SQL extends \OC_User_Backend implements \OCP\IUserBackend, \OCP\Us if(!$salt) return false; $ret = sha1($salt['salt'].sha1($password)) === $db_pass; + } + elseif($this -> settings['set_crypt_type'] == 'sha1') + { + $ret = sha1($password) === $db_pass; } else { $ret = $this -> pacrypt($password, $db_pass) === $db_pass; |