From f57c2971dc9814f6f76923acf22a881c8b8df65b Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 29 Apr 2015 07:51:02 +0000 Subject: [PATCH] auth : if the user is already signed in, propose the logout link when arriving to the authentication page git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2087 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- auth.php | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/auth.php b/auth.php index 6dbbd96..6c6a774 100644 --- a/auth.php +++ b/auth.php @@ -11,7 +11,7 @@ class auth The url is the caller url to go back if authentication is correct @param string|null $message Message to display to the user @param string|null $url URL to go back after successful authentication */ - public function pageHTML ($baseURL, $message="", $url="") + public function pageHTML ($baseURL, $message="", $url="", $alreadyAuth=false) { $res = ""; $res .= "\n"; @@ -77,21 +77,32 @@ class auth else $res .= $baseURL."authentication/$url"; $res .= "'>\n"; - $res .= "

".dgettext("domframework", - "Please sign in"); - $res .= "

\n"; - $res .= " \n"; - $res .= " \n"; -// $res .= " \n"; - $res .= " \n"; + if ($alreadyAuth === false) + { + $res .= "

".dgettext("domframework", + "Please sign in"); + $res .= "

\n"; + $res .= " \n"; + $res .= " \n"; + // $res .= " \n"; + $res .= " \n"; + } + else + { + $res .= "

".dgettext("domframework", + "Already sign in"); + $res .= "

\n"; + $res .= "

".dgettext ("domframework", "Click here to logout")."

\n"; + + } if ($message !== "") $res .= "
$message
"; $res .= " \n";