summaryrefslogtreecommitdiff
path: root/plugins/acl/acl.php
diff options
context:
space:
mode:
authorHugues Hiegel <root@paranoid>2014-08-05 16:46:22 +0200
committerHugues Hiegel <root@paranoid>2014-08-05 16:46:22 +0200
commit59478e06c25303a790a0840ab2ac30662c4ef781 (patch)
tree8d5e964a8f94adaef41efebb0597629f11495c42 /plugins/acl/acl.php
parent7c494b677f9e470ee0d32e62cfa8dc709f39e748 (diff)
c'est la merde..working
Diffstat (limited to 'plugins/acl/acl.php')
-rw-r--r--plugins/acl/acl.php56
1 files changed, 28 insertions, 28 deletions
diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php
index a840bcd58..466185dcc 100644
--- a/plugins/acl/acl.php
+++ b/plugins/acl/acl.php
@@ -9,18 +9,18 @@
*
* Copyright (C) 2011-2012, Kolab Systems AG
*
- * 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 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, see http://www.gnu.org/licenses/.
+ * 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.
*/
class acl extends rcube_plugin
@@ -55,7 +55,7 @@ class acl extends rcube_plugin
*/
function acl_actions()
{
- $action = trim(rcube_utils::get_input_value('_act', rcube_utils::INPUT_GPC));
+ $action = trim(get_input_value('_act', RCUBE_INPUT_GPC));
// Connect to IMAP
$this->rc->storage_init();
@@ -85,8 +85,8 @@ class acl extends rcube_plugin
{
$this->load_config();
- $search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC, true);
- $sid = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC);
+ $search = get_input_value('_search', RCUBE_INPUT_GPC, true);
+ $sid = get_input_value('_id', RCUBE_INPUT_GPC);
$users = array();
if ($this->init_ldap()) {
@@ -148,7 +148,6 @@ class acl extends rcube_plugin
// Load localization and include scripts
$this->load_config();
- $this->specials = $this->rc->config->get('acl_specials', $this->specials);
$this->add_texts('localization/', array('deleteconfirm', 'norights',
'nouser', 'deleting', 'saving'));
$this->include_script('acl.js');
@@ -158,12 +157,12 @@ class acl extends rcube_plugin
// add Info fieldset if it doesn't exist
if (!isset($args['form']['props']['fieldsets']['info']))
$args['form']['props']['fieldsets']['info'] = array(
- 'name' => $this->rc->gettext('info'),
+ 'name' => rcube_label('info'),
'content' => array());
// Display folder rights to 'Info' fieldset
$args['form']['props']['fieldsets']['info']['content']['myrights'] = array(
- 'label' => rcube::Q($this->gettext('myrights')),
+ 'label' => Q($this->gettext('myrights')),
'value' => $this->acl2text($myrights)
);
@@ -187,7 +186,7 @@ class acl extends rcube_plugin
$this->rc->output->add_label('autocompletechars', 'autocompletemore');
$args['form']['sharing'] = array(
- 'name' => rcube::Q($this->gettext('sharing')),
+ 'name' => Q($this->gettext('sharing')),
'content' => $this->rc->output->parse('acl.table', false, false),
);
@@ -385,6 +384,7 @@ class acl extends rcube_plugin
$table->add_header(array('class' => 'acl'.$key, 'title' => $label), $label);
}
+ $i = 1;
$js_table = array();
foreach ($acl as $user => $rights) {
if ($this->rc->storage->conn->user == $user) {
@@ -393,14 +393,14 @@ class acl extends rcube_plugin
// filter out virtual rights (c or d) the server may return
$userrights = array_intersect($rights, $supported);
- $userid = rcube_utils::html_identifier($user);
+ $userid = html_identifier($user);
if (!empty($this->specials) && in_array($user, $this->specials)) {
$user = $this->gettext($user);
}
$table->add_row(array('id' => 'rcmrow'.$userid));
- $table->add('user', rcube::Q($user));
+ $table->add('user', Q($user));
foreach ($items as $key => $right) {
$in = $this->acl_compare($userrights, $right);
@@ -428,10 +428,10 @@ class acl extends rcube_plugin
*/
private function action_save()
{
- $mbox = trim(rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)); // UTF7-IMAP
- $user = trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_GPC));
- $acl = trim(rcube_utils::get_input_value('_acl', rcube_utils::INPUT_GPC));
- $oldid = trim(rcube_utils::get_input_value('_old', rcube_utils::INPUT_GPC));
+ $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); // UTF7-IMAP
+ $user = trim(get_input_value('_user', RCUBE_INPUT_GPC));
+ $acl = trim(get_input_value('_acl', RCUBE_INPUT_GPC));
+ $oldid = trim(get_input_value('_old', RCUBE_INPUT_GPC));
$acl = array_intersect(str_split($acl), $this->rights_supported());
$users = $oldid ? array($user) : explode(',', $user);
@@ -445,7 +445,7 @@ class acl extends rcube_plugin
}
else if (!empty($user)) {
if (!strpos($user, '@') && ($realm = $this->get_realm())) {
- $user .= '@' . rcube_utils::idn_to_ascii(preg_replace('/^@/', '', $realm));
+ $user .= '@' . rcube_idn_to_ascii(preg_replace('/^@/', '', $realm));
}
$username = $user;
}
@@ -459,7 +459,7 @@ class acl extends rcube_plugin
if ($user != $_SESSION['username'] && $username != $_SESSION['username']) {
if ($this->rc->storage->set_acl($mbox, $user, $acl)) {
- $ret = array('id' => rcube_utils::html_identifier($user),
+ $ret = array('id' => html_identifier($user),
'username' => $username, 'acl' => implode($acl), 'old' => $oldid);
$this->rc->output->command('acl_update', $ret);
$result++;
@@ -480,15 +480,15 @@ class acl extends rcube_plugin
*/
private function action_delete()
{
- $mbox = trim(rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)); //UTF7-IMAP
- $user = trim(rcube_utils::get_input_value('_user', rcube_utils::INPUT_GPC));
+ $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); //UTF7-IMAP
+ $user = trim(get_input_value('_user', RCUBE_INPUT_GPC));
$user = explode(',', $user);
foreach ($user as $u) {
$u = trim($u);
if ($this->rc->storage->delete_acl($mbox, $u)) {
- $this->rc->output->command('acl_remove_row', rcube_utils::html_identifier($u));
+ $this->rc->output->command('acl_remove_row', html_identifier($u));
}
else {
$error = true;
@@ -512,8 +512,8 @@ class acl extends rcube_plugin
return;
}
- $this->mbox = trim(rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true)); // UTF7-IMAP
- $advanced = trim(rcube_utils::get_input_value('_mode', rcube_utils::INPUT_GPC));
+ $this->mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); // UTF7-IMAP
+ $advanced = trim(get_input_value('_mode', RCUBE_INPUT_GPC));
$advanced = $advanced == 'advanced' ? true : false;
// Save state in user preferences
@@ -548,12 +548,12 @@ class acl extends rcube_plugin
foreach ($supported as $right) {
if (in_array($right, $rights)) {
- $list[] = html::tag('li', null, rcube::Q($this->gettext('acl' . $right)));
+ $list[] = html::tag('li', null, Q($this->gettext('acl' . $right)));
}
}
if (count($list) == count($supported))
- return rcube::Q($this->gettext('aclfull'));
+ return Q($this->gettext('aclfull'));
return html::tag('ul', $attrib, implode("\n", $list));
}