AM_Lite checkAccess for admin?

Discussion in 'Customization & add-ons' started by stefano_virgulti, Apr 20, 2015.

  1. stefano_virgulti

    stefano_virgulti New Member

    Joined:
    Apr 8, 2015
    Messages:
    13
    There is any way to use AM Lite to check the access for the admin to let him be the only one to access to a custom php page?
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    No. Am_Lite doesn't support this.
  3. stefano_virgulti

    stefano_virgulti New Member

    Joined:
    Apr 8, 2015
    Messages:
    13
    I feared that, I couldn't find anything on the documentation. I used Am_Lite to run the custom php customer-side. I need to run also some custom php admin-side, what suggestion do you have to do this, since AM_Lite does not support Admin for checkAccess?
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You should include amember"s bootstrap.
    Then you can use this code:
    PHP:
    $admin Am_Di::getInstance()->authAdmin->getUser();
    if(
    $admin){
    // Admin logged in;
    if($admin->isSuper()){
    // Supper admin logged in
    }
    }

Share This Page