Преглед изворни кода

Fix Persona reloaded

When user is disconnected, current_user_mail must be null and not an empty
string
See #418
Marien Fressinaud пре 12 година
родитељ
комит
4419df1da4
1 измењених фајлова са 7 додато и 1 уклоњено
  1. 7 1
      app/views/helpers/javascript_vars.phtml

+ 7 - 1
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, '",',