Skip to content

Commit

Permalink
Hide more features when using POP3
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 23, 2014
1 parent 2ecf048 commit 8ff07ba
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
6 changes: 3 additions & 3 deletions imp/js/dimpbase.js
Expand Up @@ -1325,10 +1325,10 @@ var DimpBase = {

tmp = Object.isUndefined(baseelt.retrieve('u'));
if (DimpCore.conf.poll_alter) {
[ $('ctx_mbox_poll') ].invoke(tmp ? 'show' : 'hide');
[ $('ctx_mbox_nopoll') ].invoke(tmp ? 'hide' : 'show');
[ $('ctx_mbox_poll') ].compact().invoke(tmp ? 'show' : 'hide');
[ $('ctx_mbox_nopoll') ].compact().invoke(tmp ? 'hide' : 'show');
} else {
$('ctx_mbox_poll', 'ctx_mbox_nopoll').invoke('hide');
$('ctx_mbox_poll', 'ctx_mbox_nopoll').compact().invoke('hide');
}

[ $('ctx_mbox_expand').up() ].invoke(this.getSubMboxElt(baseelt) ? 'show' : 'hide');
Expand Down
29 changes: 28 additions & 1 deletion imp/lib/Dynamic/Mailbox.php
Expand Up @@ -380,7 +380,34 @@ protected function _addMailboxVars()
);

if (!$subscribe) {
unset($context['ctx_mbox']['sub'], $context['ctx_mbox']['unsub']);
unset(
$context['ctx_mbox']['sub'],
$context['ctx_mbox']['unsub']
);
}
if (!$imp_imap->access(IMP_Imap::ACCESS_IMPORT)) {
unset($context['ctx_mbox']['import']);
}
if (!$imp_imap->access(IMP_Imap::ACCESS_FLAGS)) {
unset(
$context['ctx_mbox']['_sep2'],
$context['ctx_mbox']['setflag'],
$context['ctx_mbox']['_sep3'],
$context['ctx_mbox']['poll'],
$context['ctx_mbox']['nopoll']
);
}
if (!$imp_imap->access(IMP_Imap::ACCESS_FOLDERS)) {
unset(
$context['ctx_mbox']['_sep7'],
$context['ctx_mbox']['size']
);
}
if (!$imp_imap->access(IMP_Imap::ACCESS_SEARCH)) {
unset(
$context['ctx_mbox']['_sep4'],
$context['ctx_mbox']['search']
);
}

/* Other Actions context menu. */
Expand Down
2 changes: 2 additions & 0 deletions imp/lib/Imap.php
Expand Up @@ -55,6 +55,7 @@ class IMP_Imap implements Serializable
const ACCESS_ACL = 10;
const ACCESS_DRAFTS = 11;
const ACCESS_REMOTE = 12;
const ACCESS_IMPORT = 14;

/* Default namespace. */
const NS_DEFAULT = "\0default";
Expand Down Expand Up @@ -399,6 +400,7 @@ public function access($right)

case self::ACCESS_DRAFTS:
case self::ACCESS_FLAGS:
case self::ACCESS_IMPORT:
case self::ACCESS_SEARCH:
case self::ACCESS_UNSEEN:
return $this->isImap();
Expand Down

0 comments on commit 8ff07ba

Please sign in to comment.