From f5bfdc28da3336aacfbba6ef6829569e8598d6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no> Date: Fri, 31 Oct 2008 18:36:13 +0000 Subject: [PATCH] If database conection does not work, remove the remember me button git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@958 44740490-163a-0410-bde0-09ae8108e29a --- modules/consent/lib/Auth/Process/Consent.php | 15 ++++++++++----- modules/consent/lib/Consent/Store/Database.php | 16 +++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/modules/consent/lib/Auth/Process/Consent.php b/modules/consent/lib/Auth/Process/Consent.php index e9ee4453e..07c361fc7 100644 --- a/modules/consent/lib/Auth/Process/Consent.php +++ b/modules/consent/lib/Auth/Process/Consent.php @@ -96,12 +96,17 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt } else { $this->focus = NULL; } - + + $this->store = NULL; if (array_key_exists('store', $config)) { - $this->store = sspmod_consent_Store::parseStoreConfig($config['store']); - } else { - $this->store = NULL; - } + try { + SimpleSAML_Logger::error('Consent - constructor() : Before creation'); + $this->store = sspmod_consent_Store::parseStoreConfig($config['store']); + SimpleSAML_Logger::error('Consent - constructor() : After creation'); + } catch(Exception $e) { + SimpleSAML_Logger::error('Consent - constructor() : Could not create consent storage: ' . $e->getMessage()); + } + } } diff --git a/modules/consent/lib/Consent/Store/Database.php b/modules/consent/lib/Consent/Store/Database.php index 156721465..e9ea1edaf 100644 --- a/modules/consent/lib/Consent/Store/Database.php +++ b/modules/consent/lib/Consent/Store/Database.php @@ -124,6 +124,8 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store { } else { $this->table = 'consent'; } + + $db = $this->getDB(); } @@ -346,13 +348,13 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store { return $this->db; } - try { - $this->db = new PDO($this->dsn, $this->username, $this->password); - } catch (PDOException $e) { - SimpleSAML_Logger::error('consent:Database - Failed to connect to \'' . - $this->dsn . '\': '. $e->getMessage()); - $this->db = FALSE; - } + //try { + $this->db = new PDO($this->dsn, $this->username, $this->password); + // } catch (PDOException $e) { + // SimpleSAML_Logger::error('consent:Database - Failed to connect to \'' . + // $this->dsn . '\': '. $e->getMessage()); + // $this->db = FALSE; + // } return $this->db; } -- GitLab