[horde] registry.php admin modules

Joseph Malone josephmalone at higlum.com
Wed Jun 14 15:36:13 PDT 2006


___________________________________
Joseph Malone
Higgins Hardwoods
MIS Department
(925)245-4359
6999 Southfront Rd,
Livermore, CA
94551


Quoting Jan Schneider <jan at horde.org>:

> Zitat von Joseph Malone <josephmalone at higlum.com>:
>
>> Quoting Chuck Hagenbuch <chuck at horde.org>:
>>
>>> Quoting Joseph Malone <josephmalone at higlum.com>:
>>>
>>>> When we set a module to 'admin,' the  module's image won't show up for
>>>> one particular user (me).
>>>> However, if we set the module to 'admins,' it works just fine for  
>>>>  all users.
>>>
>>> 'admins,' ? That's not a valid status setting...
>>>
>>
>> yes, i'm aware that it isn't valid, which makes it even more strange
>> as to why it works.
>
> Probably because applications are blacklisted in the registry, not
> whitelisted.
>

hmmm, not sure what you mean by black/whitelisting in the registry.   
Do you mean modules being set to active/inactive?

heres a few samples from the registry:

an admin module that will work when set to "admins" (if set to "admin"  
it works for everyone but me):

$this->applications['nic'] = array(
    'fileroot' => dirname(__FILE__) . '/../nic',
    'webroot' => $this->applications['horde']['webroot'] . '/nic',
    'name' => _("Network"),
    'status' => 'admins',
    'provides' => 'net',
    'menu_parent' => 'devel'
);

a module that we restrict with an if statement:

$reporters =  
array('Administrator','malone','rt01','erikh','cliff','monica','justink');
$uid = Auth::getAuth();

if ($uid, $reporters){
$this->applications['pelladisp'] = array(
    'fileroot' => dirname(__FILE__) . '/../pelladisp',
    'webroot' => $this->applications['horde']['webroot'] . '/pelladisp',
    'icon' => $this->applications['horde']['webroot'] .  
'/pelladisp/themes/graphics/info.png',
    'name' => _("Disp. Sht."),
    'status' => 'active',
    'menu_parent' => 'info'
);
}

note that when i sign in (as 'malone') the above module will *not* be active.

also, i've realized that in lib/Horde/Registry.php around line 180 the  
following if statement,

/* Load registry information from the session, if available. */
        if (!empty($_SESSION['_registrycache']) &&
            ($_SESSION['_registrymtime']['registry.php'] == $reg_mtime)) {
            foreach ($_SESSION['_registrycache'] as $key => $val) {
                $this->$key = $val;
            }


is *always* true, even if i've just cleared my cache, opened my  
browser, etc.. is this normal behavior?  if i comment out that if  
statement, forcing horde to read registry.php, i get the corrent  
settings and modules in my sidebar....





> Jan.
>
> -- 
> Do you need professional PHP or Horde consulting?
> http://horde.org/consulting/
>
> -- 
> Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org





More information about the horde mailing list