summaryrefslogtreecommitdiff
path: root/plugins/password
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/password')
-rw-r--r--plugins/password/config.inc.php.dist6
-rw-r--r--plugins/password/drivers/dbmail.php2
-rw-r--r--plugins/password/drivers/sasl.php2
-rw-r--r--plugins/password/drivers/virtualmin.php2
-rw-r--r--plugins/password/localization/ku.inc18
-rw-r--r--plugins/password/localization/ro_RO.inc31
-rw-r--r--plugins/password/package.xml34
-rw-r--r--plugins/password/password.php14
8 files changed, 94 insertions, 15 deletions
diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist
index 8d7b433af..e960bbe00 100644
--- a/plugins/password/config.inc.php.dist
+++ b/plugins/password/config.inc.php.dist
@@ -25,6 +25,12 @@ $rcmail_config['password_log'] = false;
// will be not available (no Password tab in Settings)
$rcmail_config['password_login_exceptions'] = null;
+// Array of hosts that support password changing. Default is NULL.
+// Listed hosts will feature a Password option in Settings; others will not.
+// Example:
+//$rcmail_config['password_hosts'] = array('mail.example.com', 'mail2.example.org');
+$rcmail_config['password_hosts'] = null;
+
// SQL Driver options
// ------------------
diff --git a/plugins/password/drivers/dbmail.php b/plugins/password/drivers/dbmail.php
index a7c2f46a3..e4c0d52e3 100644
--- a/plugins/password/drivers/dbmail.php
+++ b/plugins/password/drivers/dbmail.php
@@ -19,7 +19,7 @@ class rcube_dbmail_password
{
function password_save($currpass, $newpass)
{
- $curdir = INSTALL_PATH . 'plugins/password/helpers';
+ $curdir = RCUBE_PLUGINS_DIR . 'password/helpers';
$username = escapeshellcmd($_SESSION['username']);
$args = rcmail::get_instance()->config->get('password_dbmail_args', '');
diff --git a/plugins/password/drivers/sasl.php b/plugins/password/drivers/sasl.php
index 957c1196c..9380cf838 100644
--- a/plugins/password/drivers/sasl.php
+++ b/plugins/password/drivers/sasl.php
@@ -20,7 +20,7 @@ class rcube_sasl_password
{
function save($currpass, $newpass)
{
- $curdir = INSTALL_PATH . 'plugins/password/helpers';
+ $curdir = RCUBE_PLUGINS_DIR . 'password/helpers';
$username = escapeshellcmd($_SESSION['username']);
$args = rcmail::get_instance()->config->get('password_saslpasswd_args', '');
diff --git a/plugins/password/drivers/virtualmin.php b/plugins/password/drivers/virtualmin.php
index f9eca9633..69f1475d4 100644
--- a/plugins/password/drivers/virtualmin.php
+++ b/plugins/password/drivers/virtualmin.php
@@ -59,7 +59,7 @@ class rcube_virtualmin_password
$username = escapeshellcmd($username);
$domain = escapeshellcmd($domain);
$newpass = escapeshellcmd($newpass);
- $curdir = INSTALL_PATH . 'plugins/password/helpers';
+ $curdir = RCUBE_PLUGINS_DIR . 'password/helpers';
exec("$curdir/chgvirtualminpasswd modify-user --domain $domain --user $username --pass $newpass", $output, $returnvalue);
diff --git a/plugins/password/localization/ku.inc b/plugins/password/localization/ku.inc
new file mode 100644
index 000000000..8163df8e8
--- /dev/null
+++ b/plugins/password/localization/ku.inc
@@ -0,0 +1,18 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/ku/labels.inc |
+ | |
+ | Language file of the Roundcube Webmail client |
+ | Copyright (C) 2012, The Roundcube Dev Team |
+ | Licensed under the GNU General Public License |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: ZirYaN <ziryan.net@gmail.com> |
+ +-----------------------------------------------------------------------+
+*/
+
+$labels = array();
+$labels['changepasswd'] = 'گۆڕینی ووشەی نهێنی';
+
diff --git a/plugins/password/localization/ro_RO.inc b/plugins/password/localization/ro_RO.inc
new file mode 100644
index 000000000..61aa0aacb
--- /dev/null
+++ b/plugins/password/localization/ro_RO.inc
@@ -0,0 +1,31 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/ro_RO/labels.inc |
+ | |
+ | Language file of the Roundcube Webmail client |
+ | Copyright (C) 2012, The Roundcube Dev Team |
+ | Licensed under the GNU General Public License |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Raduta Alex <raduta.alex@gmail.com> |
+ +-----------------------------------------------------------------------+
+*/
+
+$labels = array();
+$labels['changepasswd'] = 'Schimbați parola';
+$labels['curpasswd'] = 'Parola curentă:';
+$labels['newpasswd'] = 'Parola nouă:';
+$labels['confpasswd'] = 'Confirmați parola nouă:';
+$labels['nopassword'] = 'Te rog să introduci noua parolă.';
+$labels['nocurpassword'] = 'Te rog să introduci parola curentă';
+$labels['passwordincorrect'] = 'Parola curentă este incorectă.';
+$labels['passwordinconsistency'] = 'Parolele nu se potrivesc, vă rugăm să mai încercați';
+$labels['crypterror'] = 'Nu am reușit să salvez noua parolă. Lipsa funcției de criptare.';
+$labels['connecterror'] = 'Nu am reușit să salvez noua parolă. Eroare connexiune.';
+$labels['internalerror'] = 'Nu am reușit să salvez noua parolă.';
+$labels['passwordshort'] = 'Parola trebuie să aibă $length caractere.';
+$labels['passwordweak'] = 'Parola trebuie să conțina cel puțin un număr si un semn de punctuație';
+$labels['passwordforbidden'] = 'Parola conține caractere nepermise.';
+
diff --git a/plugins/password/package.xml b/plugins/password/package.xml
index 29d222409..9a056dec6 100644
--- a/plugins/password/package.xml
+++ b/plugins/password/package.xml
@@ -15,9 +15,9 @@
<email>alec@alec.pl</email>
<active>yes</active>
</lead>
- <date>2012-03-07</date>
+ <date>2012-11-15</date>
<version>
- <release>3.1</release>
+ <release>3.2</release>
<api>2.0</api>
</version>
<stability>
@@ -26,13 +26,8 @@
</stability>
<license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license>
<notes>
-- Added pw_usermod driver (#1487826)
-- Added option password_login_exceptions (#1487826)
-- Added domainfactory driver (#1487882)
-- Added DBMail driver (#1488281)
-- Helper files moved to helpers/ directory from drivers/
-- Added Expect driver (#1488363)
-- Added Samba password (#1488364)
+- 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>
<contents>
<dir baseinstalldir="/" name="/">
@@ -331,5 +326,26 @@
- Fixed drivers namespace issues
</notes>
</release>
+ <release>
+ <date>2012-03-07</date>
+ <version>
+ <release>3.1</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 pw_usermod driver (#1487826)
+- Added option password_login_exceptions (#1487826)
+- Added domainfactory driver (#1487882)
+- Added DBMail driver (#1488281)
+- Helper files moved to helpers/ directory from drivers/
+- Added Expect driver (#1488363)
+- Added Samba password (#1488364)
+ </notes>
+ </release>
</changelog>
</package>
diff --git a/plugins/password/password.php b/plugins/password/password.php
index 58b6f8cd9..806db0586 100644
--- a/plugins/password/password.php
+++ b/plugins/password/password.php
@@ -3,7 +3,7 @@
/*
+-------------------------------------------------------------------------+
| Password Plugin for Roundcube |
- | @version @package_version@ |
+ | @version @package_version@ |
| |
| Copyright (C) 2009-2010, Roundcube Dev. |
| |
@@ -56,7 +56,13 @@ class password extends rcube_plugin
$this->load_config();
- // Exceptions list
+ // Host exceptions
+ $hosts = $rcmail->config->get('password_hosts');
+ if (!empty($hosts) && !in_array($_SESSION['storage_host'], $hosts)) {
+ return;
+ }
+
+ // Login exceptions
if ($exceptions = $rcmail->config->get('password_login_exceptions')) {
$exceptions = array_map('trim', (array) $exceptions);
$exceptions = array_filter($exceptions);
@@ -158,7 +164,7 @@ class password extends rcube_plugin
// Log password change
if ($rcmail->config->get('password_log')) {
write_log('password', sprintf('Password changed for user %s (ID: %d) from %s',
- $rcmail->user->get_username(), $rcmail->user->ID, rcmail_remote_ip()));
+ $rcmail->get_user_name(), $rcmail->user->ID, rcmail_remote_ip()));
}
}
else {
@@ -274,8 +280,10 @@ class password extends rcube_plugin
return;
case PASSWORD_CRYPT_ERROR;
$reason = $this->gettext('crypterror');
+ break;
case PASSWORD_CONNECT_ERROR;
$reason = $this->gettext('connecterror');
+ break;
case PASSWORD_ERROR:
default:
$reason = $this->gettext('internalerror');