1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-18 05:09:05 +01:00

Issue #343 start of fix to make CHAP login via user pages work again (more to do)

This commit is contained in:
SteveD 2013-06-07 22:43:03 +01:00
parent 0ff4a9c5b9
commit a877a2bf89
2 changed files with 30 additions and 6 deletions

View File

@ -38,6 +38,7 @@ e107::css('core', 'core/all.jquery.css', 'jquery');
e107::js("core", "core/front.jquery.js","jquery",5); // Load all default functions.
e107::js("core", "core/all.jquery.js","jquery",5); // Load all default functions.
$js_body_onload = array(); // Legacy array of code to load with page.
//
// *** Code sequence for headers ***
@ -380,7 +381,9 @@ if (!USER && ($pref['user_tracking'] == "session") && varset($pref['password_CHA
if ($pref['password_CHAP'] == 2)
{
// *** Add in the code to swap the display tags
$js_body_onload[] = "expandit('loginmenuchap','nologinmenuchap');";
// $js_body_onload[] = "expandit('loginmenuchap','nologinmenuchap');";
$js_body_onload[] = "expandit('loginmenuchap');";
$js_body_onload[] = "expandit('nologinmenuchap');";
}
echo "<script type='text/javascript' src='".e_JS."chap_script.js'></script>\n";
$js_body_onload[] = "getChallenge();";
@ -506,7 +509,7 @@ if (isset($script_text) && $script_text)
//if(in_array('fader_menu', $eMenuActive)) $js_body_onload[] = 'changecontent(); ';
// External links handling
$js_body_onload = array();//'externalLinks();'; - already registered to e107:loaded Event by the new JS API
//$js_body_onload = array();//'externalLinks();'; - already registered to e107:loaded Event by the new JS API
// Theme JS
// XXX DEPRECATED $body_onload and related functionality
@ -568,7 +571,7 @@ echo "</head>\n";
{
$HEADER = "";
$FOOTER = "";
$body_onload = " style='padding:15px;margin:0px'"; //TODO e-iframe css class.
$body_onload .= " style='padding:15px;margin:0px'"; //TODO e-iframe css class.
}
$HEADER = str_replace("{e_PAGETITLE}",deftrue('e_PAGETITLE',''),$HEADER);
@ -580,7 +583,15 @@ if(!deftrue('BODYTAG')) //TODO Discuss a better way?
}
else
{
echo BODYTAG."\n";
if ($body_onload)
{
// Kludge to get the CHAP code included
echo substr(trim(BODYTAG), 0, -1).' '.$body_onload.">\n"; // FIXME - must be a better way!
}
else
{
echo BODYTAG."\n";
}
}
// Bootstrap Modal Window - too important to template.

View File

@ -90,10 +90,23 @@ $LOGIN_TEMPLATE['page']['header'] = "
$LOGIN_TEMPLATE['page']['body'] = '
<h2 class="form-signin-heading">'.LAN_LOGIN_4.'</h2>
<h2 class="form-signin-heading">'.LAN_LOGIN_4.'</h2>';
if ($pref['password_CHAP'] == 2)
{
$LOGIN_TEMPLATE['page']['body'] .= "
<div style='text-align: center' id='nologinmenuchap'>"."Javascript must be enabled in your browser if you wish to log into this site"."
</div>
<span style='display:none' id='loginmenuchap'>";
}
else
{
$LOGIN_TEMPLATE['page']['body'] .= "<span>";
}
$LOGIN_TEMPLATE['page']['body'] .= '
{LOGIN_TABLE_USERNAME}
{LOGIN_TABLE_PASSWORD}
{LOGIN_TABLE_SECIMG_SECIMG} {LOGIN_TABLE_SECIMG_TEXTBOC}
{LOGIN_TABLE_SECIMG_SECIMG} {LOGIN_TABLE_SECIMG_TEXTBOC}
</span>
<label class="checkbox">
{LOGIN_TABLE_AUTOLOGIN} {LOGIN_TABLE_AUTOLOGIN_LAN}
</label>