diff options
Diffstat (limited to 'plugins/password')
| -rw-r--r-- | plugins/password/README | 90 | ||||
| -rw-r--r-- | plugins/password/config.inc.php.dist | 12 | ||||
| -rw-r--r-- | plugins/password/drivers/cpanel.php | 110 | ||||
| -rw-r--r-- | plugins/password/drivers/directadmin.php | 1 | ||||
| -rw-r--r-- | plugins/password/drivers/pam.php | 3 | ||||
| -rw-r--r-- | plugins/password/drivers/sql.php | 7 | ||||
| -rw-r--r-- | plugins/password/drivers/xmail.php | 4 | ||||
| -rw-r--r-- | plugins/password/localization/gl_ES.inc | 2 | ||||
| -rw-r--r-- | plugins/password/localization/lb_LU.inc | 37 | ||||
| -rw-r--r-- | plugins/password/localization/lv_LV.inc | 16 | ||||
| -rw-r--r-- | plugins/password/localization/nl_NL.inc | 20 | ||||
| -rw-r--r-- | plugins/password/localization/zh_CN.inc | 8 | ||||
| -rw-r--r-- | plugins/password/package.xml | 40 | ||||
| -rw-r--r-- | plugins/password/password.php | 50 | 
14 files changed, 209 insertions, 191 deletions
| diff --git a/plugins/password/README b/plugins/password/README index 25af8cbcd..af70156a6 100644 --- a/plugins/password/README +++ b/plugins/password/README @@ -1,31 +1,29 @@   -----------------------------------------------------------------------   Password Plugin for Roundcube   ----------------------------------------------------------------------- -   Plugin that adds a possibility to change user password using many   methods (drivers) via Settings/Password tab. -   ----------------------------------------------------------------------- - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the   GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + You should have received a copy of the GNU General Public License + along with this program. If not, see http://www.gnu.org/licenses/.   @version @package_version@ - @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl> + @author Aleksander Machniak <alec@alec.pl>   @author <see driver files for driver authors>   ----------------------------------------------------------------------- - 1. 	Configuration - 2.	Drivers + 1. Configuration + 2. Drivers   2.1.  Database (sql)   2.2.  Cyrus/SASL (sasl)   2.3.  Poppassd/Courierpassd (poppassd) @@ -44,7 +42,7 @@   2.16. DBMail (dbmail)   2.17. Expect (expect)   2.18. Samba (smb) - 3.	Driver API + 3. Driver API   1. Configuration @@ -65,40 +63,40 @@   -------------------   You can specify which database to connect by 'password_db_dsn' option and - what SQL query to execute by 'password_query'. See main.inc.php.dist file for + what SQL query to execute by 'password_query'. See config.inc.php.dist file for   more info.   Example implementations of an update_passwd function:   - This is for use with LMS (http://lms.org.pl) database and postgres: -	CREATE OR REPLACE FUNCTION update_passwd(hash text, account text) RETURNS integer AS $$ -	DECLARE -    	    res integer; -	BEGIN -    	    UPDATE passwd SET password = hash -	    WHERE login = split_part(account, '@', 1) -		AND domainid = (SELECT id FROM domains WHERE name = split_part(account, '@', 2)) -	    RETURNING id INTO res; -	    RETURN res; -	END; -	$$ LANGUAGE plpgsql SECURITY DEFINER; +    CREATE OR REPLACE FUNCTION update_passwd(hash text, account text) RETURNS integer AS $$ +    DECLARE +            res integer; +    BEGIN +        UPDATE passwd SET password = hash +        WHERE login = split_part(account, '@', 1) +            AND domainid = (SELECT id FROM domains WHERE name = split_part(account, '@', 2)) +        RETURNING id INTO res; +        RETURN res; +    END; +    $$ LANGUAGE plpgsql SECURITY DEFINER;   - This is for use with a SELECT update_passwd(%o,%c,%u) query -	Updates the password only when the old password matches the MD5 password -	in the database +   Updates the password only when the old password matches the MD5 password +   in the database -	CREATE FUNCTION update_password (oldpass text, cryptpass text, user text) RETURNS text -    	    MODIFIES SQL DATA -	BEGIN -	    DECLARE currentsalt varchar(20); -	    DECLARE error text; -	    SET error = 'incorrect current password'; -	    SELECT substring_index(substr(user.password,4),_latin1'$',1) INTO currentsalt FROM users WHERE username=user; -	    SELECT '' INTO error FROM users WHERE username=user AND password=ENCRYPT(oldpass,currentsalt); -	    UPDATE users SET password=cryptpass WHERE username=user AND password=ENCRYPT(oldpass,currentsalt); -	    RETURN error; -	END +    CREATE FUNCTION update_password (oldpass text, cryptpass text, user text) RETURNS text +        MODIFIES SQL DATA +    BEGIN +        DECLARE currentsalt varchar(20); +        DECLARE error text; +        SET error = 'incorrect current password'; +        SELECT substring_index(substr(user.password,4),_latin1'$',1) INTO currentsalt FROM users WHERE username=user; +        SELECT '' INTO error FROM users WHERE username=user AND password=ENCRYPT(oldpass,currentsalt); +        UPDATE users SET password=cryptpass WHERE username=user AND password=ENCRYPT(oldpass,currentsalt); +        RETURN error; +    END   Example SQL UPDATEs: @@ -142,7 +140,7 @@   documented within it.   Compile the wrapper program: -	gcc -o chgsaslpasswd chgsaslpasswd.c +    gcc -o chgsaslpasswd chgsaslpasswd.c   Chown the compiled chgsaslpasswd binary to the cyrus user and group   that your browser runs as, then chmod them to 4550. @@ -150,13 +148,13 @@   For example, if your cyrus user is 'cyrus' and the apache server group is   'nobody' (I've been told Redhat runs Apache as user 'apache'): -	chown cyrus:nobody chgsaslpasswd -	chmod 4550 chgsaslpasswd +    chown cyrus:nobody chgsaslpasswd +    chmod 4550 chgsaslpasswd   Stephen Carr has suggested users should try to run the scripts on a test   account as the cyrus user eg; -	su cyrus -c "./chgsaslpasswd -p test_account" +    su cyrus -c "./chgsaslpasswd -p test_account"   This will allow you to make sure that the script will work for your setup.   Should the script not work, make sure that: @@ -192,8 +190,12 @@   2.6. cPanel (cpanel)   -------------------- - You can specify parameters for HTTP connection to cPanel's admin - interface. See config.inc.php.dist file for more info. + Install cPanel XMLAPI Client Class into Roundcube program/lib directory + or any other place in PHP include path. You can get the class from + https://raw.github.com/CpanelInc/xmlapi-php/master/xmlapi.php + + You can configure parameters for connection to cPanel's API interface. + See config.inc.php.dist file for more info.   2.7. XIMSS/Communigate (ximms) diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist index 16e3737d6..9256829aa 100644 --- a/plugins/password/config.inc.php.dist +++ b/plugins/password/config.inc.php.dist @@ -31,6 +31,10 @@ $rcmail_config['password_login_exceptions'] = null;  //$rcmail_config['password_hosts'] = array('mail.example.com', 'mail2.example.org');  $rcmail_config['password_hosts'] = null; +// Enables saving the new password even if it matches the old password. Useful +// for upgrading the stored passwords after the encryption scheme has changed. +$rcmail_config['password_force_save'] = false; +  // SQL Driver options  // ------------------ @@ -265,13 +269,7 @@ $rcmail_config['password_cpanel_username'] = 'username';  $rcmail_config['password_cpanel_password'] = 'password';  // The cPanel port to use -$rcmail_config['password_cpanel_port'] = 2082; - -// Using ssl for cPanel connections? -$rcmail_config['password_cpanel_ssl'] = true; - -// The cPanel theme in use -$rcmail_config['password_cpanel_theme'] = 'x'; +$rcmail_config['password_cpanel_port'] = 2087;  // XIMSS (Communigate server) Driver options diff --git a/plugins/password/drivers/cpanel.php b/plugins/password/drivers/cpanel.php index 79887109b..b71c33ec1 100644 --- a/plugins/password/drivers/cpanel.php +++ b/plugins/password/drivers/cpanel.php @@ -4,95 +4,43 @@   * cPanel Password Driver   *   * Driver that adds functionality to change the users cPanel password. - * The cPanel PHP API code has been taken from: http://www.phpclasses.org/browse/package/3534.html + * Originally written by Fulvio Venturelli <fulvio@venturelli.org>   * - * This driver has been tested with Hostmonster hosting and seems to work fine. + * Completely rewritten using the cPanel API2 call Email::passwdpop + * as opposed to the original coding against the UI, which is a fragile method that + * makes the driver to always return a failure message for any language other than English + * see http://trac.roundcube.net/ticket/1487015   * - * @version 2.0 - * @author Fulvio Venturelli <fulvio@venturelli.org> + * This driver has been tested with o2switch hosting and seems to work fine. + * + * @version 3.0 + * @author Christian Chech <christian@chech.fr>   */  class rcube_cpanel_password  {      public function save($curpas, $newpass)      { +        require_once 'xmlapi.php'; +          $rcmail = rcmail::get_instance(); -        // Create a cPanel email object -        $cPanel = new emailAccount($rcmail->config->get('password_cpanel_host'), -        $rcmail->config->get('password_cpanel_username'), -        $rcmail->config->get('password_cpanel_password'), -        $rcmail->config->get('password_cpanel_port'), -        $rcmail->config->get('password_cpanel_ssl'), -        $rcmail->config->get('password_cpanel_theme'), -        $_SESSION['username'] ); +        $this->cuser = $rcmail->config->get('password_cpanel_username'); + +        // Setup the xmlapi connection +        $this->xmlapi = new xmlapi($rcmail->config->get('password_cpanel_host')); +        $this->xmlapi->set_port($rcmail->config->get('password_cpanel_port')); +        $this->xmlapi->password_auth($this->cuser, $rcmail->config->get('password_cpanel_password')); +        $this->xmlapi->set_output('json'); +        $this->xmlapi->set_debug(0); -        if ($cPanel->setPassword($newpass)) { +        if ($this->setPassword($_SESSION['username'], $newpass)) {              return PASSWORD_SUCCESS;          }          else {              return PASSWORD_ERROR;          }      } -} - - -class HTTP -{ -    function HTTP($host, $username, $password, $port, $ssl, $theme) -    { -        $this->ssl = $ssl ? 'ssl://' : ''; -        $this->username = $username; -        $this->password = $password; -        $this->theme = $theme; -        $this->auth = base64_encode($username . ':' . $password); -        $this->port = $port; -        $this->host = $host; -        $this->path = '/frontend/' . $theme . '/'; -    } - -    function getData($url, $data = '') -    { -        $url = $this->path . $url; -        if (is_array($data)) { -            $url = $url . '?'; -            foreach ($data as $key => $value) { -                $url .= urlencode($key) . '=' . urlencode($value) . '&'; -            } -            $url = substr($url, 0, -1); -        } - -        $response = ''; -        $fp = fsockopen($this->ssl . $this->host, $this->port); -        if (!$fp) { -            return false; -        } - -        $out = 'GET ' . $url . ' HTTP/1.0' . "\r\n"; -        $out .= 'Authorization: Basic ' . $this->auth . "\r\n"; -        $out .= 'Connection: Close' . "\r\n\r\n"; -        fwrite($fp, $out); -        while (!feof($fp)) { -            $response .= @fgets($fp); -        } -        fclose($fp); -        return $response; -    } -} - - -class emailAccount -{ -    function emailAccount($host, $username, $password, $port, $ssl, $theme, $address) -    { -        $this->HTTP = new HTTP($host, $username, $password, $port, $ssl, $theme); -        if (strpos($address, '@')) { -            list($this->email, $this->domain) = explode('@', $address); -        } -        else { -            list($this->email, $this->domain) = array($address, ''); -        } -    }      /**       * Change email account password @@ -101,16 +49,24 @@ class emailAccount       * @param string $password email account password       * @return bool       */ -    function setPassword($password) +    function setPassword($address, $password)      { -        $data['email'] = $this->email; -        $data['domain'] = $this->domain; +        if (strpos($address, '@')) { +            list($data['email'], $data['domain']) = explode('@', $address); +        } +        else { +            list($data['email'], $data['domain']) = array($address, ''); +        } +          $data['password'] = $password; -        $response = $this->HTTP->getData('mail/dopasswdpop.html', $data); -        if (strpos($response, 'success') && !strpos($response, 'failure')) { +        $query = $this->xmlapi->api2_query($this->cuser, 'Email', 'passwdpop', $data); +        $query = json_decode($query, true); + +        if ($query['cpanelresult']['data'][0]['result'] == 1) {              return true;          } +          return false;      }  } diff --git a/plugins/password/drivers/directadmin.php b/plugins/password/drivers/directadmin.php index 8bf0dc613..44ecea406 100644 --- a/plugins/password/drivers/directadmin.php +++ b/plugins/password/drivers/directadmin.php @@ -297,7 +297,6 @@ class HTTPSocket {              $status = socket_get_status($socket);              $startTime = time();              $length = 0; -            $prevSecond = 0;              while ( !feof($socket) && !$status['timed_out'] )              {                  $chunk = fgets($socket,1024); diff --git a/plugins/password/drivers/pam.php b/plugins/password/drivers/pam.php index 8cd94c737..4d0ba1656 100644 --- a/plugins/password/drivers/pam.php +++ b/plugins/password/drivers/pam.php @@ -11,7 +11,8 @@ class rcube_pam_password  {      function save($currpass, $newpass)      { -        $user = $_SESSION['username']; +        $user  = $_SESSION['username']; +        $error = '';          if (extension_loaded('pam') || extension_loaded('pam_auth')) {              if (pam_auth($user, $currpass, $error, false)) { diff --git a/plugins/password/drivers/sql.php b/plugins/password/drivers/sql.php index e02bff146..7a51dfe44 100644 --- a/plugins/password/drivers/sql.php +++ b/plugins/password/drivers/sql.php @@ -34,8 +34,9 @@ class rcube_sql_password              $db = $rcmail->get_dbh();          } -        if ($err = $db->is_error()) +        if ($db->is_error()) {              return PASSWORD_ERROR; +        }          // crypted password          if (strpos($sql, '%c') !== FALSE) { @@ -183,8 +184,8 @@ class rcube_sql_password          $res = $db->query($sql, $sql_vars);          if (!$db->is_error()) { -            if (strtolower(substr(trim($query),0,6))=='select') { -                if ($result = $db->fetch_array($res)) +            if (strtolower(substr(trim($sql),0,6)) == 'select') { +                if ($db->fetch_array($res))                      return PASSWORD_SUCCESS;              } else {                  // This is the good case: 1 row updated diff --git a/plugins/password/drivers/xmail.php b/plugins/password/drivers/xmail.php index 37abc3001..59e467c5b 100644 --- a/plugins/password/drivers/xmail.php +++ b/plugins/password/drivers/xmail.php @@ -67,7 +67,7 @@ class XMail {      function send($msg)      {          socket_write($this->socket,$msg); -        if (substr($in = socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { +        if (substr(socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") {              return false;          }          return true; @@ -85,7 +85,7 @@ class XMail {              return false;          } -        if (substr($in = socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { +        if (substr(socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") {              socket_close($this->socket);              return false;          } diff --git a/plugins/password/localization/gl_ES.inc b/plugins/password/localization/gl_ES.inc index 245d1c634..93c505a6a 100644 --- a/plugins/password/localization/gl_ES.inc +++ b/plugins/password/localization/gl_ES.inc @@ -26,7 +26,7 @@ $messages = array();  $messages['nopassword'] = 'Por favor, introduza un contrasinal novo.';  $messages['nocurpassword'] = 'Por favor, introduza o contrasinal actual.';  $messages['passwordincorrect'] = 'O contrasinal actual é incorrecto.'; -$messages['passwordinconsistency'] = 'Os contrasinals non coinciden. Por favor, inténteo de novo.'; +$messages['passwordinconsistency'] = 'Os contrasinais non cadran. Por favor, inténteo outra vez.';  $messages['crypterror'] = 'Non foi posible gardar o contrasinal novo. Falta a función de cifrado.';  $messages['connecterror'] = 'Non foi posible gardar o contrasinal novo. Erro de conexión';  $messages['internalerror'] = 'Non foi posible gardar o contrasinal novo.'; diff --git a/plugins/password/localization/lb_LU.inc b/plugins/password/localization/lb_LU.inc new file mode 100644 index 000000000..9962aed28 --- /dev/null +++ b/plugins/password/localization/lb_LU.inc @@ -0,0 +1,37 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/password/localization/<lang>.inc                              | + |                                                                       | + | Localization file of the Roundcube Webmail Password plugin            | + | Copyright (C) 2012-2013, The Roundcube Dev Team                       | + |                                                                       | + | Licensed under the GNU General Public License version 3 or            | + | any later version with exceptions for skins & plugins.                | + | See the README file for a full license statement.                     | + |                                                                       | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-password/ +*/ + +$labels = array(); +$labels['changepasswd']  = 'Passwuert änneren'; +$labels['curpasswd']  = 'Aktuellt Passwuert:'; +$labels['newpasswd']  = 'Neit Passwuert:'; +$labels['confpasswd']  = 'Neit Passwuert bestätegen:'; + +$messages = array(); +$messages['nopassword'] = 'Gëff wann ech gelift en neit Passwuert an.'; +$messages['nocurpassword'] = 'Gëff wann ech gelift dat aktuellt Passwuert an.'; +$messages['passwordincorrect'] = 'Aktuellt Passwuert net korrekt.'; +$messages['passwordinconsistency'] = 'D\'Passwierder passen net, probéier wann ech gelift nach eng Kéier.'; +$messages['crypterror'] = 'Passwuert konnt net gespäichert ginn. Verschlësselungs-Funktioun feelt.'; +$messages['connecterror'] = 'Passwuert konnt net gespäichert ginn. Connectiouns-Feeler.'; +$messages['internalerror'] = 'Neit Passwuert konnt net gespäichert ginn.'; +$messages['passwordshort'] = 'D\'Passwuert muss mindestens $length Zeeche laang sinn.'; +$messages['passwordweak'] = 'D\'Passwuert muss mindestens eng Zuel an ee Sazzeechen enthalen.'; +$messages['passwordforbidden'] = 'D\'Passwuert enthält verbueden Zeechen.'; + +?> diff --git a/plugins/password/localization/lv_LV.inc b/plugins/password/localization/lv_LV.inc index 650d31b2c..ac0e5da79 100644 --- a/plugins/password/localization/lv_LV.inc +++ b/plugins/password/localization/lv_LV.inc @@ -20,18 +20,18 @@ $labels = array();  $labels['changepasswd']  = 'Nomainīt paroli';  $labels['curpasswd']  = 'Pašreizējā parole:';  $labels['newpasswd']  = 'Jaunā parole:'; -$labels['confpasswd']  = 'Vēlreiz jauno paroli:'; +$labels['confpasswd']  = 'Apstiprināt jauno paroli:';  $messages = array(); -$messages['nopassword'] = 'Lūdzu, ievadiet jauno paroli.'; -$messages['nocurpassword'] = 'Lūdzu, ievadiet pašreizējo paroli.'; -$messages['passwordincorrect'] = 'Pašreizējā parole nepareiza.'; +$messages['nopassword'] = 'Lūdzu ievadiet jauno paroli.'; +$messages['nocurpassword'] = 'Lūdzu ievadiet pašreizējo paroli.'; +$messages['passwordincorrect'] = 'Pašreizējā parole nav pareiza.';  $messages['passwordinconsistency'] = 'Paroles nesakrīt. Lūdzu, ievadiet vēlreiz.'; -$messages['crypterror'] = 'Nevarēja saglabāt jauno paroli. Trūkst kriptēšanas funkcija.'; +$messages['crypterror'] = 'Nevarēja saglabāt jauno paroli. Trūkst kriptēšanas funkcijas.';  $messages['connecterror'] = 'Nevarēja saglabāt jauno paroli. Savienojuma kļūda.';  $messages['internalerror'] = 'Nevarēja saglabāt jauno paroli.'; -$messages['passwordshort'] = 'Jaunajai parolei jābūt vismaz $length simbola garai.'; -$messages['passwordweak'] = 'Jaunajai parolei jāsatur vismaz viens cipars un punktuācijas simbols.'; -$messages['passwordforbidden'] = 'Password contains forbidden characters.'; +$messages['passwordshort'] = 'Jaunajai parolei jābūt vismaz $length simbolu garai.'; +$messages['passwordweak'] = 'Jaunajai parolei jāsatur vismaz viens cipars un speciālais simbols.'; +$messages['passwordforbidden'] = 'Parole satur neatļautus simbolus.';  ?> diff --git a/plugins/password/localization/nl_NL.inc b/plugins/password/localization/nl_NL.inc index c2c4599bc..e5b634602 100644 --- a/plugins/password/localization/nl_NL.inc +++ b/plugins/password/localization/nl_NL.inc @@ -17,21 +17,21 @@  */  $labels = array(); -$labels['changepasswd']  = 'Wijzig Wachtwoord'; -$labels['curpasswd']  = 'Huidig Wachtwoord:'; -$labels['newpasswd']  = 'Nieuw Wachtwoord:'; -$labels['confpasswd']  = 'Bevestig Nieuw Wachtwoord:'; +$labels['changepasswd']  = 'Wachtwoord wijzigen'; +$labels['curpasswd']  = 'Huidig wachtwoord:'; +$labels['newpasswd']  = 'Nieuw wachtwoord:'; +$labels['confpasswd']  = 'Bevestig nieuw wachtwoord:';  $messages = array(); -$messages['nopassword'] = 'Vul een wachtwoord in.'; -$messages['nocurpassword'] = 'vul het huidige wachtwoord in.'; +$messages['nopassword'] = 'Vul uw nieuwe wachtwoord in.'; +$messages['nocurpassword'] = 'Vul uw huidige wachtwoord in.';  $messages['passwordincorrect'] = 'Huidig wachtwoord is onjuist.';  $messages['passwordinconsistency'] = 'Wachtwoorden komen niet overeen, probeer het opnieuw.'; -$messages['crypterror'] = 'De server mist een functie om uw wachtwoord et beveiligen.'; -$messages['connecterror'] = 'Kan het nieuwe wachtwoord niet opslaan. Verbindingsfout.'; -$messages['internalerror'] = 'Uw wachtwoord kan niet worden opgeslagen.'; +$messages['crypterror'] = 'Nieuwe wachtwoord kan niet opgeslagen worden; de server mist een versleutelfunctie.'; +$messages['connecterror'] = 'Nieuwe wachtwoord kan niet opgeslagen worden; verbindingsfout.'; +$messages['internalerror'] = 'Uw nieuwe wachtwoord kan niet worden opgeslagen.';  $messages['passwordshort'] = 'Het wachtwoord moet minimaal $length tekens lang zijn.'; -$messages['passwordweak'] = 'Het wachtwoord moet minimaal één nummer en één leesteken bevatten.'; +$messages['passwordweak'] = 'Het wachtwoord moet minimaal één cijfer en één leesteken bevatten.';  $messages['passwordforbidden'] = 'Het wachtwoord bevat tekens die niet toegestaan zijn.';  ?> diff --git a/plugins/password/localization/zh_CN.inc b/plugins/password/localization/zh_CN.inc index 5a15635e7..5d14926f2 100644 --- a/plugins/password/localization/zh_CN.inc +++ b/plugins/password/localization/zh_CN.inc @@ -24,13 +24,13 @@ $labels['confpasswd']  = '确认新密码:';  $messages = array();  $messages['nopassword'] = '请输入新密码。'; -$messages['nocurpassword'] = '请输入正确的密码。'; +$messages['nocurpassword'] = '请输入当前的密码。';  $messages['passwordincorrect'] = '当前密码不正确。';  $messages['passwordinconsistency'] = '两次输入的密码不一致,请重试。'; -$messages['crypterror'] = '无法保存新密码,因为加密功能不可用。'; -$messages['connecterror'] = '无法保存新密码,因为连接出错。'; +$messages['crypterror'] = '无法保存新密码,缺少加密功能。'; +$messages['connecterror'] = '无法保存新密码,连接出错。';  $messages['internalerror'] = '无法保存新密码。'; -$messages['passwordshort'] = '密码必须至少为 $length 位。'; +$messages['passwordshort'] = '密码至少为 $length 位。';  $messages['passwordweak'] = '密码必须至少包含一个数字和一个标点符号。';  $messages['passwordforbidden'] = '密码包含禁止使用的字符。'; diff --git a/plugins/password/package.xml b/plugins/password/package.xml index 9a056dec6..16eda1ad0 100644 --- a/plugins/password/package.xml +++ b/plugins/password/package.xml @@ -15,19 +15,18 @@  		<email>alec@alec.pl</email>  		<active>yes</active>  	</lead> -	<date>2012-11-15</date> +	<date>2013-04-28</date>  	<version> -		<release>3.2</release> +		<release>3.4</release>  		<api>2.0</api>  	</version>  	<stability>  		<release>stable</release>  		<api>stable</api>  	</stability> -	<license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> +	<license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license>  	<notes> -- Fix wrong (non-specific) error message on crypt or connection error (#1488808) -- Added option to define IMAP hosts that support password changes - password_hosts +Added password_force_save option      </notes>  	<contents>  		<dir baseinstalldir="/" name="/"> @@ -347,5 +346,36 @@  - Added Samba password (#1488364)              </notes>          </release> +        <release> +            <date>2012-11-15</date> +            <version> +                <release>3.2</release> +                <api>2.0</api> +            </version> +            <stability> +                <release>stable</release> +                <api>stable</api> +            </stability> +            <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> +            <notes> +- Fix wrong (non-specific) error message on crypt or connection error (#1488808) +- Added option to define IMAP hosts that support password changes - password_hosts +            </notes> +        </release> +        <release> +            <date>2013-03-30</date> +            <version> +                <release>3.3</release> +                <api>2.0</api> +            </version> +            <stability> +                <release>stable</release> +                <api>stable</api> +            </stability> +            <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> +            <notes> +Added new cPanel driver - fixes localization related issues (#1487015) +            </notes> +        </release>      </changelog>  </package> diff --git a/plugins/password/password.php b/plugins/password/password.php index 39020a0bf..f1a3e17b9 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -1,32 +1,26 @@  <?php -/* - +-------------------------------------------------------------------------+ - | Password Plugin for Roundcube                                           | - | @version @package_version@                                              | - |                                                                         | - | Copyright (C) 2009-2010, Roundcube Dev.                                 | - |                                                                         | - | This program is free software; you can redistribute it and/or modify    | - | it under the terms of the GNU General Public License version 2          | - | as published by the Free Software Foundation.                           | - |                                                                         | - | This program is distributed in the hope that it will be useful,         | - | but WITHOUT ANY WARRANTY; without even the implied warranty of          | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           | - | GNU General Public License for more details.                            | - |                                                                         | - | You should have received a copy of the GNU General Public License along | - | with this program; if not, write to the Free Software Foundation, Inc., | - | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.             | - |                                                                         | - +-------------------------------------------------------------------------+ - | Author: Aleksander Machniak <alec@alec.pl>                              | - +-------------------------------------------------------------------------+ - - $Id: index.php 2645 2009-06-15 07:01:36Z alec $ - -*/ +/** + * Password Plugin for Roundcube + * + * @version @package_version@ + * @author Aleksander Machniak <alec@alec.pl> + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */  define('PASSWORD_CRYPT_ERROR', 1);  define('PASSWORD_ERROR', 2); @@ -147,7 +141,7 @@ class password extends rcube_plugin                  $rcmail->output->command('display_message', $this->gettext('passwordweak'), 'error');              }              // password is the same as the old one, do nothing, return success -            else if ($sespwd == $newpwd) { +            else if ($sespwd == $newpwd && !$rcmail->config->get('password_force_save')) {                  $rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation');              }              // try to save the password | 
