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

Improving error message when no configuration file was found. Now also showing...

Improving error message when no configuration file was found. Now also showing what configuration file was missing, because the configuration class is generic and can hold config for in example ldap.php

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@418 44740490-163a-0410-bde0-09ae8108e29a
parent b20d4e89
No related branches found
No related tags found
No related merge requests found
...@@ -32,10 +32,13 @@ class SimpleSAML_Configuration { ...@@ -32,10 +32,13 @@ class SimpleSAML_Configuration {
} }
private function loadConfig() { private function loadConfig() {
if (!file_exists($this->configpath . '/' . $this->configfilename)) { $filename = $this->configpath . '/' . $this->configfilename;
echo 'You have not yet created a configuration file. [ <a href="http://rnd.feide.no/content/installing-simplesamlphp#id405868">simpleSAMLphp installation manual</a> ]'; if (!file_exists($filename)) {
echo '<p>You have not yet created a configuration file. [ <a href="http://rnd.feide.no/content/installing-simplesamlphp#id434777">simpleSAMLphp installation manual</a> ]</p>';
echo '<p>This file was missing: [' . $filename . ']</p>';
exit;
} }
require_once($this->configpath . '/' . $this->configfilename); require_once($filename);
$this->configuration = $config; $this->configuration = $config;
} }
......
...@@ -16,12 +16,10 @@ $session = SimpleSAML_Session::getInstance(true); ...@@ -16,12 +16,10 @@ $session = SimpleSAML_Session::getInstance(true);
SimpleSAML_Logger::info('AUTH - ldap: Accessing auth endpoint login'); SimpleSAML_Logger::info('AUTH - ldap: Accessing auth endpoint login');
SimpleSAML_Configuration::init($configdir, 'ldapconfig', 'ldap.php'); SimpleSAML_Configuration::init($configdir, 'ldapconfig', 'ldap.php');
$ldapconfig = SimpleSAML_Configuration::getInstance('ldapconfig'); $ldapconfig = SimpleSAML_Configuration::getInstance('ldapconfig');
$error = null; $error = null;
$attributes = array(); $attributes = array();
$username = null; $username = null;
......
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