From 9d52dac23fde509aea4e9a96dd24306f130d908d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Fri, 14 Mar 2008 12:27:31 +0000 Subject: [PATCH] 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 --- lib/SimpleSAML/Configuration.php | 9 ++++++--- www/auth/login.php | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/SimpleSAML/Configuration.php b/lib/SimpleSAML/Configuration.php index 42ce14a71..2e8694d92 100644 --- a/lib/SimpleSAML/Configuration.php +++ b/lib/SimpleSAML/Configuration.php @@ -32,10 +32,13 @@ class SimpleSAML_Configuration { } private function loadConfig() { - if (!file_exists($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> ]'; + $filename = $this->configpath . '/' . $this->configfilename; + 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; } diff --git a/www/auth/login.php b/www/auth/login.php index ccfeba53a..ecf742dba 100644 --- a/www/auth/login.php +++ b/www/auth/login.php @@ -16,12 +16,10 @@ $session = SimpleSAML_Session::getInstance(true); SimpleSAML_Logger::info('AUTH - ldap: Accessing auth endpoint login'); - SimpleSAML_Configuration::init($configdir, 'ldapconfig', 'ldap.php'); $ldapconfig = SimpleSAML_Configuration::getInstance('ldapconfig'); - $error = null; $attributes = array(); $username = null; -- GitLab