Ejemplo n.º 1
0
     if ($user['requested'] == 1) {
         ajax_error('Your access request is pending approval.');
     }
     if (!$user['enabled']) {
         ajax_error('Your account has been disabled.');
     }
     if (!isset($user['roleID']) || $user['roleID'] == NULL) {
         ajax_error('Sorry, your account hasn\'t been assigned any privileges yet. Please try again later.');
     }
     if (in_array(strtolower($username), array("*****@*****.**", "guest")) && $setupconf['guest_login'] == 1) {
         $logged_in = true;
     } else {
         $auth = new NRG\Login\Google\ClientLogin($username, $txtPassword);
         if (!empty($captchatext) && !empty($captchatoken)) {
             $auth->setCaptchaText($captchatext);
             $auth->setCaptchaToken($captchatoken);
         }
         //Attempt to authenticate the user
         $auth->login();
         if ($auth->isSuccessful()) {
             $logged_in = true;
         }
     }
 }
 //If authentication was successful, log the user in
 if ($logged_in === true) {
     $_SESSION['auth'] = true;
     $_SESSION['username'] = $user['username'];
     $_SESSION['role'] = $user['name'];
     $_SESSION['aclID'] = $user['aclID'];
     $_SESSION['roleID'] = $user['roleID'];