Add more debugging trace at level 1

This commit is contained in:
Benjamin Dauvergne 2010-04-20 17:30:16 +02:00
parent 5107fe87d2
commit 5e34027fcd
9 changed files with 16 additions and 16 deletions

View File

@ -18,13 +18,13 @@ class LassoSPKitAutoPersistentSession extends LassoSPKitDummySession {
function findFederation($nameID) { function findFederation($nameID) {
$federation = null; $federation = null;
if ($nameID) { if ($nameID) {
#lassospkit_debuglog("looking for session using nameID from profile: $nameID"); lassospkit_debuglog("looking for session using nameID from profile: $nameID", 1);
$federation = $this->storage->get($nameID); $federation = $this->storage->get($nameID);
} }
if (! $federation) { if (! $federation) {
$userID = LassoSPKitUtilsSession::getUserID(); $userID = LassoSPKitUtilsSession::getUserID();
if ($userID) { if ($userID) {
#lassospkit_debuglog("looking for session using userID: $userID"); lassospkit_debuglog("looking for session using userID: $userID", 1);
$federation = $this->storage->get(md5($userID)); $federation = $this->storage->get(md5($userID));
} }
} }
@ -32,13 +32,13 @@ class LassoSPKitAutoPersistentSession extends LassoSPKitDummySession {
$nameIDs = LassoSPKitUtilsSession::getNameID(); $nameIDs = LassoSPKitUtilsSession::getNameID();
if (is_array($nameIDs)) { if (is_array($nameIDs)) {
foreach (LassoSPKitUtilsSession::getNameID() as $nameID) { foreach (LassoSPKitUtilsSession::getNameID() as $nameID) {
#lassospkit_debuglog("looking for session using nameID in session: $userID"); lassospkit_debuglog("looking for session using nameID in session: $userID", 1);
$federation = $this->storage->get($nameID); $federation = $this->storage->get($nameID);
} }
} }
} }
if ($federation == null) { if ($federation == null) {
#lassospkit_debuglog('did not found any session file...'); lassospkit_debuglog('did not found any session file...', 1);
return 0; return 0;
} }
$this->explodeFederation($federation); $this->explodeFederation($federation);

View File

@ -101,7 +101,7 @@ class LassoSPKitEndpoint extends LassoSPKitUrlDispatch {
$profile = $this->getProfileObject(); $profile = $this->getProfileObject();
$ret = $profile->processSOAPRequestSLO(); $ret = $profile->processSOAPRequestSLO();
} catch (LassoError $e) { } catch (LassoError $e) {
lassospkit_debuglog('Critical error: ' . $e); lassospkit_debuglog('Critical error: ' . $e, 1);
$ret = $e->getCode(); $ret = $e->getCode();
} catch (Exception $e) { } catch (Exception $e) {
$ret = -1; $ret = -1;

View File

@ -51,7 +51,7 @@ class LassoSPKitFileStore implements LassoSPKitStore {
} }
function debug($ret, $mesg) { function debug($ret, $mesg) {
if ($ret === FALSE) { if ($ret === FALSE) {
#lassospkit_debuglog("SPKit File Storage: " . $mesg); lassospkit_debuglog("SPKit File Storage: " . $mesg, 1);
} }
} }
function linkcount($key) { function linkcount($key) {

View File

@ -17,7 +17,7 @@ class LassoSPKitGenericSession {
header("Location: $url"); header("Location: $url");
} }
function doResponse($mimeType, $content) { function doResponse($mimeType, $content) {
#lassospkit_debuglog("Renvoi la réponse de type $mimeType et contenu $content"); lassospkit_debuglog("Renvoi la réponse de type $mimeType et contenu $content", 1);
header("Content-type: $mimeType"); header("Content-type: $mimeType");
echo $content; echo $content;
} }
@ -64,7 +64,7 @@ class LassoSPKitGenericSession {
function explodeFederationBlob($blob) { function explodeFederationBlob($blob) {
$federation = @unserialize($blob); $federation = @unserialize($blob);
if ($federation === FALSE) { if ($federation === FALSE) {
#lassospkit_debuglog("LassoSPKitGenericSession: cannot deserialize the federation blob"); lassospkit_debuglog("LassoSPKitGenericSession: cannot deserialize the federation blob", 1);
return 0; return 0;
} }
$this->explodeFederation($federation); $this->explodeFederation($federation);

View File

@ -17,7 +17,7 @@ class LassoSPKitHelper {
$profile->setSessionFromDump($sessionDump); $profile->setSessionFromDump($sessionDump);
} }
if ($identityDump) { if ($identityDump) {
#lassospkit_debuglog("load dump " . $identityDump); lassospkit_debuglog("load dump " . $identityDump, 1);
$profile->setIdentityFromDump($identityDump); $profile->setIdentityFromDump($identityDump);
} }
} }

View File

@ -48,7 +48,7 @@ class LassoSPKitSaml2 extends LassoSPKitSAMLCommon {
'isPassive' => FALSE); 'isPassive' => FALSE);
$params = array_merge($default_params, $params); $params = array_merge($default_params, $params);
extract($params); extract($params);
#lassospkit_debuglog("Params isPassive: $isPassive allowCreate: $allowCreate format: $nameIDFormat"); lassospkit_debuglog("Params isPassive: $isPassive allowCreate: $allowCreate format: $nameIDFormat", 1);
$login = null; $login = null;
return parent::ssoCommon($login, $remoteID, $method, $isConsentObtained, $forceAuthn, $isPassive, $relayState, array('nameIDFormat'=>$nameIDFormat, 'allowCreate' => $allowCreate)); return parent::ssoCommon($login, $remoteID, $method, $isConsentObtained, $forceAuthn, $isPassive, $relayState, array('nameIDFormat'=>$nameIDFormat, 'allowCreate' => $allowCreate));
} }

View File

@ -44,10 +44,10 @@ class LassoSPKitSaml2Endpoint extends LassoSPKitEndpoint {
$profile = $this->getProfileObject(); $profile = $this->getProfileObject();
$ret = $profile->processSOAPRequestNameIdManagement(); $ret = $profile->processSOAPRequestNameIdManagement();
} catch (LassoError $e) { } catch (LassoError $e) {
lassospkit_debuglog('Critical error: ' . $e); lassospkit_debuglog('Critical error: ' . $e, 1);
$ret = $e->getCode(); $ret = $e->getCode();
} catch (Exception $e) { } catch (Exception $e) {
lassospkit_debuglog('Unkown exception error: ' . $e); lassospkit_debuglog('Unkown exception error: ' . $e, 1);
$ret = -1; $ret = -1;
} }
return $this->handleNameIdManagement($ret); return $this->handleNameIdManagement($ret);

View File

@ -12,11 +12,11 @@ class LassoSPKitSessionMemCache {
function retrieve($session, $timeout) { function retrieve($session, $timeout) {
$LassoSPKitSessionMemCache_cookiename = 'lassospkit_memcache_' . LassoSPKitConfig::get('cookiename'); $LassoSPKitSessionMemCache_cookiename = 'lassospkit_memcache_' . LassoSPKitConfig::get('cookiename');
#lassospkit_debuglog("Retrieving $LassoSPKitSessionMemCache_cookiename : " . var_export($_COOKIE, 1)); lassospkit_debuglog("Retrieving $LassoSPKitSessionMemCache_cookiename : " . var_export($_COOKIE, 1), 1);
$content = null; $content = null;
if (isset($_COOKIE[$LassoSPKitSessionMemCache_cookiename])) { if (isset($_COOKIE[$LassoSPKitSessionMemCache_cookiename])) {
$session->id = $_COOKIE[$LassoSPKitSessionMemCache_cookiename]; $session->id = $_COOKIE[$LassoSPKitSessionMemCache_cookiename];
#lassospkit_debuglog("Retrieving " . $session->id); lassospkit_debuglog("Retrieving " . $session->id, 1);
$valid = ereg("^[[:alnum:]]+$",$session->id); $valid = ereg("^[[:alnum:]]+$",$session->id);
if ($valid) { if ($valid) {
$memcache_key = self::getkey($session); $memcache_key = self::getkey($session);

View File

@ -69,7 +69,7 @@ class LassoSPKitUtilsSession {
# $content = LassoSPKitSessionFile::retrieve($this, self::$timeout); # $content = LassoSPKitSessionFile::retrieve($this, self::$timeout);
# } # }
$content = self::$storage->retrieve($this, self::$timeout); $content = self::$storage->retrieve($this, self::$timeout);
#lassospkit_debuglog("Session construct $content"); lassospkit_debuglog("Session construct $content", 1);
if ($content) { if ($content) {
$t = @unserialize($content); $t = @unserialize($content);
if ($t && is_array($t)) { if ($t && is_array($t)) {
@ -91,7 +91,7 @@ class LassoSPKitUtilsSession {
} }
$content = serialize($this->vars); $content = serialize($this->vars);
self::$storage->store($this, $content); self::$storage->store($this, $content);
#lassospkit_debuglog("Session store $content"); lassospkit_debuglog("Session store $content", 1);
# if (self::$use_session) { # if (self::$use_session) {
# LassoSPKitSessionPHP::store($this, $content); # LassoSPKitSessionPHP::store($this, $content);
# } else { # } else {