authsession : don't display warning if the information is not stored in the previous session

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2086 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2015-04-28 09:58:07 +00:00
parent da8d0d9925
commit ee3f8867bf

View File

@@ -37,6 +37,10 @@ class authsession extends auth
/** Return all the parameters recorded for the authenticate user */
public function getdetails ()
{
if (! isset ($_SESSION["domframework"]["auth"]["email"]))
return array ("lastname"=>"anonymous",
"firstname"=>"",
"email"=>"anonymous");
return array ("lastname"=>$_SESSION["domframework"]["auth"]["lastname"],
"firstname"=>$_SESSION["domframework"]["auth"]["firstname"],
"email"=>$_SESSION["domframework"]["auth"]["email"]);
@@ -77,9 +81,13 @@ class authsession extends auth
/** Remove the informations from the session */
public function logout ()
{
unset ($_SESSION["domframework"]["auth"]["lastname"]);
unset ($_SESSION["domframework"]["auth"]["firstname"]);
unset ($_SESSION["domframework"]["auth"]["email"]);
unset ($_SESSION["domframework"]["auth"]["password"]);
if (isset ($_SESSION["domframework"]["auth"]["lastname"]))
unset ($_SESSION["domframework"]["auth"]["lastname"]);
if (isset ($_SESSION["domframework"]["auth"]["firstname"]))
unset ($_SESSION["domframework"]["auth"]["firstname"]);
if (isset ($_SESSION["domframework"]["auth"]["email"]))
unset ($_SESSION["domframework"]["auth"]["email"]);
if (isset ($_SESSION["domframework"]["auth"]["password"]))
unset ($_SESSION["domframework"]["auth"]["password"]);
}
}