Beispiel #1
0
 /**
  * Checks if user has permissions and if so issue an error.
  *
  * @param string $perms	The permissions; Splitted with commas
  *
  * @return Recipe_User
  */
 public function checkPermissions($perms)
 {
     Hook::event("CHECK_USER_PERMISSIONS", array($perms));
     if (!$this->ifPermissions($perms)) {
         forwardToLogin("NO_ACCESS");
     }
     return $this;
 }
 /**
  * Count login attempt up and redirect to login site.
  *
  * @param string $errorid	Error message id
  *
  * @return Login
  */
 protected function loginFailed($errorid)
 {
     $this->errors->push($errorid);
     if ($this->countLoginAttempts) {
         $spec = array("time" => TIME, "ip" => IPADDRESS, "username" => $this->usr);
         Core::getQuery()->insert("loginattempts", $spec);
     }
     if ($this->redirectOnFailure) {
         forwardToLogin($errorid);
     }
     return $this;
 }