SimpleSAML_Utilities::redirect PHP Method

redirect() public static method

Deprecation: 1.12.0 This method will be removed from the API. Instead, use the redirectTrustedURL() or redirectUntrustedURL() functions accordingly.
public static redirect ( $url, $parameters = [], $allowed_redirect_hosts = null )
    public static function redirect($url, $parameters = array(), $allowed_redirect_hosts = null)
    {
        assert('is_string($url)');
        assert('strlen($url) > 0');
        assert('is_array($parameters)');
        if ($allowed_redirect_hosts !== null) {
            $url = self::checkURLAllowed($url, $allowed_redirect_hosts);
        } else {
            $url = self::normalizeURL($url);
        }
        self::_doRedirect($url, $parameters);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Start the logout operation.
  *
  * @param array &$state  The logout state.
  * @param string|NULL $assocId  The SP we are logging out from.
  */
 public function startLogout(array &$state, $assocId)
 {
     assert('is_string($assocId) || is_null($assocId)');
     $associations = $this->idp->getAssociations();
     if (count($associations) === 0) {
         $this->idp->finishLogout($state);
     }
     foreach ($associations as $id => &$association) {
         $idp = SimpleSAML_IdP::getByState($association);
         $association['core:Logout-IFrame:Name'] = $idp->getSPName($id);
         $association['core:Logout-IFrame:State'] = 'onhold';
     }
     $state['core:Logout-IFrame:Associations'] = $associations;
     if (!is_null($assocId)) {
         $spName = $this->idp->getSPName($assocId);
         if ($spName === NULL) {
             $spName = array('en' => $assocId);
         }
         $state['core:Logout-IFrame:From'] = $spName;
     } else {
         $state['core:Logout-IFrame:From'] = NULL;
     }
     $id = SimpleSAML_Auth_State::saveState($state, 'core:Logout-IFrame');
     $url = SimpleSAML_Module::getModuleURL('core/idp/logout-iframe.php', array('id' => $id));
     SimpleSAML_Utilities::redirect($url);
 }
All Usage Examples Of SimpleSAML_Utilities::redirect