Commit 3c3e9c6f authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Request browserid javascript file from head element

Including the file https://browserid.org/include.js

 with an inline
script tag sometimes causes an annoying flash.  This goes away when
the javascript is added into the <head> element instead.

Change-Id: I5840e84e27d56bc9e8cf1a321e71ef3072704113
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent d5d50051
......@@ -230,10 +230,10 @@ class PluginAuthBrowserid extends PluginAuth {
* the browser.
*/
public static function login_form_js() {
global $HEADDATA;
$HEADDATA[] = '<script src="https://browserid.org/include.js" type="text/javascript"></script>';
$wwwroot = get_config('wwwroot');
return <<< EOF
<script src="https://browserid.org/include.js" type="text/javascript"></script>
<form id="browserid-form" action="{$wwwroot}auth/browserid/login.php" method="post">
<input id="browserid-assertion" type="hidden" name="assertion" value="">
<input style="display: none" type="submit">
......
......@@ -60,7 +60,7 @@ function smarty_core() {
*/
function smarty($javascript = array(), $headers = array(), $pagestrings = array(), $extraconfig = array()) {
global $USER, $SESSION, $THEME;
global $USER, $SESSION, $THEME, $HEADDATA;
if (!is_array($headers)) {
$headers = array();
......@@ -441,7 +441,6 @@ EOF;
$smarty->assign_by_ref('USER', $USER);
$smarty->assign('SESSKEY', $USER->get('sesskey'));
$smarty->assign_by_ref('JAVASCRIPT', $javascript_array);
$smarty->assign_by_ref('HEADERS', $headers);
$siteclosedforupgrade = get_config('siteclosed');
if ($siteclosedforupgrade && get_config('disablelogin')) {
$smarty->assign('SITECLOSED', 'logindisabled');
......@@ -583,6 +582,11 @@ EOF;
}
if (is_array($HEADDATA) && !empty($HEADDATA)) {
$headers = array_merge($HEADDATA, $headers);
}
$smarty->assign_by_ref('HEADERS', $headers);
if ($USER->get('parentuser')) {
$smarty->assign('USERMASQUERADING', true);
$smarty->assign('masqueradedetails', get_string('youaremasqueradingas', 'mahara', display_name($USER)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment