Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fSession && fAuthorization::requireAuthLevel

posted by frank 9 years ago

Hello,

I'm confused. I have made, on my own xammp server, an project with flourishlib. This is working like a dream. Now i've uploaded this website to a customers webserver. The database connection is also working perfectly.

I've changed the init.php and the config.php and all works fine.

I defined the url -> working define('SITE_URL',"http://somewebsite.nl/");

I defined the login-> working fAuthorization::setLoginPage('http://somewebsite/login.php');

I defined the session path-> working fSession::setPath(DOC_ROOT . '/storage/session/'); //this map has chmod 777 rights

And it really writes the session to this path. Now i'm using a login page to set the requireAuthLevel, it connects to the database and returns 1 row with the correct information.

Next i set the authlevel : fAuthorization::setUserAuthLevel('admin'); fAuthorization::setUserToken($user); // this is the current user object fURL::redirect(SITE_URL.'index.php')

Next i get redirected to my index.php and run into the next piece of code works as designed : fAuthorization::requireAuthLevel('user'); $user = fAuthorization::getUserToken();

I believe this is where it goes very wrong? No Error just a redirect to my login page. Somehow fAuthorization::requireAuthLevel('user') doesn't work and doesn't generate any error!?

So i have the right privileges (i'm 'admin' higher then 'user' in my code) in the code so i should get passed the fAuthorization::requireAuthLevel('user') part??

Any idea's? Differences with php version or some webserver settings? Any clue where to look or how the retrieve the error or anything :)

Please help.

Kind regards,

Frank van der Geld

Damm, it was because of a sub-domain that it wasn't working.

using: static public function ignoreSubdomain()

My bad.

Frank

posted by anonymous 9 years ago