admin

Discussion in 'General' started by alexillsley, Jan 17, 2007.

  1. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

    How can i make a little php script to check if the user is an admin or not?
    I do not want it to display an error message i just want like function to detect admin or not,
    Thanks,
    Alex
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    If you lookup the username of the user in the database table isp_isp_user, when the field user_admin = 1, then the user is a administrator.
     
  3. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

    no im talking abouit the main admin that can do everything not the admins of sites
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If you are in a PHP script where the iSPConfig framework is lodaed, you can use this function:

    if($go_api->auth->check_admin(0,1)) {
    echo "I'am the admin.";
    }
     
  5. alexillsley

    alexillsley ISPConfig Developer ISPConfig Developer

    Thanks alot!:)
     

Share This Page