summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-02-11 22:35:54 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-02-11 22:42:24 +0100
commit4419df1da4f5b7199ece4f51f2e4da66f976616e (patch)
tree6cc07906377816d00e79e49692674bc8f21ac084
parent06abbd02c2d10934155b2464f73d8ecdb2a68de1 (diff)
Fix Persona reloaded
When user is disconnected, current_user_mail must be null and not an empty string See #418
-rw-r--r--app/views/helpers/javascript_vars.phtml8
1 files changed, 7 insertions, 1 deletions
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, '",',