[horde] locking prefs in ingo in oder to lock forward

Jan Schneider jan at horde.org
Mon Aug 22 15:53:13 UTC 2011


Zitat von LALOT Dominique <dom.lalot at gmail.com>:

> Hello,
>
> I played a long day to try easy things without success. To simplify, I just
> change prefs.php
>
> // Forwarding.
> $_prefs['forward'] = array(
>     'value' => 'a:2:{s:1:"a";a:0:{}s:1:"k";i:0;}',
>     // Lock this preference to disable forwarding.
>     'locked' => true,
>     'type' => 'implicit'
> );
>
> But, first forward is in the menu (why not), but when I click on it I should
> receive a notification saying it's disabled. I put traces and dump
> categories array
>
> Aug 19 18:16:58 horde4 HORDE: [ingo] vacation locked tracedom8 [pid 31182 on
> line 78 of "/var/www/horde/ingo/lib/Ingo.php"]
> Aug 19 18:16:58 horde4 HORDE: [ingo] forward locked  tracedom10 [pid 31182
> on line 82 of "/var/www/horde/ingo/lib/Ingo.php"]
> Aug 19 18:16:58 horde4 HORDE: [ingo] tracedom categories:Array#012(#012
> [0] => 1#012    [1] => 2#012    [2] => 3#012    [3] => 4#012    [4] =>
> 5#012    [5] => 11#012    [6] => 6#012    [7] => 12#012    [9] => 7#012
> [11] => 8#012    [12] => 10#012    [13] => 14#012)#012 [pid 31182 on line 93
> of "/var/www/horde/ingo/lib/Ingo.php"]
> Aug 19 18:32:37 horde4 HORDE: [ingo] tracedom 10 Array#012(#012    [0] =>
> 1#012    [1] => 2#012    [2] => 3#012    [3] => 4#012    [4] => 5#012    [5]
> => 11#012    [6] => 6#012    [7] => 12#012    [9] => 7#012    [11] =>
> 8#012    [12] => 10#012    [13] => 14#012)#012 [pid 31180 on line 17 of
> "/var/www/horde/ingo/forward.php"]
>
> as you can see entry 10 is unset for forward
>
> $res=print_r($session->get('ingo', 'script_categories'),true);
> Horde::logMessage('tracedom '.Ingo_Storage::ACTION_FORWARD.' '.$res,ERR);
>
> /* Redirect if forward is not available. */
> if (!in_array(Ingo_Storage::ACTION_FORWARD, $session->get('ingo',
> 'script_categories'))) {
>
> --> I should go here normaly?
>
>     $notification->push(_("Forward is not supported in the current filtering
> driver."), 'horde.error');
>     Horde::url('filters.php', true)->redirect();
> }
>
> I am not a pro in PHP, but in_array should have said not found. I really
> don't understand why such an easy action is not working..

If it's so easy, why didn't you spot the error? The logic for  
disabling locked actions was wrong. Fixed in Git.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the horde mailing list