clearLock() абстрактный публичный Метод

NOTE: No security checks are done in the Horde_Lock API. It is expected that the calling application has done all necessary security checks before requesting a lock be cleared.
abstract public clearLock ( string $lockid ) : boolean
$lockid string The lock ID as generated by a previous call to setLock()
Результат boolean Returns true on success.
Пример #1
0
 public function unlock()
 {
     if ($this->_locks && $this->_lock) {
         $this->_locks->clearLock($this->_lock['lock_id']);
         unset($this->_lock);
     }
 }
Пример #2
0
 /**
  * Removes a lock from a uri
  *
  * @param string $uri
  * @param Locks\LockInfo $lockInfo
  * @return bool
  */
 public function unlock($uri, Locks\LockInfo $lockInfo)
 {
     try {
         $this->_lock->clearLock($lockInfo->token);
     } catch (Horde_Lock_Exception $e) {
         throw new DAV\Exception($e->getMessage(), $e->getCode(), $e);
     }
 }
Пример #3
0
 /**
  * Unlocks a user and optionally resets the bad login count.
  *
  * @param string  $userId          The user to unlock.
  * @param boolean $resetBadLogins  Reset bad login counter?
  *
  * @throws Horde_Auth_Exception
  */
 public function unlockUser($userId, $resetBadLogins = false)
 {
     if (!$this->_lock_api) {
         throw new Horde_Auth_Exception('Unsupported.');
     }
     try {
         $locks = $this->_lock_api->getLocks('horde_auth', 'login:' . $userId, Horde_Lock::TYPE_EXCLUSIVE);
         $lock_id = key($locks);
         if ($lock_id) {
             $this->_lock_api->clearLock($lock_id);
         }
         if ($resetBadLogins) {
             $this->_resetBadLogins($userId);
         }
     } catch (Horde_Lock_Exception $e) {
         throw new Horde_Auth_Exception($e);
     }
 }
Пример #4
0
 /**
  * Removes the lock for a lock ID.
  *
  * @param Horde_Lock $locks  The lock object
  * @param string $lockid     The lock ID as generated by a previous call
  *                           to lock().
  *
  * @return boolean
  */
 public function unlock(Horde_Lock $locks, $lockid)
 {
     return $locks->clearLock($lockid);
 }