Uniformize login and password forgotten page

This commit is contained in:
Laurent Destailleur 2012-02-19 12:54:04 +01:00
parent a145d85177
commit 48f5f0dca7
2 changed files with 143 additions and 124 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -45,7 +45,7 @@ print '<link rel="stylesheet" type="text/css" href="'.$conf_css.'" />
margin-top: 70px;
margin-bottom: 30px;
}
#login table {
.login_table {
width: 512px;
border: 1px solid #C0C0C0;
background: #F0F0F0 url('.$login_background.') repeat-x;
@ -210,127 +210,136 @@ jQuery(document).ready(function () {
<input type="hidden" name="screenwidth" id="screenwidth" value="" />
<input type="hidden" name="screenheight" id="screenheight" value="" />
<table class="login" summary="<?php echo $title; ?>" cellpadding="0" cellspacing="0" border="0" align="center">
<table class="login_table" summary="<?php echo $title; ?>" cellpadding="0" cellspacing="0" border="0" align="center">
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
</table>
<br>
<table class="login" summary="Login area" cellpadding="2" align="center">
<table class="login_table" summary="Login area" cellpadding="2" align="center">
<tr><td colspan="3">&nbsp;</td></tr>
<tr><td colspan="2" valign="middle">
<table class="none" summary="Login pass" cellpadding="2" align="center">
<!-- Login -->
<tr>
<td valign="bottom"> &nbsp; <strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong> &nbsp; </td>
<td valign="bottom" nowrap="nowrap">
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo GETPOST('username')?GETPOST('username'):$login; ?>" tabindex="1" /></td>
<td rowspan="<?php echo $rowspan; ?>" align="center" valign="top">
<img alt="Logo" title="" src="<?php echo $urllogo; ?>" />
<input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo GETPOST('username')?GETPOST('username'):$login; ?>" tabindex="1" />
</td>
</tr>
<!-- Password -->
<tr><td valign="top" nowrap="nowrap"> &nbsp; <strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong> &nbsp; </td>
<td valign="top" nowrap="nowrap">
<input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo $password; ?>" tabindex="2" />
</td></tr>
<?php if ($select_entity) { ?>
<tr><td valign="top" nowrap="nowrap"> &nbsp; <strong><?php echo $langs->trans('Entity'); ?></strong> &nbsp; </td>
<td valign="top" nowrap="nowrap">
<?php echo $select_entity; ?>
</td></tr>
<?php } ?>
<?php if ($select_entity) { ?>
<tr><td valign="top" nowrap="nowrap"> &nbsp; <strong><?php echo $langs->trans('Entity'); ?></strong> &nbsp; </td>
<td valign="top" nowrap="nowrap">
<?php echo $select_entity; ?>
</td></tr>
<?php } ?>
<?php if ($captcha) { ?>
<tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td>
<td valign="top" nowrap="nowrap" align="left" class="none">
<?php if ($captcha) { ?>
<tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td>
<td valign="top" nowrap="nowrap" align="left" class="none">
<table style="width: 100px;"><tr>
<td><input id="securitycode" class="flat" type="text" size="6" maxlength="5" name="code" tabindex="4" /></td>
<td><img src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" /></td>
<td><a href="<?php echo $php_self; ?>"><?php echo $captcha_refresh; ?></a></td>
</tr></table>
<table class="login_table" style="width: 100px;"><tr>
<td><input id="securitycode" class="flat" type="text" size="6" maxlength="5" name="code" tabindex="4" /></td>
<td><img src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" /></td>
<td><a href="<?php echo $php_self; ?>"><?php echo $captcha_refresh; ?></a></td>
</tr></table>
</td></tr>
<?php } ?>
</td></tr>
<?php } ?>
<tr><td colspan="3">&nbsp;</td></tr>
</table>
</td>
<td align="center" valign="top">
<img alt="Logo" title="" src="<?php echo $urllogo; ?>" />
</td>
</tr>
<!-- Button Connection -->
<tr><td colspan="3" style="text-align:center;"><br>
<input type="submit" class="button" value="&nbsp; <?php echo $langs->trans('Connection'); ?> &nbsp;" tabindex="5" />
</td></tr>
<?php
if ($forgetpasslink || $helpcenterlink) {
echo '<tr><td colspan="3" align="center">';
if ($forgetpasslink) {
echo '<a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/user/passwordforgotten.php">(';
echo $langs->trans('PasswordForgotten');
if (! $helpcenterlink) {
echo ')';
}
echo '</a>';
if ($forgetpasslink || $helpcenterlink) {
echo '<tr><td colspan="3" align="center">';
if ($forgetpasslink) {
echo '<a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/user/passwordforgotten.php">(';
echo $langs->trans('PasswordForgotten');
if (! $helpcenterlink) {
echo ')';
}
if ($helpcenterlink) {
echo '<a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/support/index.php" target="_blank">';
if ($forgetpasslink) {
echo '&nbsp;-&nbsp;';
} else {
echo '(';
}
echo $langs->trans('NeedHelpCenter').')</a>';
}
echo '</td></tr>';
echo '</a>';
}
if ($helpcenterlink) {
echo '<a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/support/index.php" target="_blank">';
if ($forgetpasslink) {
echo '&nbsp;-&nbsp;';
} else {
echo '(';
}
echo $langs->trans('NeedHelpCenter').')</a>';
}
echo '</td></tr>';
}
?>
</table>
</form>
<?php if (! empty($_SESSION['dol_loginmesg']))
{
?>
<center><table width="60%"><tr><td align="center"><div class="error">
<?php echo $_SESSION['dol_loginmesg']; ?>
</div></td></tr></table></center>
<?php
}
?>
<?php if ($main_home)
{
?>
<center><table summary="info" cellpadding="0" cellspacing="0" border="0" align="center" width="750">
<tr><td align="center">
<?php echo $main_home; ?>
</td></tr></table></center><br>
<?php
}
?>
<?php
if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
{
?>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
google_ad_slot = "<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<?php
}
?>
<?php if (! empty($_SESSION['dol_loginmesg']))
{
?>
<center><table width="60%"><tr><td align="center"><div class="error">
<?php echo $_SESSION['dol_loginmesg']; ?>
</div></td></tr></table></center>
<?php
}
?>
<?php if ($main_home)
{
?>
<center><table summary="info" cellpadding="0" cellspacing="0" border="0" align="center" width="750">
<tr><td align="center">
<?php echo $main_home; ?>
</td></tr></table></center><br>
<?php
}
?>
<?php
if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
{
?>
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
google_ad_slot = "<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<?php
}
?>
<!-- authentication mode = <?php echo $main_authentication ?> -->
<!-- cookie name used for this session = <?php echo $session_name ?> -->

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2011-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -15,70 +16,69 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
header('Cache-Control: Public, must-revalidate');
header("Content-type: text/html; charset=".$conf->file->character_set_client);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- BEGIN PHP TEMPLATE -->
<html>
<head>
<meta name="robots" content="noindex,nofollow">
<title>Dolibarr Authentification</title>
<link rel="stylesheet" type="text/css" href="<?php echo $conf_css; ?>">
<?php
print '<head>
<meta name="robots" content="noindex,nofollow" />
<meta name="author" content="Dolibarr Development Team">
<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'"/>
<title>'.$langs->trans('Login').' '.$title.'</title>'."\n";
print '<!-- Includes for JQuery (Ajax library) -->'."\n";
if (constant('JS_JQUERY_UI')) print '<link rel="stylesheet" type="text/css" href="'.JS_JQUERY_UI.'css/'.$jquerytheme.'/jquery-ui.min.css" />'."\n"; // JQuery
else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// JQuery. Must be before other includes
print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\n";
else print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-latest.min'.$ext.'"></script>'."\n";
print '<link rel="stylesheet" type="text/css" href="'.$conf_css.'" />
<style type="text/css">
<!--
#login {
margin-top: 70px;
margin-bottom: 30px;
text-align: center;
font: 12px arial,helvetica;
}
#login table {
width: 498px;
.login_table {
width: 512px;
border: 1px solid #C0C0C0;
background: #F0F0F0 url('<?php echo $login_background; ?>') repeat-x;
font-size: 12px;
background: #F0F0F0 url('.$login_background.') repeat-x;
}
-->
</style>
</style>'."\n";
if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER;
print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
</head>';
<script type="text/javascript">
function donnefocus() {
document.getElementById('<?php echo $focus_element; ?>').focus();
}
</script>
?>
</head>
<body class="body">
<body class="body" onload="donnefocus();">
<form id="login" name="login" method="post" action="<?php echo $php_self; ?>">
<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>">
<input type="hidden" name="action" value="buildnewpassword">
<table class="login" summary="<?php echo $title; ?>" cellpadding="0" cellspacing="0" border="0" align="center">
<table class="login_table" summary="<?php echo $title; ?>" cellpadding="0" cellspacing="0" border="0" align="center">
<tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
</table>
<br>
<table class="login" summary="Login area" cellpadding="2" align="center">
<table class="login_table" summary="Login area" cellpadding="2" align="center">
<tr><td colspan="3">&nbsp;</td></tr>
<tr><td colspan="2" valign="middle">
<table class="none" summary="Login pass" cellpadding="2" align="center">
<!-- Login -->
<tr>
<td valign="bottom"> &nbsp; <b><?php echo $langs->trans('Login'); ?></b> &nbsp; </td>
<td valign="bottom" nowrap="nowrap">
<input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></td>
<td rowspan="<?php echo $rowspan; ?>" align="center" valign="top">
<img alt="Logo" title="" src="<?php echo $urllogo; ?>" />
</td>
</tr>
<?php if ($select_entity) { ?>
@ -92,7 +92,7 @@ function donnefocus() {
<tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td>
<td valign="middle" nowrap="nowrap" align="left" class="none">
<table style="width: 100px;"><tr>
<table class="login_table" style="width: 100px;"><tr>
<td><input id="securitycode" class="flat" type="text" size="6" maxlength="5" name="code" tabindex="3"></td>
<td><img src="<?php echo $dol_url_root.'/core/antispamimage.php'; ?>" border="0" width="80" height="32"></td>
<td><a href="<?php echo $php_self; ?>"><?php echo $captcha_refresh; ?></a></td>
@ -101,12 +101,26 @@ function donnefocus() {
</td></tr>
<?php } ?>
<tr><td colspan="3">&nbsp;</td></tr>
</table>
</td>
<td align="center" valign="top">
<img alt="Logo" title="" src="<?php echo $urllogo; ?>" />
</td>
</tr>
<!-- Button Send password -->
<tr><td colspan="3" style="text-align:center;"><br>
<input id="password" type="submit" <?php echo $disabled; ?> class="button" name="password" value="<?php echo $langs->trans('SendNewPassword'); ?>" tabindex="4" />
</td></tr>
<tr><td colspan="3" align="center">
<a style="color: #888888; font-size: 10px" href="<?php echo $dol_url_root; ?>/">
<?php echo '('.$langs->trans('BackToLoginPage').')'; ?>
</a>
</td></tr>
</table>
</form>
@ -135,10 +149,6 @@ function donnefocus() {
</td></tr></table><br>
<?php } ?>
<br>
<a href="<?php echo $dol_url_root; ?>/">
<?php echo $langs->trans('BackToLoginPage'); ?>
</a>
</center>
<br>