Horde_Registry::getLogoutUrl PHP Method

getLogoutUrl() public method

If no reason/msg is passed in, uses the current global authentication error message.
public getLogoutUrl ( array $options = [] ) : Horde_Url
$options array Additional options: - app: (string) Authenticate to this application DEFAULT: Horde - msg: (string) If reason is Horde_Auth::REASON_MESSAGE, the message to display to the user. DEFAULT: None - params: (array) Additional params to add to the URL (not allowed: 'app', 'horde_logout_token', 'msg', 'reason', 'url'). DEFAULT: None - reason: (integer) The reason for logout DEFAULT: None
return Horde_Url The formatted URL.
    public function getLogoutUrl(array $options = array())
    {
        if (!isset($options['reason'])) {
            // TODO: This only returns the error for Horde-wide
            // authentication, not for application auth.
            $options['reason'] = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->getError();
        }
        $params = array();
        if (!in_array($options['reason'], array(Horde_Auth::REASON_LOGOUT, Horde_Auth::REASON_MESSAGE))) {
            $params['url'] = Horde::selfUrl(true, true, true);
        }
        if (empty($options['app']) || $options['app'] == 'horde' || $options['reason'] == Horde_Auth::REASON_LOGOUT) {
            $params['horde_logout_token'] = $GLOBALS['session']->getToken();
        }
        if (isset($options['app'])) {
            $params['app'] = $options['app'];
        }
        if ($options['reason']) {
            $params['logout_reason'] = $options['reason'];
            if ($options['reason'] == Horde_Auth::REASON_MESSAGE) {
                $params['logout_msg'] = empty($options['msg']) ? $GLOBALS['injector']->getInstance('Horde_Core_Factory_Auth')->create()->getError(true) : $options['msg'];
            }
        }
        return $this->getServiceLink('login', 'horde')->add($params)->setRaw(true);
    }