forked from Wavyzz/dolibarr
Suppression de PEAR.
Le mode de connexion ldap reste a tester.
This commit is contained in:
@@ -1332,186 +1332,6 @@ function info_admin($texte)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\brief Affiche formulaire de login PEAR
|
||||
\remarks Il faut changer le code html dans cette fonction pour changer le design de la logon
|
||||
*/
|
||||
function dol_loginfunction($notused,$pearstatus)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("other");
|
||||
|
||||
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
||||
// Si feuille de style en php existe
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php";
|
||||
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
|
||||
// Ce DTD est KO car inhibe document.body.scrollTop
|
||||
//print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||
// Ce DTD est OK
|
||||
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
|
||||
|
||||
// En tete html
|
||||
print "<html>\n";
|
||||
print "<head>\n";
|
||||
print '<meta name="robots" content="noindex,nofollow">'."\n"; // Evite indexation par robots
|
||||
print "<title>Dolibarr login</title>\n";
|
||||
|
||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/'.$conf->css.'">'."\n";
|
||||
|
||||
print '<style type="text/css">'."\n";
|
||||
print '<!--'."\n";
|
||||
print '#login {';
|
||||
print ' margin-top: 70px;';
|
||||
print ' margin-bottom: 30px;';
|
||||
print ' text-align: center;';
|
||||
print ' font: 12px arial,helvetica;';
|
||||
print '}'."\n";
|
||||
print '#login table {';
|
||||
print ' border: 1px solid #C0C0C0;';
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'))
|
||||
{
|
||||
print 'background: #F0F0F0 url('.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_background.png) repeat-x;';
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'background: #F0F0F0 url('.DOL_URL_ROOT.'/theme/login_background.png) repeat-x;';
|
||||
}
|
||||
print 'font-size: 12px;';
|
||||
print '}'."\n";
|
||||
print '-->'."\n";
|
||||
print '</style>'."\n";
|
||||
print '<script language="javascript" type="text/javascript">'."\n";
|
||||
print "function donnefocus() {\n";
|
||||
if (! $_REQUEST["username"]) print "document.getElementById('username').focus();\n";
|
||||
else print "document.getElementById('password').focus();\n";
|
||||
print "}\n";
|
||||
print '</script>'."\n";
|
||||
print '</head>'."\n";
|
||||
|
||||
// Body
|
||||
print '<body class="body" onload="donnefocus();">';
|
||||
|
||||
// Start Form
|
||||
print '<form id="login" name="login" method="post" action="';
|
||||
print $_SERVER['PHP_SELF'];
|
||||
print $_SERVER["QUERY_STRING"]?'?'.$_SERVER["QUERY_STRING"]:'';
|
||||
print '">';
|
||||
|
||||
// Table 1
|
||||
print '<table cellpadding="0" cellspacing="0" border="0" align="center" width="450">';
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/logo.png'))
|
||||
{
|
||||
// TODO A virer Cas qui ne devrait pas arriver (pour compatibilit<69>)
|
||||
print '<tr><td colspan="3" style="text-align:center;">';
|
||||
print '<img src="/logo.png"></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr class="vmenu"><td align="center">Dolibarr '.DOL_VERSION.'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
// Table 2
|
||||
print '<table cellpadding="2" align="center" width="450">';
|
||||
|
||||
print '<tr><td colspan="3"> </td></tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td align="left" valign="top"><br> <b>'.$langs->trans("Login").'</b> </td>';
|
||||
print '<td><input type="text" id="username" name="username" class="flat" size="15" maxlength="25" value="'.(isset($_REQUEST["username"])?$_REQUEST["username"]:'').'" tabindex="1" /></td>';
|
||||
|
||||
$title.=$langs->trans("SessionName").': '.session_name();
|
||||
if ($conf->main_authentication) $title.=", ".$langs->trans("AuthenticationMode").': '.$conf->main_authentication;
|
||||
|
||||
// Show logo (search in order: small company logo, large company logo, theme logo, common logo)
|
||||
$width=0;
|
||||
$urllogo=DOL_URL_ROOT.'/theme/login_logo.png';
|
||||
if (! empty($mysoc->logo_small) && is_readable($conf->societe->dir_logos.'/thumbs/'.$mysoc->logo_small))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small);
|
||||
}
|
||||
elseif (! empty($mysoc->logo_small) && is_readable($conf->societe->dir_logos.'/'.$mysoc->logo))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode($mysoc->logo);
|
||||
$width=96;
|
||||
}
|
||||
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_logo.png'))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_logo.png';
|
||||
}
|
||||
print '<td rowspan="2" align="center"><img title="'.$title.'" src="'.$urllogo.'"';
|
||||
if ($width) print ' width="'.$width.'"';
|
||||
print '></td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '<tr><td align="left" valign="top" nowrap="nowrap"> <b>'.$langs->trans("Password").'</b> </td>';
|
||||
print '<td valign="top" nowrap="nowrap"><input id="password" name="password" class="flat" type="password" size="15" maxlength="30" tabindex="2">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td colspan="3"> </td></tr>'."\n";
|
||||
|
||||
// Code de s<>curit<69>
|
||||
$disabled=! $conf->global->MAIN_SECURITY_ENABLECAPTCHA;
|
||||
if (function_exists("imagecreatefrompng") && ! $disabled)
|
||||
{
|
||||
//print "Info session: ".session_name().session_id();print_r($_SESSION);
|
||||
print '<tr><td align="left" valign="middle" nowrap="nowrap"> <b>'.$langs->trans("SecurityCode").'</b></td>';
|
||||
print '<td valign="top" nowrap="nowrap" align="left" class="e">';
|
||||
|
||||
print '<table><tr>';
|
||||
print '<td><input id="securitycode" class="flat" type="text" size="6" maxlength="5" name="code" tabindex="3"></td>';
|
||||
print '<td><img src="'.DOL_URL_ROOT.'/lib/antispamimage.php" border="0" width="128" height="36"></td>';
|
||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'">'.img_refresh().'</a></td>';
|
||||
print '</tr></table>';
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr><td colspan="3" style="text-align:center;"><br>';
|
||||
print '<input type="submit" class="button" value=" '.$langs->trans("Connection").' " tabindex="4" />';
|
||||
print '</td></tr>';
|
||||
|
||||
if (! $conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)
|
||||
{
|
||||
print '<tr><td colspan="3" align="center"><a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/user/passwordforgotten.php">('.$langs->trans("PasswordForgotten").')</a></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<input type="hidden" name="loginfunction" value="loginfunction" />';
|
||||
|
||||
print '</form>';
|
||||
|
||||
// Message
|
||||
if ($_SESSION["loginmesg"] || ! empty($pearstatus))
|
||||
{
|
||||
print '<center><table width="60%"><tr><td align="center" class="small"><div class="error">';
|
||||
if ($pearstatus == AUTH_EXPIRED) print "<i>Your session expired. Please login again!</i>\n";
|
||||
elseif ($pearstatus == AUTH_IDLED) print "<i>You have been idle for too long. Please login again!</i>\n";
|
||||
elseif ($pearstatus == AUTH_WRONG_LOGIN) print $langs->trans("ErrorBadLoginPassword");
|
||||
elseif ($_SESSION["loginmesg"])
|
||||
{
|
||||
print $_SESSION["loginmesg"];
|
||||
$_SESSION["loginmesg"]="";
|
||||
}
|
||||
print '</div></td></tr></table></center>';
|
||||
}
|
||||
if ($conf->global->MAIN_HOME)
|
||||
{
|
||||
print '<center><table cellpadding="0" cellspacing="0" border="0" align="center" width="750"><tr><td align="center">';
|
||||
print nl2br($conf->global->MAIN_HOME);
|
||||
print '</td></tr></table></center><br>';
|
||||
}
|
||||
|
||||
// Fin entete html
|
||||
print "\n</body>\n</html>";
|
||||
}
|
||||
|
||||
/**
|
||||
\brief V<>rifie les droits de l'utilisateur
|
||||
\param user Utilisateur courant
|
||||
|
||||
Reference in New Issue
Block a user