SimpleSAML_Utilities::createPostRedirectLink PHP 메소드

    public static function createPostRedirectLink($destination, $post)
    {
        return \SimpleSAML\Utils\HTTP::getPOSTRedirectURL($destination, $post);
    }

Usage Example

예제 #1
0
파일: Simple.php 프로젝트: hukumonline/yii
 /**
  * Require the user to be authenticated.
  *
  * If the user is authenticated, this function returns immediately.
  *
  * If the user isn't authenticated, this function will authenticate the
  * user with the authentication source, and then return the user to the
  * current page.
  *
  * If $allowPost is set to TRUE, any POST data to the current page is
  * preserved. If $allowPost is FALSE, the user will be returned to the
  * current page with a GET request.
  *
  * @param array $options  Various options to the authentication request.
  */
 public function requireAuth(array $options = array())
 {
     $session = SimpleSAML_Session::getInstance();
     if ($session->isValid($this->authSource)) {
         /* Already authenticated. */
         return;
     }
     if (array_key_exists('KeepPost', $options)) {
         $keepPost = (bool) $options['KeepPost'];
     } else {
         $keepPost = TRUE;
     }
     if (array_key_exists('ReturnTo', $options)) {
         $returnTo = (string) $options['ReturnTo'];
     } else {
         $returnTo = SimpleSAML_Utilities::selfURL();
     }
     if ($keepPost && $_SERVER['REQUEST_METHOD'] === 'POST') {
         $returnTo = SimpleSAML_Utilities::createPostRedirectLink($returnTo, $_POST);
     }
     /*
      * An URL to restart the authentication, in case the user bookmarks
      * something, e.g. the discovery service page.
      */
     $restartURL = $this->getLoginURL($returnTo);
     $hints = array(SimpleSAML_Auth_State::RESTART => $restartURL);
     SimpleSAML_Auth_Default::initLogin($this->authSource, $returnTo, NULL, $hints);
 }
All Usage Examples Of SimpleSAML_Utilities::createPostRedirectLink