MDL-7861 xhtml strict fixes for login page

This commit is contained in:
skodak 2007-01-04 23:27:19 +00:00
parent 003b4b40bd
commit 7bc1c17fef
3 changed files with 32 additions and 22 deletions

View File

@ -1062,7 +1062,7 @@ function popup_form($common, $options, $formid, $selected='', $nothing='choose',
function formerr($error) { function formerr($error) {
if (!empty($error)) { if (!empty($error)) {
echo '<font color="#ff0000">'. $error .'</font>'; echo '<span class="error">'. $error .'</span>';
} }
} }

View File

@ -226,7 +226,7 @@ if ($authsequence[0] == 'cas' and !empty($CFG->cas_enabled)) {
// TODO: if the user failed to authenticate, check if the username corresponds to a remote mnet user // TODO: if the user failed to authenticate, check if the username corresponds to a remote mnet user
if ($users = get_records('user', 'username', $frm->username)) { if ($users = get_records('user', 'username', $frm->username)) {
$errormsg .= "<br>If you are a Moodle Network remote user and can <a href=\"mnet_email.php?u=$frm->username\">confirm your email address here</a>, you can be redirected to your login page.<br>"; $errormsg .= "<br/>If you are a Moodle Network remote user and can <a href=\"mnet_email.php?u=$frm->username\">confirm your email address here</a>, you can be redirected to your login page.<br/>";
} }
} }
} }

View File

@ -1,17 +1,26 @@
<table width="90%" border="0" cellpadding="5" align="center" class="loginbox"> <?php
if ($show_instructions) {
$mainwidth = '90%';
$leftwidth = '50%';
} else {
$mainwidth = '40%';
$leftwidth = '100%';
}
?>
<table width="<?php echo $mainwidth ?>" border="0" cellpadding="5" style="margin-left:auto;margin-right:auto" class="loginbox" summary="">
<?php if ($show_instructions) { ?> <?php if ($show_instructions) { ?>
<tr> <tr>
<th width="50%" class="header left" scope="col"> <th style="width:50%" class="header left" scope="col">
<?php print_string("returningtosite") ?> <?php print_string("returningtosite") ?>
</th> </th>
<th width="50%" class="header right" scope="col"> <th style="width:50%" class="header right" scope="col">
<?php print_string("firsttime") ?> <?php print_string("firsttime") ?>
</th> </th>
</tr> </tr>
<?php } ?> <?php } ?>
<tr> <tr>
<td width="50%" align="center" valign="top" class="content left"> <td style="width:<?php echo $leftwidth ?>" valign="top" class="content left">
<p><?php print_string("loginusing") ?>: <div style="text-align:center"><?php print_string("loginusing") ?>:
<?php <?php
if (empty($CFG->usesid)) if (empty($CFG->usesid))
{ {
@ -20,15 +29,15 @@
echo ")"; echo ")";
helpbutton("cookies", get_string("cookiesenabled")); helpbutton("cookies", get_string("cookiesenabled"));
} }
?><br /><?php formerr($errormsg) ?> ?><div><?php formerr($errormsg) ?></div>
</p> </div>
<form action="index.php" method="post" id="login"> <form action="index.php" method="post" id="login">
<table border="0" align="center"> <table border="0" style="margin-left:auto;margin-right:auto" summary="">
<tr> <tr>
<td width="80%"> <td style="width:80%">
<table align="center" class="loginform"> <table style="margin-left:auto;margin-right:auto" class="loginform" summary="">
<tr class="username"> <tr class="username">
<td align="right" class="c0"> <td style="text-align:right" class="c0">
<label for="username"><?php print_string("username") ?></label> <label for="username"><?php print_string("username") ?></label>
</td> </td>
<td class="c1"> <td class="c1">
@ -36,7 +45,7 @@
</td> </td>
</tr> </tr>
<tr class="password"> <tr class="password">
<td align="right" class="c0"> <td style="text-align:right" class="c0">
<label for="password"><?php print_string("password") ?></label> <label for="password"><?php print_string("password") ?></label>
</td> </td>
<td class="c1"> <td class="c1">
@ -45,7 +54,7 @@
</tr> </tr>
</table> </table>
</td> </td>
<td width="20%"> <td style="width:20%">
<input type="submit" value="<?php print_string("login") ?>" /> <input type="submit" value="<?php print_string("login") ?>" />
<input type="hidden" name="testcookies" value="1" /> <input type="hidden" name="testcookies" value="1" />
</td> </td>
@ -54,8 +63,8 @@
</form> </form>
<?php if ($CFG->guestloginbutton) { ?> <?php if ($CFG->guestloginbutton) { ?>
<hr width="80%" /> <hr style="width:80%" />
<p><?php print_string("someallowguest") ?>:</p> <div style="text-align:center"><?php print_string("someallowguest") ?>:
<form action="index.php" method="post" id="guestlogin"> <form action="index.php" method="post" id="guestlogin">
<div> <div>
<input type="hidden" name="username" value="guest" /> <input type="hidden" name="username" value="guest" />
@ -64,24 +73,26 @@
<input type="submit" value="<?php print_string("loginguest") ?>" /> <input type="submit" value="<?php print_string("loginguest") ?>" />
</div> </div>
</form> </form>
</div>
<?php } ?> <?php } ?>
<?php <?php
$changebuttonname = get_string("passwordrecovery"); $changebuttonname = get_string("passwordrecovery");
$sesskey = sesskey(); $sesskey = sesskey();
?> ?>
<hr width="80%" /> <hr style="width:80%" />
<p><?php print_string("forgotten") ?></p> <div style="text-align:center"><?php print_string("forgotten") ?>
<form action="forgot_password.php" method="post" id="changepassword"> <form action="forgot_password.php" method="post" id="changepassword">
<div> <div>
<input type="hidden" name="sesskey" value="<?php echo $sesskey; ?>" /> <input type="hidden" name="sesskey" value="<?php echo $sesskey; ?>" />
<input type="submit" value="<?php p($changebuttonname) ?>" /> <input type="submit" value="<?php p($changebuttonname) ?>" />
</div> </div>
</form> </form>
</div>
</td> </td>
<?php if ($show_instructions) { ?> <?php if ($show_instructions) { ?>
<td width="50%" valign="top" class="content right"> <td style="width:50%" valign="top" class="content right">
<?php switch ($authsequence[0]) { <?php switch ($authsequence[0]) {
case "email": case "email":
print_string("loginsteps", "", "signup.php"); print_string("loginsteps", "", "signup.php");
@ -116,5 +127,4 @@
</td> </td>
<?php } ?> <?php } ?>
</tr> </tr>
</table> </table>
</div>