Skip to content
Snippets Groups Projects
Commit 160adde2 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Fixed bug with session creation self::init(). Also made a config option and...

Fixed bug with session creation self::init(). Also made a config option and disabled admin login on the index page on default

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@210 44740490-163a-0410-bde0-09ae8108e29a
parent 8f916728
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,8 @@ $config = array (
* This password will give access to the installation page of simpleSAMLphp with
* metadata listing and diagnostics pages.
*/
'auth.adminpassword' => '123',
'auth.adminpassword' => '123',
'admin.protectindexpage' => false,
/*
* Enable
......
......@@ -107,7 +107,7 @@ class SimpleSAML_Session {
* null if not.
*/
if ($allowcreate) {
self::init('saml2');
self::init();
return self::$instance;
} else {
return null;
......@@ -328,7 +328,6 @@ class SimpleSAML_Session {
* Is the session representing an authenticated user, and is the session still alive.
* This function will return false after the user has timed out.
*/
public function isValid($authority = null) {
if (!$this->isAuthenticated()) return false;
if (!empty($authority) && ($authority != $this->authority) ) return false;
......
......@@ -15,14 +15,19 @@ $config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getInstance(true);
/* Check if valid local session exists.. */
if (!isset($session) || !$session->isValid('login-admin') ) {
SimpleSAML_Utilities::redirect('/' . $config->getValue('baseurlpath') . 'auth/login-admin.php',
array('RelayState' => SimpleSAML_Utilities::selfURL())
);
}
if ($config->getValue('admin.protectindexpage', false)) {
if (!isset($session) || !$session->isValid('login-admin') ) {
SimpleSAML_Utilities::redirect('/' . $config->getValue('baseurlpath') . 'auth/login-admin.php',
array('RelayState' => SimpleSAML_Utilities::selfURL())
);
}
}
$links = array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment