authentication : manage the state of session based on session_id() instead of isset ($_SESSION)
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4268 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -84,7 +84,7 @@ class authentication
|
||||
*/
|
||||
public function logout ($url = "")
|
||||
{
|
||||
if (! isset ($_SESSION))
|
||||
if (session_id () === "")
|
||||
session_start ();
|
||||
if ($this->debug) echo "<pre>LOGOUT\n";
|
||||
$authsession = new \authsession ();
|
||||
@@ -114,7 +114,7 @@ class authentication
|
||||
public function pageHTML ($url = "")
|
||||
{
|
||||
// If the user is already connected, redirect to the main page of the site
|
||||
if (! isset ($_SESSION))
|
||||
if (session_id () === "")
|
||||
session_start ();
|
||||
$auth = new \auth ();
|
||||
$pre = new \authparams (array ("session"));
|
||||
@@ -138,7 +138,7 @@ class authentication
|
||||
*/
|
||||
public function verifAuthLoginPage ($url = "")
|
||||
{
|
||||
if (! isset ($_SESSION))
|
||||
if (session_id () === "")
|
||||
session_start ();
|
||||
if ($this->debug) echo "Call verifAuthLoginPage ($url) : Start\n";
|
||||
// rate-limit the connections
|
||||
@@ -365,7 +365,7 @@ class authentication
|
||||
$this->route
|
||||
->get ("authentication/logout({url})?", function ($url) use ($authObj)
|
||||
{
|
||||
if (! isset ($_SESSION))
|
||||
if (session_id () === "")
|
||||
session_start ();
|
||||
$authObj->logout ($url);
|
||||
})
|
||||
@@ -377,7 +377,7 @@ class authentication
|
||||
|
||||
->get ("authentication/({url})?", function ($url) use ($authObj)
|
||||
{
|
||||
if (! isset ($_SESSION))
|
||||
if (session_id () === "")
|
||||
session_start ();
|
||||
$authObj->pageHTML ($url);
|
||||
exit;
|
||||
@@ -385,7 +385,7 @@ class authentication
|
||||
|
||||
->post ("authentication/({url})?", function ($url) use ($authObj)
|
||||
{
|
||||
if (! isset ($_SESSION))
|
||||
if (session_id () === "")
|
||||
session_start ();
|
||||
$authObj->verifAuthLoginPage ($url);
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user