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

Fix some static references after turning on PHP notice strict logging...

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@260 44740490-163a-0410-bde0-09ae8108e29a
parent 1c653a6f
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<articleinfo> <articleinfo>
<date>2007-10-15</date> <date>2007-10-15</date>
<pubdate>Wed Feb 6 14:26:51 2008</pubdate> <pubdate>Fri Feb 1 08:44:40 2008</pubdate>
<author> <author>
<firstname>Andreas Åkre</firstname> <firstname>Andreas Åkre</firstname>
......
...@@ -17,7 +17,7 @@ class SimpleSAML_Auth_LDAP { ...@@ -17,7 +17,7 @@ class SimpleSAML_Auth_LDAP {
/** /**
* LDAP link * LDAP link
*/ */
private static $ldap = null; private $ldap = null;
/** /**
...@@ -30,7 +30,7 @@ class SimpleSAML_Auth_LDAP { ...@@ -30,7 +30,7 @@ class SimpleSAML_Auth_LDAP {
*/ */
public function __construct($hostname) { public function __construct($hostname) {
if (!isset($this->logger)) $this->logger = new SimpleSAML_Logger(); if (!isset(self::$logger)) self::$logger = new SimpleSAML_Logger();
$this->ldap = @ldap_connect($hostname); $this->ldap = @ldap_connect($hostname);
......
...@@ -69,7 +69,7 @@ class SimpleSAML_Session { ...@@ -69,7 +69,7 @@ class SimpleSAML_Session {
*/ */
private function __construct($authenticated = true) { private function __construct($authenticated = true) {
if (!isset($this->logger)) $this->logger = new SimpleSAML_Logger(); if (!isset(self::$logger)) self::$logger = new SimpleSAML_Logger();
$this->authenticated = $authenticated; $this->authenticated = $authenticated;
if ($authenticated) { if ($authenticated) {
...@@ -215,7 +215,7 @@ class SimpleSAML_Session { ...@@ -215,7 +215,7 @@ class SimpleSAML_Session {
public function getAuthnRequest($protocol, $requestid) { public function getAuthnRequest($protocol, $requestid) {
$this->logger->log(LOG_DEBUG, $this->getTrackID(), 'Library', 'Session', 'DEBUG', $requestid, self::$logger->log(LOG_DEBUG, $this->getTrackID(), 'Library', 'Session', 'DEBUG', $requestid,
'Get authnrequest from cache ' . $protocol . ' time:' . time() . ' id: '. $requestid ); 'Get authnrequest from cache ' . $protocol . ' time:' . time() . ' id: '. $requestid );
$configuration = SimpleSAML_Configuration::getInstance(); $configuration = SimpleSAML_Configuration::getInstance();
...@@ -230,7 +230,7 @@ class SimpleSAML_Session { ...@@ -230,7 +230,7 @@ class SimpleSAML_Session {
*/ */
if ($cache['date'] < time() - $configuration->getValue('session.requestcache', 4*(60*60)) ) { if ($cache['date'] < time() - $configuration->getValue('session.requestcache', 4*(60*60)) ) {
$this->logger->log(LOG_DEBUG, $this->getTrackID(), 'Library', 'Session', 'DEBUG', $id, self::$logger->log(LOG_DEBUG, $this->getTrackID(), 'Library', 'Session', 'DEBUG', $id,
'Deleting expired authn request with id ' . $id); 'Deleting expired authn request with id ' . $id);
unset($this->authnrequests[$protocol][$id]); unset($this->authnrequests[$protocol][$id]);
} }
...@@ -258,7 +258,7 @@ class SimpleSAML_Session { ...@@ -258,7 +258,7 @@ class SimpleSAML_Session {
*/ */
public function setAuthnRequest($protocol, $requestid, array $cache) { public function setAuthnRequest($protocol, $requestid, array $cache) {
$this->logger->log(LOG_DEBUG, $this->getTrackID(), 'Library', 'Session', 'DEBUG', $requestid, self::$logger->log(LOG_DEBUG, $this->getTrackID(), 'Library', 'Session', 'DEBUG', $requestid,
'Set authnrequest ' . $protocol . ' time:' . time() . ' size:' . count($cache) . ' id: '. $requestid ); 'Set authnrequest ' . $protocol . ' time:' . time() . ' size:' . count($cache) . ' id: '. $requestid );
$this->dirty = true; $this->dirty = true;
...@@ -378,7 +378,7 @@ class SimpleSAML_Session { ...@@ -378,7 +378,7 @@ class SimpleSAML_Session {
*/ */
public function clean($cleancache = false) { public function clean($cleancache = false) {
$this->logger->log(LOG_DEBUG, $this->getTrackID(), 'Library', 'Session', 'DEBUG', '-', self::$logger->log(LOG_DEBUG, $this->getTrackID(), 'Library', 'Session', 'DEBUG', '-',
'Cleaning Session. Clean cache: ' . ($cleancache ? 'yes' : 'no') ); 'Cleaning Session. Clean cache: ' . ($cleancache ? 'yes' : 'no') );
if ($cleancache) { if ($cleancache) {
......
...@@ -103,14 +103,14 @@ if (isset($_REQUEST['username'])) { ...@@ -103,14 +103,14 @@ if (isset($_REQUEST['username'])) {
* Bind as user * Bind as user
*/ */
if (!$ldap->bind($dn, $password)) { if (!$ldap->bind($dn, $password)) {
$logger->log(LOG_NOTICE, $session->getTrackID(), 'AUTH', 'ldap-feide', 'Fail', $username, $username . ' failed to authenticate. DN=' . $dn); $logger->log(LOG_NOTICE, $session->getTrackID(), 'AUTH', 'ldap-feide', 'Fail', $requestedUser, $requestedUser . ' failed to authenticate. DN=' . $dn);
throw new Exception('Wrong username or password'); throw new Exception('Wrong username or password');
} }
// Retrieve attributes from LDAP // Retrieve attributes from LDAP
$attributes = $ldap->getAttributes($dn, $ldapconfig['attributes']); $attributes = $ldap->getAttributes($dn, $ldapconfig['attributes']);
$logger->log(LOG_NOTICE, $session->getTrackID(), 'AUTH', 'ldap-feide', 'OK', $username, $username . ' successfully authenticated'); $logger->log(LOG_NOTICE, $session->getTrackID(), 'AUTH', 'ldap-feide', 'OK', $requestedUser, $requestedUser . ' successfully authenticated');
$session->setAuthenticated(true, 'login-feide'); $session->setAuthenticated(true, 'login-feide');
$session->setAttributes($attributes); $session->setAttributes($attributes);
...@@ -124,7 +124,8 @@ if (isset($_REQUEST['username'])) { ...@@ -124,7 +124,8 @@ if (isset($_REQUEST['username'])) {
} catch (Exception $e) { } catch (Exception $e) {
$logger->log(LOG_ERR, $session->getTrackID(), 'AUTH', 'ldap-feide', 'ERROR', $username, $e->getMessage()); $logger->log(LOG_ERR, $session->getTrackID(), 'AUTH', 'ldap-feide', 'ERROR',
(isset($requestedUser) ? $requestedUser : 'na'), $e->getMessage());
$error = $e->getMessage(); $error = $e->getMessage();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment