Пример #1
0
 /**
  * Reset Login Attempts
  * Resets login attempts increment value
  * in the database for a particular IP address.
  * 
  * @param mixed $ip_address
  */
 public function reset_login_attempts($ip_address = NULL)
 {
     if (is_null($ip_address)) {
         $ip_address = $this->ip_address;
     }
     $a = new Attempt();
     $a->where('ip_address', $ip_address)->get();
     if ($a->exists()) {
         $a->delete();
     }
 }
Пример #2
0
 public function clearAttempt($type, $data = NULL)
 {
     if (is_null($data)) {
         $affectedRows = Attempt::where('type', '=', $type)->where('ip_address', '=', $this->app->request->getClientIp())->delete();
         return $affectedRows;
     }
     $affectedRows = Attempt::where('type', '=', $type)->where('data', '=', $data)->where('ip_address', '=', $this->app->request->getClientIp())->delete();
     return $affectedRows;
 }