Jump to content

Admin User


vadymka

Recommended Posts

Hi..

How can i create admin user?

i Added a table named "admin" i want it to be.. if its 0 user is a simple member.. if its 1 user have admin.

if user have admin... he will have a link "CP" that will go to the control panel..members cant see the link. [even if simple member have the link he dont have acces to it]

And, if user have admin.. a link will apear near the chat.. "Clear Chat" that clears the chat messages..[i have a chat]

 

Can someone help me with this??

Thanks

Link to comment
https://forums.phpfreaks.com/topic/280343-admin-user/
Share on other sites

It's pretty simple logic. When you log your users in, save their 'status' in the $_SESSION array. Then, just check that to see if they are an admin or not.

 

if (isset($_SESSION['status']) && $_SESSION['status'] == 1) {
  // you have an admin
} else {
  // you have a normal user
}

 

I made it..

i used

<?php if($CURUSER["status"]=='Admin'){code here}   ?>

can you now help me with http://forums.phpfreaks.com/topic/280344-how-to-update-phpmyadmin/ please?

Link to comment
https://forums.phpfreaks.com/topic/280343-admin-user/#findComment-1441489
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.