[dev] accessing $prefs from $conf[hooks][postauthenticate]

Jason Clifton jason at citydiesel.net
Thu Jun 28 16:44:37 UTC 2007


Sorry I meant to put $perms object in the subject.  What I meant by  
doesnt seem to exist is that  
$perms->getPermissions('horde:local_user_only') does not return the  
value that I expect it do. The only way I can think of to explain is  
with an example if I do this:

  if (!function_exists('_horde_hook_postauthenticate')) {
      function _horde_hook_postauthenticate($userID, $credential, $realm){
        global $perms;
if ($perms->exists('horde:local_user_only')) {
echo 'does exist<br>';
$test = $perms->getPermissions('horde:local_user_only');
echo $test;
}else{
   echo 'doesnt exist';
}
return false;
  }
}

does exist<br> gets echoed out with no value below it

if I do the same thing except return true instead of false.
"does exist
1"
gets echoed at the very top of the sidebar and top of the portal page.

I'm guessing this means something is not initialized yet...

The $perms object does seem to be initialized however, doing a  
var_dump($perms) or print_r($perms) does return a valid array.  I  
don't really know what I am looking for in the array to see if it has  
the permissions data in it though.


Thanks for the help

Jason


More information about the dev mailing list