/**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     // Create a Saml request and redirect to the server
     $req = new Maestrano_Saml_Request($_GET);
     //Redirect to the Maestrano for user selection
     Tools::redirect($req->getRedirectUrl());
 }
Exemple #2
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
// Include Maestrano required libraries
require_once 'vendor/maestrano/maestrano-php/lib/Maestrano.php';
Maestrano::configure('maestrano.json');
// Check session validity and trigger SSO if not
if (Maestrano::sso()->isSsoEnabled()) {
    $mnoSession = new Maestrano_Sso_Session($_SESSION);
    if (!$mnoSession->isValid()) {
        $_SESSION['mno_previous_uri'] = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
        $req = new Maestrano_Saml_Request($_GET);
        header('Location: ' . $req->getRedirectUrl());
        exit;
    }
}
?>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>File Manager</title>
<link rel="stylesheet" type="text/css" href="styles/reset.css" />
<link rel="stylesheet" type="text/css" href="scripts/jquery.filetree/jqueryFileTree.css" />
<link rel="stylesheet" type="text/css" href="scripts/jquery.contextmenu/jquery.contextMenu-1.01.css" />
<link rel="stylesheet" type="text/css" href="scripts/custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css" />
<style type="text/css">
	#loading-wrap {
 public function testSamlRequestParametersEncoding()
 {
     $request = new Maestrano_Saml_Request(array('hello' => 'hi there'), $this->settings);
     $authUrl = $request->getRedirectUrl();
     $this->assertRegExp('#hello=hi\\+there#', $authUrl);
 }
 /**
  * Test the SAML settings with presets
  *
  * @covers Maestrano_Saml_Request::newWithPreset
  */
 public function testRedirectURLWithPreset()
 {
     $request = Maestrano_Saml_Request::newWithPreset('mytenant', array(), $this->myTenantSettings);
     $this->assertRegExp('#^http://idp\\.example\\.com\\/SSOService\\.phpmytenant\\?SAMLRequest=#', $request->getRedirectUrl());
 }