最後更新: 2015-03-26
介紹
change_sqlpass
Download: http://squirrelmail.org/plugin_view.php?id=25
Requires: SquirrelMail 1.2.8, Compatibility 2.0.4, Pear DB library
Mysql Create user:
GRANT SELECT , UPDATE ON `dbispconfig`.`mail_user` TO 'change_sqlpass'@'localhost';
安裝所需 package:
apt-get install php-pear php-db
pear install DB
安 Plugin:
tar -zxf change_sqlpass-3.3-1.2.tar.gz
mv change_sqlpass /usr/share/squirrelmail/plugins/
cd /usr/share/squirrelmail/plugins/change_sqlpass
設定及改 Source Code
config.php
$csp_dsn = 'mysql://root:[email protected]/dbispconfig'; // This plugin will always verify the user's old password $Lookup_Password_Query = 'SELECT count(*) FROM mail_user WHERE email = "%1" AND crypt_password = %4'; $password_update_queries = array('UPDATE mail_user SET password = %4 WHERE email = "%1"'); $csp_salt_query = 'SELECT SUBSTRING(PASSWORD, 4, 8) FROM mail_user WHERE email = "%1"'; # 1234 # $1$12345678$????????????? # SUBSTRING(str,pos,len) $password_encryption = 'MD5CRYPT'; $min_password_length = 8; $include_digit_in_password = 1; $include_lowercase_letter_in_password = 1;
functions.php
case strtolower(PASSWORD_ENCRYPTION_MD5CRYPT): return '"' . md5crypt($password, $salt) . '"';
to
case strtolower(PASSWORD_ENCRYPTION_MD5CRYPT): include_once(SM_PATH . 'plugins/change_sqlpass/md5crypt.php'); return '"' . md5crypt($password, $salt) . '"';
Activate the plugin in SquirrelMail
行 squirrelmail-configure
按 8. Plugins
按 n. change_sqlpass
按 Save S and exit Q.