From e68d2a15f52dcc13e5b2a84a3d2f8645ccb5cec1 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Thu, 21 Feb 2013 04:30:19 -0500
Subject: [PATCH] Don't try to print file extension in a warning message if it's not available
---
plugins/acl/acl.php | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php
index 1952dad..ab7c8ce 100644
--- a/plugins/acl/acl.php
+++ b/plugins/acl/acl.php
@@ -441,7 +441,7 @@
if (!empty($this->specials) && in_array($user, $this->specials)) {
$username = $this->gettext($user);
}
- else {
+ else if (!empty($user)) {
if (!strpos($user, '@') && ($realm = $this->get_realm())) {
$user .= '@' . rcube_idn_to_ascii(preg_replace('/^@/', '', $realm));
}
@@ -451,6 +451,9 @@
if (!$acl || !$user || !strlen($mbox)) {
continue;
}
+
+ $user = $this->mod_login($user);
+ $username = $this->mod_login($username);
if ($user != $_SESSION['username'] && $username != $_SESSION['username']) {
if ($this->rc->storage->set_acl($mbox, $user, $acl)) {
@@ -703,4 +706,23 @@
return $this->ldap->ready;
}
+
+ /**
+ * Modify user login according to 'login_lc' setting
+ */
+ protected function mod_login($user)
+ {
+ $login_lc = $this->rc->config->get('login_lc');
+
+ if ($login_lc === true || $login_lc == 2) {
+ $user = mb_strtolower($user);
+ }
+ // lowercase domain name
+ else if ($login_lc && strpos($user, '@')) {
+ list($local, $domain) = explode('@', $user);
+ $user = $local . '@' . mb_strtolower($domain);
+ }
+
+ return $user;
+ }
}
--
Gitblit v1.9.1