Fix: Css relative url must start with / as it means relative to DOL_URL_ROOT.
This commit is contained in:
parent
7a0abdf93c
commit
1374e7eeab
@ -37,6 +37,15 @@ $langs->load("companies");
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
// Define size of logo small and mini
|
||||
$maxwidthsmall=270;$maxheightsmall=150;
|
||||
$maxwidthmini=128;$maxheightmini=72;
|
||||
$quality = 80;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
|
||||
|| (isset($_POST["action"]) && $_POST["action"] == 'updateedit') )
|
||||
@ -71,12 +80,12 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file,'chaine',0,'',$conf->entity);
|
||||
|
||||
// Create thumbs of logo
|
||||
// Create thumbs of logo (Note that PDF use original file and not thumbs)
|
||||
if ($isimage > 0)
|
||||
{
|
||||
$quality = 80;
|
||||
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, 200, 100, '_small', $quality);
|
||||
// Create small thumbs for company (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
|
||||
if (preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
|
||||
{
|
||||
$imgThumbSmall = $reg[1];
|
||||
@ -84,8 +93,9 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
|
||||
}
|
||||
else dol_syslog($imgThumbSmall);
|
||||
|
||||
// Creation de la vignette de la page "Societe/Institution"
|
||||
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, 100, 30, '_mini', $quality);
|
||||
// Create mini thumbs for company (Ratio is near 16/9)
|
||||
// Used on menu or for setup page for example
|
||||
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality);
|
||||
if (preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg))
|
||||
{
|
||||
$imgThumbMini = $reg[1];
|
||||
@ -135,8 +145,9 @@ if ($_GET["action"] == 'addthumb')
|
||||
// Create thumbs of logo
|
||||
if ($isimage > 0)
|
||||
{
|
||||
// Creation de la vignette de la page login
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], 200, 100, '_small',80);
|
||||
// Create small thumbs for company (Ratio is near 16/9)
|
||||
// Used on logon for example
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality);
|
||||
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
|
||||
{
|
||||
$imgThumbSmall = $reg[1];
|
||||
@ -144,8 +155,9 @@ if ($_GET["action"] == 'addthumb')
|
||||
}
|
||||
else dol_syslog($imgThumbSmall);
|
||||
|
||||
// Creation de la vignette de la page "Societe/Institution"
|
||||
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], 100, 30, '_mini',80);
|
||||
// Create mini thumbs for company (Ratio is near 16/9)
|
||||
// Used on menu or for setup page for example
|
||||
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini',$quality);
|
||||
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg))
|
||||
{
|
||||
$imgThumbMini = $reg[1];
|
||||
|
||||
@ -334,7 +334,7 @@ class Conf
|
||||
// $this->theme et $this->css
|
||||
if (empty($this->global->MAIN_THEME)) $this->global->MAIN_THEME="eldy";
|
||||
$this->theme=$this->global->MAIN_THEME;
|
||||
$this->css = "theme/".$this->theme."/".$this->theme.".css";
|
||||
$this->css = "/theme/".$this->theme."/".$this->theme.".css";
|
||||
|
||||
// $this->email_from = email pour envoi par dolibarr des mails automatiques
|
||||
$this->email_from = "dolibarr-robot@domain.com";
|
||||
|
||||
@ -33,7 +33,7 @@ header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
<title><?php echo $langs->trans('Login'); ?></title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $conf->css; ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $conf_css; ?>">
|
||||
|
||||
<style type="text/css">
|
||||
<!--
|
||||
|
||||
@ -98,10 +98,10 @@ class MenuLeft {
|
||||
// Show logo company
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGO))
|
||||
{
|
||||
$mysoc->logo_small=$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL;
|
||||
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small);
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini);
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>'."\n";
|
||||
|
||||
@ -98,10 +98,10 @@ class MenuLeft {
|
||||
// Show logo company
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGO))
|
||||
{
|
||||
$mysoc->logo_small=$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL;
|
||||
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small);
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini);
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>'."\n";
|
||||
|
||||
@ -100,10 +100,10 @@ class MenuLeft {
|
||||
// Show logo company
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGO))
|
||||
{
|
||||
$mysoc->logo_small=$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL;
|
||||
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small);
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini);
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>'."\n";
|
||||
|
||||
@ -100,10 +100,10 @@ class MenuLeft {
|
||||
// Show logo company
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGO))
|
||||
{
|
||||
$mysoc->logo_small=$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL;
|
||||
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small);
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini);
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>'."\n";
|
||||
|
||||
@ -99,10 +99,10 @@ class MenuLeft {
|
||||
// Show logo company
|
||||
if (! empty($conf->global->MAIN_SHOW_LOGO))
|
||||
{
|
||||
$mysoc->logo_small=$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL;
|
||||
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
|
||||
$mysoc->logo_mini=$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;
|
||||
if (! empty($mysoc->logo_mini) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_small);
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('thumbs/'.$mysoc->logo_mini);
|
||||
print "\n".'<!-- Show logo on menu -->'."\n";
|
||||
print '<div class="blockvmenuimpair">'."\n";
|
||||
print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>'."\n";
|
||||
|
||||
@ -917,7 +917,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, 24);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, 24); // width=0 (auto), max height=24
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -25,303 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
function dol_loginfunction_old($langs,$conf,$mysoc)
|
||||
{
|
||||
global $dolibarr_main_demo,$db;
|
||||
|
||||
$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]);
|
||||
$langs->setDefaultLang($langcode);
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("other");
|
||||
|
||||
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css.php";
|
||||
|
||||
// Set cookie for timeout management
|
||||
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
|
||||
if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", '', 0);
|
||||
|
||||
if (! empty($_REQUEST["urlfrom"])) $_SESSION["urlfrom"]=$_REQUEST["urlfrom"];
|
||||
else unset($_SESSION["urlfrom"]);
|
||||
|
||||
$demologin='';
|
||||
$demopassword='';
|
||||
if (! empty($dolibarr_main_demo))
|
||||
{
|
||||
$tab=explode(',',$dolibarr_main_demo);
|
||||
$demologin=$tab[0];
|
||||
$demopassword=$tab[1];
|
||||
}
|
||||
|
||||
// Entity cookie
|
||||
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY))
|
||||
{
|
||||
$lastuser = '';
|
||||
$lastentity = $_POST['entity'];
|
||||
|
||||
if (! empty($conf->global->MAIN_MULTICOMPANY_COOKIE))
|
||||
{
|
||||
$entityCookieName = 'DOLENTITYID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
|
||||
if (isset($_COOKIE[$entityCookieName]))
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/cookie.class.php");
|
||||
|
||||
$cryptkey = (! empty($conf->file->cookie_cryptkey) ? $conf->file->cookie_cryptkey : '' );
|
||||
|
||||
$entityCookie = new DolCookie($cryptkey);
|
||||
$cookieValue = $entityCookie->_getCookie($entityCookieName);
|
||||
list($lastuser, $lastentity) = explode('|', $cookieValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$title='Dolibarr '.DOL_VERSION;
|
||||
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$conf->global->MAIN_APPLICATION_TITLE;
|
||||
|
||||
|
||||
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||
|
||||
|
||||
// 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>".$langs->trans("Login")."</title>\n";
|
||||
|
||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/'.$conf->css.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
|
||||
print '<style type="text/css">'."\n";
|
||||
print '<!--'."\n";
|
||||
print '#login {';
|
||||
print ' margin-top: '.(empty($conf->browser->phone)?'70px;':'10px;');
|
||||
print ' margin-bottom: '.(empty($conf->browser->phone)?'30px;':'5px;');
|
||||
print ' text-align: center;';
|
||||
print ' font: 12px arial,helvetica;';
|
||||
print '}'."\n";
|
||||
print '#login table {';
|
||||
if (empty($conf->browser->phone)) print ' width: 498px;';
|
||||
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 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";
|
||||
if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER."\n";
|
||||
print '<!-- HTTP_USER_AGENT = '.$_SERVER["HTTP_USER_AGENT"].' -->'."\n";
|
||||
print '</head>'."\n";
|
||||
|
||||
// Body
|
||||
print '<body class="body" onload="donnefocus();">'."\n\n";
|
||||
// Start Form
|
||||
print '<form id="login" name="login" method="post" action="';
|
||||
print $_SERVER['PHP_SELF'];
|
||||
print $_SERVER["QUERY_STRING"]?'?'.$_SERVER["QUERY_STRING"]:'';
|
||||
print '">'."\n";
|
||||
|
||||
// Token field
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
// Table 1
|
||||
print '<table class="login" summary="'.$title.'" cellpadding="0" cellspacing="0" border="0" align="center">'."\n";;
|
||||
print '<tr class="vmenu"><td align="center">'.$title.'</td></tr>'."\n";
|
||||
print '</table>'."\n";
|
||||
print '<br>'."\n\n";
|
||||
|
||||
// Table 2
|
||||
print '<table class="login" summary="Login area" cellpadding="2" align="center">'."\n";
|
||||
|
||||
print '<tr><td colspan="3"> </td></tr>'."\n";
|
||||
|
||||
print '<tr>';
|
||||
|
||||
// Login field
|
||||
print '<td valign="bottom"> <b>'.$langs->trans("Login").'</b> </td>'."\n";
|
||||
print '<td valign="bottom" nowrap="nowrap"><input type="text" id="username" name="username" class="flat" size="15" maxlength="25" value="';
|
||||
print (!empty($lastuser)?$lastuser:(isset($_REQUEST["username"])?$_REQUEST["username"]:$demologin));
|
||||
print '" tabindex="1" /></td>'."\n";
|
||||
// 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->mycompany->dir_output.'/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->mycompany->dir_output.'/logos/'.$mysoc->logo))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode($mysoc->logo);
|
||||
$width=96;
|
||||
}
|
||||
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
|
||||
}
|
||||
$rowspan = 2;
|
||||
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $rowspan++;
|
||||
print '<td rowspan="'.$rowspan.'" align="center" valign="top">'."\n";
|
||||
if (empty($conf->browser->phone))
|
||||
{
|
||||
print '<img alt="Logo" title="" src="'.$urllogo.'"';
|
||||
if ($width) print ' width="'.$width.'"';
|
||||
print '>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
if (! empty($conf->browser->phone)) print '<tr><td colspan="3"> </td></tr>'; // More space with phones
|
||||
|
||||
// Password field
|
||||
print '<tr><td valign="top" nowrap="nowrap"> <b>'.$langs->trans("Password").'</b> </td>'."\n";
|
||||
print '<td valign="top" nowrap="nowrap"><input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="';
|
||||
print $demopassword;
|
||||
print '" tabindex="2">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Entity field
|
||||
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT.'/multicompany/multicompany.class.php');
|
||||
|
||||
$mc = new Multicompany($db);
|
||||
$mc->getEntities();
|
||||
|
||||
if (! empty($conf->browser->phone)) print '<tr><td colspan="3"> </td></tr>'; // More space with phones
|
||||
|
||||
print '<tr><td valign="top" nowrap="nowrap"> <b>'.$langs->trans("Entity").'</b> </td>'."\n";
|
||||
print '<td valign="top" nowrap="nowrap">';
|
||||
print $mc->select_entities($mc->entities,$lastentity,'tabindex="3"');
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
// Security graphical code
|
||||
if (function_exists("imagecreatefrompng") && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA))
|
||||
{
|
||||
//print "Info session: ".session_name().session_id();print_r($_SESSION);
|
||||
print '<tr><td valign="middle" nowrap="nowrap"> <b>'.$langs->trans("SecurityCode").'</b></td>'."\n";
|
||||
print '<td valign="top" nowrap="nowrap" align="left" class="none">'."\n";
|
||||
|
||||
print '<table style="width: 100px;"><tr>'."\n"; // Force width to a small value
|
||||
print '<td><input id="securitycode" class="flat" type="text" size="6" maxlength="5" name="code" tabindex="4"></td>'."\n";
|
||||
$width=128;$height=36;
|
||||
if (! empty($conf->browser->phone)) $width=64; $height=24;
|
||||
print '<td><img src="'.DOL_URL_ROOT.'/lib/antispamimage.php" border="0" width="'.$width.'" height="'.$height.'"></td>'."\n";
|
||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'">'.img_refresh().'</a></td>'."\n";
|
||||
print '</tr></table>'."\n";
|
||||
|
||||
print '</td>';
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
|
||||
print '<tr><td colspan="3"> </td></tr>'."\n";
|
||||
|
||||
print '<tr><td colspan="3" style="text-align:center;"><br>';
|
||||
print '<input type="submit" class="button" value=" '.$langs->trans("Connection").' " tabindex="5" />';
|
||||
print '</td></tr>';
|
||||
|
||||
if (empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK) || empty($conf->global->MAIN_HELPCENTER_DISABLELINK))
|
||||
{
|
||||
if (! empty($conf->browser->phone)) print '<tr><td colspan="3"> </td></tr>'; // More space with phones
|
||||
|
||||
print '<tr><td colspan="3" align="center">';
|
||||
|
||||
if (empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK))
|
||||
{
|
||||
print '<a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/user/passwordforgotten.php">(';
|
||||
print $langs->trans("PasswordForgotten");
|
||||
if (! empty($conf->global->MAIN_HELPCENTER_DISABLELINK)) print ')';
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_HELPCENTER_DISABLELINK))
|
||||
{
|
||||
$langs->load("help");
|
||||
print '<a style="color: #888888; font-size: 10px" href="'.DOL_URL_ROOT.'/support/index.php" target="_blank">';
|
||||
if (! empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) print '(';
|
||||
else print ' - ';
|
||||
print $langs->trans("NeedHelpCenter");
|
||||
print ')</a>';
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
// Hidden fields
|
||||
print '<input type="hidden" name="loginfunction" value="loginfunction" />'."\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
// Message
|
||||
if (! empty($_SESSION["dol_loginmesg"]))
|
||||
{
|
||||
print '<center><table width="60%"><tr><td align="center"><div class="error">';
|
||||
print $_SESSION["dol_loginmesg"];
|
||||
$_SESSION["dol_loginmesg"]="";
|
||||
print '</div></td></tr></table></center>'."\n";
|
||||
}
|
||||
if (! empty($conf->global->MAIN_HOME))
|
||||
{
|
||||
print '<center><table summary="info" cellpadding="0" cellspacing="0" border="0" align="center"'.(empty($conf->browser->phone)?' width="750"':'').'><tr><td align="center">';
|
||||
$i=0;
|
||||
while (preg_match('/__\(([a-zA-Z]+)\)__/i',$conf->global->MAIN_HOME,$reg) && $i < 100)
|
||||
{
|
||||
$conf->global->MAIN_HOME=preg_replace('/__\('.$reg[1].'\)__/i',$langs->trans($reg[1]),$conf->global->MAIN_HOME);
|
||||
$i++;
|
||||
}
|
||||
print nl2br($conf->global->MAIN_HOME);
|
||||
print '</td></tr></table></center><br>'."\n";
|
||||
}
|
||||
|
||||
// Google Adsense (ex: demo mode)
|
||||
if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN_GOOGLE_AD_SLOT))
|
||||
{
|
||||
print '<div align="center">'."\n";
|
||||
print '<script type="text/javascript"><!--'."\n";
|
||||
print 'google_ad_client = "'.$conf->global->MAIN_GOOGLE_AD_CLIENT.'";'."\n";
|
||||
print 'google_ad_slot = "'.$conf->global->MAIN_GOOGLE_AD_SLOT.'";'."\n";
|
||||
print 'google_ad_width = '.$conf->global->MAIN_GOOGLE_AD_WIDTH.';'."\n";
|
||||
print 'google_ad_height = '.$conf->global->MAIN_GOOGLE_AD_HEIGHT.';'."\n";
|
||||
print '//-->'."\n";
|
||||
print '</script>'."\n";
|
||||
print '<script type="text/javascript"'."\n";
|
||||
print 'src="http://pagead2.googlesyndication.com/pagead/show_ads.js">'."\n";
|
||||
print '</script>'."\n";
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
print "\n";
|
||||
print '<!-- authentication mode = '.$conf->file->main_authentication.' -->'."\n";
|
||||
print '<!-- cookie name used for this session = '.session_name().' -->'."\n";
|
||||
print '<!-- urlfrom in this session = '.(isset($_SESSION["urlfrom"])?$_SESSION["urlfrom"]:'').' -->'."\n";
|
||||
|
||||
if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";
|
||||
|
||||
// Fin entete html
|
||||
print "\n</body>\n</html>";
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Show Dolibarr default login page
|
||||
* \param langs Lang object
|
||||
@ -369,8 +72,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
$template_dir=DOL_DOCUMENT_ROOT.'/core/templates/';
|
||||
}
|
||||
|
||||
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
||||
$conf->css.=".php?lang=".$langs->defaultlang;
|
||||
$conf->css = "/theme/".$conf->theme."/".$conf->theme.".css.php?lang=".$langs->defaultlang;
|
||||
}
|
||||
|
||||
// Set cookie for timeout management
|
||||
@ -440,7 +142,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode($mysoc->logo);
|
||||
$width=96;
|
||||
$width=128;
|
||||
}
|
||||
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))
|
||||
{
|
||||
@ -497,13 +199,15 @@ function dol_loginfunction($langs,$conf,$mysoc)
|
||||
}
|
||||
}
|
||||
|
||||
$conf_css=DOL_URL_ROOT.$conf->css;
|
||||
|
||||
|
||||
// START SMARTY
|
||||
if ($conf->global->MAIN_SMARTY)
|
||||
{
|
||||
global $smarty;
|
||||
|
||||
$smarty->assign('conf_css', DOL_URL_ROOT.'/'.$conf->css);
|
||||
$smarty->assign('conf_css', $conf_css);
|
||||
$smarty->assign('langs', $langs);
|
||||
|
||||
if (! empty($conf->global->MAIN_HTML_HEADER)) $smarty->assign('main_html_header', $conf->global->MAIN_HTML_HEADER);
|
||||
|
||||
@ -567,7 +567,7 @@ if (! defined('NOLOGIN'))
|
||||
if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME)
|
||||
{
|
||||
$conf->theme=$user->conf->MAIN_THEME;
|
||||
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
||||
$conf->css = "/theme/".$conf->theme."/".$conf->theme.".css.php";
|
||||
}
|
||||
// Set javascript option
|
||||
if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT))
|
||||
@ -601,10 +601,10 @@ else // If language was forced on URL
|
||||
if (! empty($_GET["theme"]))
|
||||
{
|
||||
$conf->theme=$_GET["theme"];
|
||||
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
||||
$conf->css = "/theme/".$conf->theme."/".$conf->theme.".css.php";
|
||||
}
|
||||
// Style sheet must be a php file
|
||||
$conf->css.=".php";
|
||||
//$conf->css.=".php";
|
||||
|
||||
// Define menu manager to use
|
||||
if (empty($user->societe_id)) // Si utilisateur interne ou non defini
|
||||
@ -701,7 +701,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
{
|
||||
global $user, $conf, $langs, $db;
|
||||
|
||||
if (empty($conf->css)) $conf->css = 'theme/eldy/eldy.css.php';
|
||||
if (empty($conf->css)) $conf->css = '/theme/eldy/eldy.css.php';
|
||||
|
||||
//header("Content-type: text/html; charset=UTF-8");
|
||||
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||
@ -729,8 +729,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
print "\n";
|
||||
|
||||
// Output style sheets
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.'/'.$conf->css.'?lang='.$langs->defaultlang.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
|
||||
// CSS forced by modules
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.$conf->css.'?lang='.$langs->defaultlang.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
|
||||
// CSS forced by modules (relative url starting with /)
|
||||
if (is_array($conf->css_modules))
|
||||
{
|
||||
foreach($conf->css_modules as $cssfile)
|
||||
@ -738,12 +738,12 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.$cssfile.'?lang='.$langs->defaultlang.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
|
||||
}
|
||||
}
|
||||
// CSS forced by page (in top_htmlhead call)
|
||||
// CSS forced by page in top_htmlhead call (relative url starting with /)
|
||||
if (is_array($arrayofcss))
|
||||
{
|
||||
foreach($arrayofcss as $cssfile)
|
||||
{
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.'/'.$cssfile.'?lang='.$langs->defaultlang.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.$cssfile.'?lang='.$langs->defaultlang.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ define('DOL_MAIN_URL_ROOT', $dolibarr_main_url_root); // URL relative root
|
||||
$uri=preg_replace('/^http(s?):\/\//i','',$dolibarr_main_url_root); // $uri contains url without http*
|
||||
$suburi = strstr ($uri, '/'); // $suburi contains url without domain
|
||||
if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
|
||||
define('DOL_URL_ROOT', $suburi); // URL relative root ('/', '/dolibarr', ...)
|
||||
define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
|
||||
if (! empty($dolibarr_main_url_root_static)) define('DOL_URL_ROOT_FULL_STATIC', $dolibarr_main_url_root_static); // Used to put static images on another domain
|
||||
|
||||
|
||||
|
||||
@ -29,9 +29,6 @@ function llxHeaderPaybox($title, $head = "")
|
||||
{
|
||||
global $user, $conf, $langs;
|
||||
|
||||
// Si feuille de style en php existe
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php";
|
||||
|
||||
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||
|
||||
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||
@ -47,7 +44,7 @@ function llxHeaderPaybox($title, $head = "")
|
||||
if ($conf->global->PAYBOX_CSS_URL) print '<link rel="stylesheet" type="text/css" href="'.$conf->global->PAYBOX_CSS_URL.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
else
|
||||
{
|
||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/'.$conf->css.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$conf->css.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
print '<style type="text/css">';
|
||||
print '.CTableRow1 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #e6E6eE; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}';
|
||||
print '.CTableRow2 { margin: 1px; padding: 3px; font: 12px verdana,arial; background: #FFFFFF; color: #000000; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px;}';
|
||||
|
||||
@ -176,11 +176,9 @@ if ($conf->global->MAIN_SMARTY)
|
||||
$smarty->template_dir = DOL_DOCUMENT_ROOT."/core/templates/";
|
||||
}
|
||||
|
||||
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
||||
$conf->css = "/theme/".$conf->theme."/".$conf->theme.".css.php?lang=".$langs->defaultlang;
|
||||
|
||||
// Si feuille de style en php existe
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php?lang=".$langs->defaultlang;
|
||||
$smarty->assign('conf_css', DOL_URL_ROOT.'/'.$conf->css);
|
||||
$smarty->assign('conf_css', DOL_URL_ROOT.$conf->css);
|
||||
}
|
||||
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'))
|
||||
@ -218,7 +216,7 @@ if ($conf->global->MAIN_SMARTY)
|
||||
elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode($mysoc->logo);
|
||||
$width=96;
|
||||
$width=128;
|
||||
}
|
||||
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))
|
||||
{
|
||||
@ -265,9 +263,7 @@ if ($conf->global->MAIN_SMARTY)
|
||||
}
|
||||
else
|
||||
{
|
||||
$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";
|
||||
$conf->css = "/theme/".$conf->theme."/".$conf->theme.".css.php";
|
||||
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
|
||||
@ -279,7 +275,7 @@ else
|
||||
print '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'."\n";
|
||||
print '<meta name="robots" content="noindex,nofollow">'."\n"; // Evite indexation par robots
|
||||
print "<title>Dolibarr Authentification</title>\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/'.$conf->css.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.$conf->css.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
print '<style type="text/css">'."\n";
|
||||
print '<!--'."\n";
|
||||
print '#login {';
|
||||
@ -323,15 +319,7 @@ else
|
||||
$title='Dolibarr '.DOL_VERSION;
|
||||
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$conf->global->MAIN_APPLICATION_TITLE;
|
||||
print '<table class="login" summary="'.$title.'" cellpadding="0" cellspacing="0" border="0" align="center">'."\n";
|
||||
if (file_exists(DOL_DOCUMENT_ROOT.'/logo.png'))
|
||||
{
|
||||
print '<tr><td colspan="3" style="text-align:center;">';
|
||||
print '<img src="/logo.png"></td></tr>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr class="vmenu"><td align="center">'.$title.'</td></tr>'."\n";
|
||||
}
|
||||
print '<tr class="vmenu"><td align="center">'.$title.'</td></tr>'."\n";
|
||||
print '</table>'."\n";
|
||||
print '<br>'."\n";
|
||||
|
||||
@ -351,19 +339,10 @@ else
|
||||
|
||||
$title='';
|
||||
|
||||
// Show logo (search in order: small company logo, large company logo, theme logo, common logo)
|
||||
// Show lock logo
|
||||
$width=0;
|
||||
$urllogo=DOL_URL_ROOT.'/theme/login_logo.png';
|
||||
if (isset($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode('/thumbs/'.$mysoc->logo_small);
|
||||
}
|
||||
elseif (isset($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/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'))
|
||||
if (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_logo.png'))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_logo.png';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user