handlelogin func_get_args error

Discuss everything related to ApPHP MicroBlog. Any questions related to developing or using should be posted to this forum.

Moderators: ne_moj, alexmst, zewa, ICap

paragate
Master
Master
Posts: 151
Joined: Nov 13th, '14, 13:04
Location: Denmark, Odense

handlelogin func_get_args error

Postby paragate » Nov 25th, '15, 09:12

Hi,
I can not get handlelogin to function as planned. Seems i wont accept call from within another function..
in helpers/CAuth.php/isLoggedInAs() i can only get it to work if i remove func_get_args()
as
public static function isLoggedInAs($roles='')
{
if(!self::isLoggedIn()) return false;
$loggedRole = self::getLoggedRole();
//$roles = func_get_args();
$exproles = explode(",",$roles);
if(in_array($loggedRole, $exproles)){

return true;
}
return false;
}
and then i can call

CAuth::handleLogin('backend/login','owner,author,member');
otherwise it will only take one parameter ex. 'owner'

Need help with func_get_args(); so i can remove $roles again

administrator
Site Admin
Site Admin
Posts: 5930
Joined: Jan 7th, '09, 23:18
Contact:

Re: handlelogin func_get_args error

Postby administrator » Nov 30th, '15, 14:27

Why? Can you please show us your code that cannot use CAuth?

paragate
Master
Master
Posts: 151
Joined: Nov 13th, '14, 13:04
Location: Denmark, Odense

Re: handlelogin func_get_args error

Postby paragate » Dec 1st, '15, 22:35

More of the functions in CAuth.php use handlelogin()
and refer to isloggedinas.... here i have a problem with $Roles. It only
take one parameter ex. 'owner' so if you send more 'owner,admin' its not
working as i think.
Otherwise for what reason should there be the posibilitiy to add new admins?
I was wondering if $Roles was so that the function kan lookup more roles at once.

administrator
Site Admin
Site Admin
Posts: 5930
Joined: Jan 7th, '09, 23:18
Contact:

Re: handlelogin func_get_args error

Postby administrator » Dec 3rd, '15, 13:32

If you have to use more roles, you may rewrite this function or this helper at all.
See viewtopic.php?f=80&t=4997


Return to “ApPHP MicroBlog Talk {developers/users}”