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

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
parent ab26d158
No related branches found
No related tags found
No related merge requests found
......@@ -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());
}
}
}
......
......@@ -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;
}
......
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