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

Returns the user name that is used for locking, either the current user or the current IP address.
public static lockUser ( ) : string
Результат string The user name used for locking.
Пример #1
0
 /**
  * Returns if the page allows a mode. Access rights and user state
  * are taken into consideration.
  *
  * @see $supportedModes
  *
  * @param integer $mode  The mode to check for.
  *
  * @return boolean  True if the mode is allowed.
  */
 public function allows($mode)
 {
     if ($mode == Wicked::MODE_EDIT) {
         $page = Wicked_Page::getPage($this->referrer());
         if ($page->isLocked(Wicked::lockUser())) {
             return false;
         }
     }
     return parent::allows($mode);
 }
Пример #2
0
 /**
  * @throws Wicked_Exception
  */
 public function lock()
 {
     if ($this->_locks) {
         $id = $this->_locks->setLock(Wicked::lockUser(), 'wicked', $this->pageName(), $GLOBALS['conf']['wicked']['lock']['time'] * 60, Horde_Lock::TYPE_EXCLUSIVE);
         if ($id) {
             $this->_lock = $this->_locks->getLockInfo($id);
         } else {
             throw new Wicked_Exception(_("The page is already locked."));
         }
     }
 }