Commit 56f05d58 authored by Piers Harding's avatar Piers Harding Committed by Robert Lyon
Browse files

Bug 1631808: auth/saml: add framework for ssphp modules

* add ssphp module directory
* add option ssphpsessionhandler to config.php
* fix autoloader so modules happen propoerly including our own local ones

behatnotneeded

Change-Id: I81449d8d254e6501a03a11587441ac469c78a869
parent d1fe054a
......@@ -32,7 +32,12 @@ foreach ($metadata_files as $file) {
// Fix up session handling config - to match Mahara
$memcache_config = array();
if (get_config('memcacheservers') || extension_loaded('memcache')) {
$sessionhandler = 'memcache';
if (empty(get_config('ssphpsessionhandler'))) {
$sessionhandler = 'memcache';
}
else {
$sessionhandler = get_config('ssphpsessionhandler');
}
$servers = get_config('memcacheservers');
if (empty($servers)) {
$servers = 'localhost';
......
......@@ -39,7 +39,11 @@ spl_autoload_register(
}
array_shift($classpath);
$module = array_shift($classpath);
$filepath = get_config('docroot') . 'auth/saml/extlib/simplesamlphp/modules/$module/lib/' . implode('/', $classpath) . '.php';
$filepath = get_config('docroot') . 'auth/saml/extlib/simplesamlphp/modules/' . $module . '/lib/' . implode('/', $classpath) . '.php';
if (file_exists($filepath)) {
require_once($filepath);
}
$filepath = get_config('docroot') . 'auth/saml/extlib/modules/' . $module . '/lib/' . implode('/', $classpath) . '.php';
if (file_exists($filepath)) {
require_once($filepath);
}
......
This is where SimpleSAMLphp modules can be directly distributed with Mahara.
Just copy them into this directory and the autoloader will pick them up.
......@@ -715,3 +715,10 @@ $cfg->passwordsaltalt1 = 'old salt value';
* The default sources are Mozilla Backpack and openbadgepassport.com
*/
$cfg->openbadgedisplayer_source = '{"backpack":"https://backpack.openbadges.org/","passport":"https://openbadgepassport.com/"}';
/**
* @global string $cfg->ssphpsessionhandler
* An alternative session handler for SimpleSAMLphp if you do not wish to use memcache.
* Specify the name of the session handler.
*/
// $cfg->ssphpsessionhandler = 'memcached';
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment