Horde_Registry_Logout::run PHP Метод

run() публичный Метод

Runs the list of logout tasks and clears the queue.
public run ( )
    public function run()
    {
        global $injector;
        foreach ($this->_getTasks() as $val) {
            try {
                $ob = $injector->getInstance($val);
                if ($ob instanceof Horde_Registry_Logout_Task) {
                    $ob->logoutTask();
                }
            } catch (Exception $e) {
            }
        }
        $this->_setTasks(array());
    }

Usage Example

Пример #1
0
 /**
  * Clears any authentication tokens in the current session.
  *
  * @param boolean $destroy  Destroy the session?
  */
 public function clearAuth($destroy = true)
 {
     global $session;
     /* Do application logout tasks. */
     /* @todo: Replace with exclusively registered logout tasks. */
     foreach ($this->getAuthApps() as $app) {
         try {
             $this->callAppMethod($app, 'logout');
         } catch (Horde_Exception $e) {
         }
     }
     /* Do registered logout tasks. */
     $logout = new Horde_Registry_Logout();
     $logout->run();
     // @suspicious shouldn't this be 'auth/'
     $session->remove('horde', 'auth');
     $session->remove('horde', 'auth_app/');
     $this->_cache['auth'] = null;
     $this->_cache['existing'] = $this->_cache['isauth'] = array();
     if ($destroy) {
         $session->destroy();
     }
 }