public function __construct()
 {
     $this->name = 'maestranointegration';
     $this->tab = 'administration';
     $this->version = '1.6.4';
     $this->author = 'PrestaShop';
     $this->need_instance = 0;
     $this->bootstrap = true;
     // Check the Maestrano class exit othewise throws error
     if (class_exists($this->maestranoClass)) {
         // Include the Maestrano config file.
         Maestrano::configure(dirname(__FILE__) . '/' . $this->maestranoConfig);
         $mn = new MaestranoSso();
     } else {
         $this->warning = $this->l($this->maestranoClass . " Class doesn't Exist.");
     }
     parent::__construct();
     $this->displayName = $this->l('Maestrano integration');
     $this->description = $this->l('Maestrano SSO integration and data');
     $this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
     if (!Configuration::get('maestrano')) {
         $this->warning = $this->l('No name provided');
     }
 }
 /**
  * Initializes the Test Suite
  */
 public function setUp()
 {
     $this->config = array('environment' => 'test', 'api' => array('id' => 'app-1', 'key' => 'gfcmbu8269wyi0hjazk4t7o1sndpvrqxl53e1'));
     Maestrano::configure($this->config);
 }
Example #3
0
 public function testToEmailWhenVirtual()
 {
     Maestrano::configure(array('environment' => 'production', 'sso' => array('creation_mode' => 'virtual')));
     $this->assertEquals($this->subject->getVirtualEmail(), $this->subject->toEmail());
 }
<?php

// Include Maestrano required libraries
require_once dirname(__FILE__) . '/lib/Maestrano.php';
require_once dirname(__FILE__) . '/connec/init.php';
// Maestrano Config Include
Maestrano::configure(dirname(__FILE__) . '/maestrano.json');
Example #5
0
 public function testisValidWhenSloDisabled_ItShouldReturnTrue()
 {
     // Disable SLO
     Maestrano::configure(array('environment' => 'production', 'sso' => array('slo_enabled' => false)));
     // Response preparation (session not valid)
     $date = new DateTime();
     $date->add(new DateInterval('PT1M'));
     $resp = array();
     $resp["valid"] = "false";
     $resp["recheck"] = $date->format(DateTime::ISO8601);
     $this->httpClient->setResponseStub($resp);
     // Set local recheck to force remote recheck
     $localRecheck = new DateTime();
     $localRecheck->sub(new DateInterval('PT1M'));
     $this->subject = new Maestrano_Sso_Session($this->httpSession);
     $this->subject->setRecheck($localRecheck);
     $this->assertTrue($this->subject->isValid(false, $this->httpClient));
 }
 /**
  * Initializes the Test Suite
  */
 public function setUp()
 {
     Maestrano::configure(array('environment' => 'test', 'api' => array('id' => 'app-1', 'key' => 'gfcmbu8269wyi0hjazk4t7o1sndpvrqxl53e1', 'group_id' => 'cld-3')));
     $this->subject = new Maestrano_Connec_Client();
 }
Example #7
0
<?php

//-----------------------------------------------
// Define root folder
//-----------------------------------------------
if (!defined('MAESTRANO_ROOT')) {
    define("MAESTRANO_ROOT", realpath(dirname(__FILE__) . '/../../'));
}
if (!defined('ROOT_PATH')) {
    define('ROOT_PATH', realpath(MAESTRANO_ROOT . '/../'));
}
// Include Maestrano required libraries
require_once ROOT_PATH . '/vendor/autoload.php';
Maestrano::configure(ROOT_PATH . '/maestrano.json');
require_once MAESTRANO_ROOT . '/app/sso/MnoSsoUser.php';
Example #8
0
 /**
  * Initializes the Test Suite
  */
 public function setUp()
 {
     Maestrano::configure(array('environment' => 'production'));
     $this->samlResp = new SamlMnoRespStub();
     $this->subject = new Maestrano_Sso_Group($this->samlResp);
 }
 public function testToMetadata()
 {
     Maestrano::configure($this->config);
     $expected = array('environment' => $this->config['environment'], 'app' => array('host' => $this->config['app']['host']), 'api' => array('id' => $this->config['api']['id'], 'version' => Maestrano::VERSION, 'verify_ssl_certs' => false, 'lang' => 'php', 'lang_version' => phpversion() . " " . php_uname(), 'host' => Maestrano::$EVT_CONFIG[$this->config['environment']]['api.host'], 'base' => Maestrano::$EVT_CONFIG[$this->config['environment']]['api.base']), 'sso' => array('enabled' => true, 'slo_enabled' => true, 'init_path' => $this->config['sso']['init_path'], 'consume_path' => $this->config['sso']['consume_path'], 'creation_mode' => 'real', 'idm' => $this->config['sso']['idm'], 'idp' => $this->config['sso']['idp'], 'name_id_format' => Maestrano::$EVT_CONFIG[$this->config['environment']]['sso.name_id_format'], 'x509_fingerprint' => Maestrano::$EVT_CONFIG[$this->config['environment']]['sso.x509_fingerprint'], 'x509_certificate' => Maestrano::$EVT_CONFIG[$this->config['environment']]['sso.x509_certificate']), 'connec' => array('enabled' => $this->config['connec']['enabled'], 'host' => $this->config['connec']['host'], 'base_path' => $this->config['connec']['base_path'], 'v2_path' => $this->config['connec']['v2_path'], 'reports_path' => $this->config['connec']['reports_path']), 'webhook' => array('account' => array('groups_path' => $this->config['webhook']['account']['groups_path'], 'group_users_path' => $this->config['webhook']['account']['group_users_path']), 'connec' => array('initialization_path' => $this->config['webhook']['connec']['initialization_path'], 'notifications_path' => $this->config['webhook']['connec']['notifications_path'], 'subscriptions' => $this->config['webhook']['connec']['subscriptions'])));
     $this->assertEquals(json_encode($expected), Maestrano::toMetadata());
 }
Example #10
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 {
Example #11
0
 public function setUp()
 {
     Maestrano::configure(array('environment' => 'production'));
     $this->settings = SamlTestHelper::getXmlSecSamlTestSettings();
 }