Boxerman Posted October 28, 2011 Share Posted October 28, 2011 Hi guys, I am trying to get a admin panel, which when the user is logged in, it will check if there user access is(say for this post) 9... If there access is 9 in the database then direct to admin panel if not return them home. Thanks guys Quote Link to comment https://forums.phpfreaks.com/topic/249963-check-users/ Share on other sites More sharing options...
Nodral Posted October 28, 2011 Share Posted October 28, 2011 DO youi have any code? Have you got a DB set up already? Are you experiencing errors? Need more information from you Quote Link to comment https://forums.phpfreaks.com/topic/249963-check-users/#findComment-1282923 Share on other sites More sharing options...
Boxerman Posted October 28, 2011 Author Share Posted October 28, 2011 Hi thanks for the quick reply, at the moment i havnt coded it.. But the database is set up and users are in there, i've manually set the user access levels for them.. Quote Link to comment https://forums.phpfreaks.com/topic/249963-check-users/#findComment-1282925 Share on other sites More sharing options...
trq Posted October 28, 2011 Share Posted October 28, 2011 Why don't you try coding it then and come back when you have a specific question? Quote Link to comment https://forums.phpfreaks.com/topic/249963-check-users/#findComment-1282928 Share on other sites More sharing options...
Boxerman Posted October 28, 2011 Author Share Posted October 28, 2011 This is why im asking, im not sure how to start coding or how to attempt it.. Would it be something like... Check database for users details then check the access_level field for value and if it matches 9 then do this else redirect? Quote Link to comment https://forums.phpfreaks.com/topic/249963-check-users/#findComment-1282933 Share on other sites More sharing options...
Boxerman Posted October 28, 2011 Author Share Posted October 28, 2011 <?php if ($user->hasAccessLevel(9)){ ?> Divert to admin panel <?php }else{ ?> Redirect home <?php } ?> Is that something along the lines? Quote Link to comment https://forums.phpfreaks.com/topic/249963-check-users/#findComment-1282936 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.