From 4419df1da4f5b7199ece4f51f2e4da66f976616e Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 11 Feb 2014 22:35:54 +0100 Subject: Fix Persona reloaded When user is disconnected, current_user_mail must be null and not an empty string See #418 --- app/views/helpers/javascript_vars.phtml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 42312bc97..3d7c8a98f 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -32,7 +32,13 @@ if (Minz_Request::param ('output') === 'global') { $authType = Minz_Configuration::authType(); if ($authType === 'persona') { - echo 'current_user_mail="' . Minz_Session::param ('mail', '') . '",'; + // If user is disconnected, current_user_mail MUST be null + $mail = Minz_Session::param ('mail', false); + if ($mail) { + echo 'current_user_mail="' . $mail . '",'; + } else { + echo 'current_user_mail=null,'; + } } echo 'authType="', $authType, '",', -- cgit v1.2.3