logout of imap server

@return bool success
967669
public function logout()
    {
        $result = false;
        if ($this->_socket) {
            try {
                $result = $this->requestAndResponse('LOGOUT', array(), true);
            } catch (Zend_Mail_Protocol_Exception $e) {
                // ignoring exception
            }
            fclose($this->_socket);
            $this->_socket = null;
        }
        return $result;
    }
907383
public function get_imap(){
    if ( $this->imap = imap_check($this->stream) ){
      if ( $this->imap->Nmsgs > 0 ){
        $this->last_uid = $this->get_msg_uid($this->imap->Nmsgs);
        $this->num_msg = $this->imap->Nmsgs;
      }
      else {
        $this->last_uid = 0;
        $this->num_msg = 0;
      }
      return $this->imap;
    }
    return false;
  }
151856
public function processLogout()
    {
        $this->getToken()->deleteUserToken();
        if ($this->getUser()->isAuthenticated()) {
            $this->getAuthProvider($this->user->getAuthProviderName())->logoutCallback();
        }
        $this->user = new AnonymousUser();
        $this->userAuthenticated = false;

        $this->eventManager()->fire(SecurityEvent::LOGOUT);

        return true;
    }
1002702
public function logout()
    {
        $user = $this->user();

        // If we have an event dispatcher instance, we can fire off the logout event
        // so any further processing can be done. This allows the developer to be
        // listening for anytime a user signs out of this application manually.
        $this->clearUserDataFromStorage();

        if (! is_null($this->user) && ! empty($user->getRememberToken())) {
            $this->cycleRememberToken($user);
        }

        if (isset($this->events)) {
            $this->events->dispatch(new Events\Logout($this->name, $user));
        }

        // Once we have fired the logout event we will clear the users out of memory
        // so they are no longer available as the user is no longer considered as
        // being signed into this application and should not be available here.
        $this->user = null;

        $this->loggedOut = true;
    }
989864
public function disconnect()
	{
		if( $this->xmpp )
		{
			if( $this->printLog )
				echo $this->xmpp->log->printout();
			$this->xmpp->disconnect();
			$this->xmpp = NULL;
			return TRUE;
		}
		return FALSE;
	}
75879
public function logout() {
		// clear session
		foreach ( $_SESSION as $key => $value ) {
			unset( $_SESSION[$key] );
		}

		// delete the session cookie on the client
		if ( ini_get( 'session.use_cookies' ) ) {
			$params = session_get_cookie_params();
			setcookie( session_name(), '', time() - 42000,
				$params['path'], $params['domain'],
				$params['secure'], $params['httponly']
			);
		}

		// destroy local session storage
		session_destroy();
		// generate new session id
		session_regenerate_id( true );
	}
392882
public function logout()
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $this->exec_curl('/logout');
        $this->is_loggedin = false;
        $this->cookies     = '';

        return true;
    }
661683
public function logout()
    {

        $response = $this->requestToken(self::REVOKE_ENDPOINT, array(
            'token' => $this->_auth->accessToken()
        ));

        $this->_auth->reset();

        return $response;

    }
1153430
public function logout()
	{
		Acct::guard( $this->getGuard() )->logout();

		return Redirect::to( property_exists( $this, 'redirectAfterLogout' ) ? $this->redirectAfterLogout : '/' )->withMessages( [ 'success' => "You are now logged out." ] );
	}
68009
public function doLogout(): bool
    {
        // No user logged in
        if (empty($this->session['user'])) {
            return true;
        }

        // Store current user id for later use
        $user = $this->session['user'];

        // Remove autologin stuff?
        if ($this->remember) {
            $autologin = new Autologin($this->db);
            $autologin->setCookieName($this->cookie_name);
            $autologin->removeAutoLoginTokenAndCookie($user);
        }

        // Refresh session id and delete old session
        session_regenerate_id(true);

        // Clean up session
        unset($this->session['autologin_failed']);

        $this->session['user'] = 0;
        $this->session['logged_in'] = false;

        if (isset($this->logger)) {
            $this->logger->info('Logout: User [' . $user . ']');
        }

        return true;
    }
383004
public static function logout() {
		$_SESSION = [];
		session_destroy();
		session_unset();
		self::$isGuest = true;
		self::$user = user::guest();
	}
15817
public function disconnect() {
        if ($this->isConnected() && $this->connection !== false && is_integer($this->connection) === false) {
            $this->errors = array_merge($this->errors, imap_errors() ?: []);
            $this->connected = !imap_close($this->connection, IMAP::CL_EXPUNGE);
        }

        return $this;
    }
125290
public function logout()
  {
    $this->request("logout");
    $this->whoamiReset();

    $this->delStorage("_login_user");
    $this->delStorage("_login_pass");

    TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogout", $this);
  }
1296317
protected function get_imap_client() {
        global $CFG;

        if (!\core\message\inbound\manager::is_enabled()) {
            // E-mail processing not set up.
            mtrace("Inbound Message not fully configured - exiting early.");
            return false;
        }

        mtrace("Connecting to {$CFG->messageinbound_host} as {$CFG->messageinbound_hostuser}...");

        $configuration = array(
            'username' => $CFG->messageinbound_hostuser,
            'password' => $CFG->messageinbound_hostpass,
            'hostspec' => $CFG->messageinbound_host,
            'secure'   => $CFG->messageinbound_hostssl,
            'debug'    => empty($CFG->debugimap) ? null : fopen('php://stderr', 'w'),
        );

        if (strpos($configuration['hostspec'], ':')) {
            $hostdata = explode(':', $configuration['hostspec']);
            if (count($hostdata) === 2) {
                // A hostname in the format hostname:port has been provided.
                $configuration['hostspec'] = $hostdata[0];
                $configuration['port'] = $hostdata[1];
            }
        }

        $this->client = new \Horde_Imap_Client_Socket($configuration);

        try {
            $this->client->login();
            mtrace("Connection established.");

            // Ensure that mailboxes exist.
            $this->ensure_mailboxes_exist();

            return true;

        } catch (\Horde_Imap_Client_Exception $e) {
            $message = $e->getMessage();
            throw new \moodle_exception('imapconnectfailure', 'tool_messageinbound', '', null, $message);
        }
    }
1329411
public function logout()
    {
        if ($this->_mails) {
            foreach ($this->_mails as $mail) {
                if ($mail['is_deleted']) {
                    unlink($this->_path.'/'.$mail['file_name']);
                }
            }
        }
    }
155129
public function logout()
    {
        if ($this->check()) {
            $this->matrix()->request('POST', $this->endpoint('logout'), [], [
                'access_token' => $this->data['access_token']
            ]);
            $this->setData(null);
            return true;
        }
        throw new \Exception('Not authenticated');
    }
647387
public function logoffAction()
    {
        $this->addMessage(sprintf($this->_('Good bye: %s.'), $this->currentUser->getFullName()));
        $this->accesslog->logChange($this->getRequest());
        $this->currentUser->unsetAsCurrentUser();
        \Zend_Session::destroy();
        $this->_reroute(array('action' => 'index'), true);
    }