| | |
| | | */ |
| | | function acl_actions() |
| | | { |
| | | $action = trim(get_input_value('_act', RCUBE_INPUT_GPC)); |
| | | $action = trim(rcube_utils::get_input_value('_act', rcube_utils::INPUT_GPC)); |
| | | |
| | | // Connect to IMAP |
| | | $this->rc->storage_init(); |
| | |
| | | { |
| | | $this->load_config(); |
| | | |
| | | $search = get_input_value('_search', RCUBE_INPUT_GPC, true); |
| | | $sid = get_input_value('_id', RCUBE_INPUT_GPC); |
| | | $search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC, true); |
| | | $sid = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC); |
| | | $users = array(); |
| | | |
| | | if ($this->init_ldap()) { |
| | |
| | | // add Info fieldset if it doesn't exist |
| | | if (!isset($args['form']['props']['fieldsets']['info'])) |
| | | $args['form']['props']['fieldsets']['info'] = array( |
| | | 'name' => rcube_label('info'), |
| | | 'name' => $this->rc->gettext('info'), |
| | | 'content' => array()); |
| | | |
| | | // Display folder rights to 'Info' fieldset |
| | | $args['form']['props']['fieldsets']['info']['content']['myrights'] = array( |
| | | 'label' => Q($this->gettext('myrights')), |
| | | 'label' => rcube::Q($this->gettext('myrights')), |
| | | 'value' => $this->acl2text($myrights) |
| | | ); |
| | | |
| | |
| | | $this->rc->output->add_label('autocompletechars', 'autocompletemore'); |
| | | |
| | | $args['form']['sharing'] = array( |
| | | 'name' => Q($this->gettext('sharing')), |
| | | 'name' => rcube::Q($this->gettext('sharing')), |
| | | 'content' => $this->rc->output->parse('acl.table', false, false), |
| | | ); |
| | | |
| | |
| | | |
| | | // filter out virtual rights (c or d) the server may return |
| | | $userrights = array_intersect($rights, $supported); |
| | | $userid = html_identifier($user); |
| | | $userid = rcube_utils::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', Q($user)); |
| | | $table->add('user', rcube::Q($user)); |
| | | |
| | | foreach ($items as $key => $right) { |
| | | $in = $this->acl_compare($userrights, $right); |
| | |
| | | */ |
| | | private function action_save() |
| | | { |
| | | $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)); |
| | | $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)); |
| | | |
| | | $acl = array_intersect(str_split($acl), $this->rights_supported()); |
| | | $users = $oldid ? array($user) : explode(',', $user); |
| | |
| | | } |
| | | else { |
| | | if (!strpos($user, '@') && ($realm = $this->get_realm())) { |
| | | $user .= '@' . rcube_idn_to_ascii(preg_replace('/^@/', '', $realm)); |
| | | $user .= '@' . rcube_utils::idn_to_ascii(preg_replace('/^@/', '', $realm)); |
| | | } |
| | | $username = $user; |
| | | } |
| | |
| | | |
| | | if ($user != $_SESSION['username'] && $username != $_SESSION['username']) { |
| | | if ($this->rc->storage->set_acl($mbox, $user, $acl)) { |
| | | $ret = array('id' => html_identifier($user), |
| | | $ret = array('id' => rcube_utils::html_identifier($user), |
| | | 'username' => $username, 'acl' => implode($acl), 'old' => $oldid); |
| | | $this->rc->output->command('acl_update', $ret); |
| | | $result++; |
| | |
| | | */ |
| | | private function action_delete() |
| | | { |
| | | $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); //UTF7-IMAP |
| | | $user = trim(get_input_value('_user', RCUBE_INPUT_GPC)); |
| | | $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)); |
| | | |
| | | $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', html_identifier($u)); |
| | | $this->rc->output->command('acl_remove_row', rcube_utils::html_identifier($u)); |
| | | } |
| | | else { |
| | | $error = true; |
| | |
| | | return; |
| | | } |
| | | |
| | | $this->mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); // UTF7-IMAP |
| | | $advanced = trim(get_input_value('_mode', RCUBE_INPUT_GPC)); |
| | | $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)); |
| | | $advanced = $advanced == 'advanced' ? true : false; |
| | | |
| | | // Save state in user preferences |
| | |
| | | |
| | | foreach ($supported as $right) { |
| | | if (in_array($right, $rights)) { |
| | | $list[] = html::tag('li', null, Q($this->gettext('acl' . $right))); |
| | | $list[] = html::tag('li', null, rcube::Q($this->gettext('acl' . $right))); |
| | | } |
| | | } |
| | | |
| | | if (count($list) == count($supported)) |
| | | return Q($this->gettext('aclfull')); |
| | | return rcube::Q($this->gettext('aclfull')); |
| | | |
| | | return html::tag('ul', $attrib, implode("\n", $list)); |
| | | } |