Ejemplo n.º 1
0
 /**
  *  Cause the visitor to be re-directed to the login page.
  *
  *  OPTIONAL: "continueURL" support.
  *
  *  This will issue a 302 redirect and exit the current request execution.
  *
  *  @param string The URL of the page to go to after successful login. Note that this should be a PLAIN URL, but it WILL BE base64-encoded before being passed to the login module.
  *  @param boolean TRUE to force the login screen even if already logged in (used for forcing re-auth of secure areas).
  */
 function doLoginRedirect($continueURL, $reauthorizeEvenIfLoggedIn = false)
 {
     $reauthorizeEvenIfLoggedInSuffix = $reauthorizeEvenIfLoggedIn ? "/1" : NULL;
     $loginInvocationPath = $this->loginInvocationPath();
     if (WFRequestController::sharedRequestController()->isAjax()) {
         header("HTTP/1.0 401 Login Required");
         print WWW_ROOT . "/{$loginInvocationPath}/" . WFWebApplication::serializeURL($continueURL) . $reauthorizeEvenIfLoggedInSuffix;
     } else {
         header("Location: " . WWW_ROOT . "/{$loginInvocationPath}/" . WFWebApplication::serializeURL($continueURL) . $reauthorizeEvenIfLoggedInSuffix);
     }
     exit;
 }
Ejemplo n.º 2
0
 /**
  *  Cause the visitor to be re-directed to the login page.
  *
  *  OPTIONAL: "continueURL" support.
  *
  *  This will issue a 302 redirect and exit the current request execution.
  *
  *  @param string The URL of the page to go to after successful login. Note that this should be a PLAIN URL, but it WILL BE base64-encoded before being passed to the login module.
  */
 function doLoginRedirect($continueURL)
 {
     $loginInvocationPath = $this->loginInvocationPath();
     if (WFRequestController::sharedRequestController()->isAjax()) {
         header("HTTP/1.0 401 Login Required");
         print WWW_ROOT . "/{$loginInvocationPath}/" . WFWebApplication::serializeURL($continueURL);
     } else {
         header("Location: " . WWW_ROOT . "/{$loginInvocationPath}/" . WFWebApplication::serializeURL($continueURL));
     }
     exit;
 }