Hi guys,
I'm the admin and I know I will always use my site on my desktop which is a safe (enough) place. So I want to exclude myself from the auto-log out. I create some Admin role and assign that role to myself and mark that role as excluded.
Great!
Now, most of the other users are people who are not computer savvy and need to have a holding hand. So pretty much all the others I want to kick them out at some point. For kindness, I want to show the block to them.
Oh! But look at that, when I go to the block interface... it's not there anymore! Why? Oh! Because I'm excluded... Hmmm... does that really count?
Anyway... there is what is wrong, the first if() gets you out if you're excluded. Completely out, even when editing the blocks:
function autologout_block($op = 'list', $delta = 0, $edit = array()) {
global $user;
// Turn block off if module turned off, anonymous user, or exluded by role.
if (!_autologout_local_settings('enabled') || $user->uid == 0 || _autologout_exclude_by_role()) {
return;
}
switch ($op) {
1st if() goes like this:
// Turn block off if module turned off, anonymous user, or exluded by role.
if (!_autologout_local_settings('enabled') || $user->uid == 0) {
2nd if() in 'view' case (which was removed) needs to include that last test:
case 'view':
if (_autologout_exclude_by_role()) {
return;
}
Nice optimization though. 8-)
Oh! And after that upgrade, I could not use the admin/build/module page. It generated errors. No idea what could be wrong there...
Thank you.
Alexis
Comments
Comment #1
AlexisWilke commentedFixed up the title 8-)
Comment #2
ferrum commentedsame problem for 6.x-2.6
Comment #3
johnennew commentedMoving to head
Comment #4
johnennew commentedThis issue is not present in the supported 7.x-4.x / 6.x-4.x branches.
Comment #4.0
johnennew commentedSmall grammar error