PHP User::lock Examples

PHP User::lock - 2 examples found. These are the top rated real world PHP examples of User::lock extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 public function onIpCountExceeded(User $user)
 {
     if ($user->is_locked < 0) {
         return;
     }
     // auto-lock disabled
     if (in_array('email-admin', $this->getDi()->config->get('max_ip_actions', array()))) {
         // email admin - @todo not implemented yet
         //            $tpl = Am_Mail_Template::load('max_ip_actions');
         //            if (!$tpl) return;
         //            $et->name = "max_ip_actions";
         //            mail_template_admin($t, $et);
     }
     if (in_array('disable-user', $this->getDi()->config->get('max_ip_actions', array()))) {
         // disable customer
         $user->lock();
     }
 }
 public function unlockUser($id, User $user)
 {
     $user->lock(false);
 }