Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-09-02 14:11:28 +02:00
commit c68ffdfcae
6 changed files with 160 additions and 194 deletions

View File

@ -34,6 +34,23 @@ print '<head>
print '<!-- Includes for JQuery (Ajax library) -->'."\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 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 else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js'; $ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz'; if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
@ -98,12 +115,14 @@ $(document).ready(function () {
<?php <?php
if (! empty($hookmanager->resArray['options'])) { if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $option) foreach ($hookmanager->resArray['options'] as $format => $option)
{ {
if ($format == 'table') {
echo '<!-- Option by hook -->'; echo '<!-- Option by hook -->';
echo $option; echo $option;
} }
} }
}
?> ?>
<?php if ($captcha) { ?> <?php if ($captcha) { ?>

View File

@ -34,11 +34,30 @@ print '<head>
print '<!-- Includes for JQuery (Ajax library) -->'."\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 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 else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
print '<!-- Includes JS for JQuery -->'."\n"; print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\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"; 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.'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />'."\n";
if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER;
print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' --> print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
</head>'; </head>';
@ -68,12 +87,17 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
<input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></td> <input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></td>
</tr> </tr>
<?php if ($select_entity) { ?> <?php
<tr><td valign="top" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('Entity'); ?></b> &nbsp; </td> if (! empty($hookmanager->resArray['options'])) {
<td valign="top" nowrap="nowrap"> foreach ($hookmanager->resArray['options'] as $format => $option)
<?php echo $select_entity; ?> {
</td></tr> if ($format == 'table') {
<?php } ?> echo '<!-- Option by hook -->';
echo $option;
}
}
}
?>
<?php if ($captcha) { ?> <?php if ($captcha) { ?>
<tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td> <tr><td valign="middle" nowrap="nowrap"> &nbsp; <b><?php echo $langs->trans('SecurityCode'); ?></b></td>

View File

@ -35,6 +35,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
session_cache_limiter(FALSE);
require_once '../../main.inc.php'; require_once '../../main.inc.php';

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2009-2010 Regis Houssin <regis@dolibarr.fr> /* Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -33,11 +33,31 @@ print '<head>
print '<!-- Includes for JQuery (Ajax library) -->'."\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 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 else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
print '<!-- Includes JS for JQuery -->'."\n"; print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\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"; 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.'" /> print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/dst.js"></script>'."\n";
print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />
<style type="text/css"> <style type="text/css">
<!-- <!--
#login { #login {
@ -61,140 +81,9 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
<!-- Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second --> <!-- Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second -->
<script type="text/javascript"> <script type="text/javascript">
function DisplayDstSwitchDates(firstsecond) $(document).ready(function () {
{
var year = new Date().getYear();
if (year < 1000) year += 1900;
var firstSwitch = 0;
var secondSwitch = 0;
var lastOffset = 99;
// Loop through every month of the current year
for (i = 0; i < 12; i++)
{
// Fetch the timezone value for the month
var newDate = new Date(Date.UTC(year, i, 0, 0, 0, 0, 0));
var tz = -1 * newDate.getTimezoneOffset() / 60;
// Capture when a timzezone change occurs
if (tz > lastOffset)
firstSwitch = i-1;
else if (tz < lastOffset)
secondSwitch = i-1;
lastOffset = tz;
}
// Go figure out date/time occurences a minute before
// a DST adjustment occurs
var secondDstDate = FindDstSwitchDate(year, secondSwitch);
var firstDstDate = FindDstSwitchDate(year, firstSwitch);
if (firstsecond == 'first') return firstDstDate;
if (firstsecond == 'second') return secondDstDate;
if (firstDstDate == null && secondDstDate == null)
return 'Daylight Savings is not observed in your timezone.';
else
return 'Last minute before DST change occurs in ' +
year + ': ' + firstDstDate + ' and ' + secondDstDate;
}
function FindDstSwitchDate(year, month)
{
// Set the starting date
var baseDate = new Date(Date.UTC(year, month, 0, 0, 0, 0, 0));
var changeDay = 0;
var changeMinute = -1;
var baseOffset = -1 * baseDate.getTimezoneOffset() / 60;
var dstDate;
// Loop to find the exact day a timezone adjust occurs
for (day = 0; day < 50; day++)
{
var tmpDate = new Date(Date.UTC(year, month, day, 0, 0, 0, 0));
var tmpOffset = -1 * tmpDate.getTimezoneOffset() / 60;
// Check if the timezone changed from one day to the next
if (tmpOffset != baseOffset)
{
var minutes = 0;
changeDay = day;
// Back-up one day and grap the offset
tmpDate = new Date(Date.UTC(year, month, day-1, 0, 0, 0, 0));
tmpOffset = -1 * tmpDate.getTimezoneOffset() / 60;
// Count the minutes until a timezone chnage occurs
while (changeMinute == -1)
{
tmpDate = new Date(Date.UTC(year, month, day-1, 0, minutes, 0, 0));
tmpOffset = -1 * tmpDate.getTimezoneOffset() / 60;
// Determine the exact minute a timezone change
// occurs
if (tmpOffset != baseOffset)
{
// Back-up a minute to get the date/time just
// before a timezone change occurs
tmpOffset = new Date(Date.UTC(year, month,
day-1, 0, minutes-1, 0, 0));
changeMinute = minutes;
break;
}
else
minutes++;
}
// Add a month (for display) since JavaScript counts
// months from 0 to 11
dstDate = tmpOffset.getMonth() + 1;
// Pad the month as needed
if (dstDate < 10) dstDate = "0" + dstDate;
// Add the day and year
dstDate = year + '-' + dstDate + '-' + tmpOffset.getDate() + 'T';
// Capture the time stamp
tmpDate = new Date(Date.UTC(year, month,
day-1, 0, minutes-1, 0, 0));
dstDate += tmpDate.toTimeString().split(' ')[0] + 'Z';
return dstDate;
}
}
}
jQuery(document).ready(function () {
// Set focus on correct field // Set focus on correct field
<?php if ($focus_element) { ?>jQuery('#<?php echo $focus_element; ?>').focus(); <?php } ?> // Warning to use this only on visible element <?php if ($focus_element) { ?>$('#<?php echo $focus_element; ?>').focus(); <?php } ?> // Warning to use this only on visible element
// Detect and save TZ and DST
var rightNow = new Date();
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
var temp = jan1.toGMTString();
var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
var june1 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);
temp = june1.toGMTString();
var june2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);
var dst;
if (std_time_offset == daylight_time_offset) {
dst = "0"; // daylight savings time is NOT observed
} else {
dst = "1"; // daylight savings time is observed
}
var dst_first=DisplayDstSwitchDates('first');
var dst_second=DisplayDstSwitchDates('second');
//alert(dst);
jQuery('#tz').val(std_time_offset); // returns TZ
jQuery('#dst_observed').val(dst); // returns if DST is observed on summer
jQuery('#dst_first').val(dst_first); // returns DST first switch in year
jQuery('#dst_second').val(dst_second); // returns DST second switch in year
// Detect and save screen resolution
jQuery('#screenwidth').val(jQuery(window).width()); // returns width of browser viewport
jQuery('#screenheight').val(jQuery(window).height()); // returns width of browser viewport
}); });
</script> </script>
@ -203,11 +92,14 @@ jQuery(document).ready(function () {
<input type="hidden" name="loginfunction" value="loginfunction" /> <input type="hidden" name="loginfunction" value="loginfunction" />
<!-- Add fields to send local user information --> <!-- Add fields to send local user information -->
<input type="hidden" name="tz" id="tz" value="" /> <input type="hidden" name="tz" id="tz" value="" />
<input type="hidden" name="tz_string" id="tz_string" value="" />
<input type="hidden" name="dst_observed" id="dst_observed" value="" /> <input type="hidden" name="dst_observed" id="dst_observed" value="" />
<input type="hidden" name="dst_first" id="dst_first" value="" /> <input type="hidden" name="dst_first" id="dst_first" value="" />
<input type="hidden" name="dst_second" id="dst_second" value="" /> <input type="hidden" name="dst_second" id="dst_second" value="" />
<input type="hidden" name="screenwidth" id="screenwidth" value="" /> <input type="hidden" name="screenwidth" id="screenwidth" value="" />
<input type="hidden" name="screenheight" id="screenheight" value="" /> <input type="hidden" name="screenheight" id="screenheight" value="" />
<input type="hidden" name="dol_hide_topmenu" id="dol_hide_topmenu" value="" />
<input type="hidden" name="dol_hide_leftmenu" id="dol_hide_leftmenu" value="" />
<div id="infoVersion"><?php echo $title; ?></div> <div id="infoVersion"><?php echo $title; ?></div>
@ -220,9 +112,17 @@ jQuery(document).ready(function () {
<div id="logBox"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong><input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo GETPOST('username')?GETPOST('username'):$login; ?>" tabindex="1" /></div> <div id="logBox"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong><input type="text" id="username" name="username" class="flat" size="15" maxlength="40" value="<?php echo GETPOST('username')?GETPOST('username'):$login; ?>" tabindex="1" /></div>
<div id="passBox"><strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong><input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo $password; ?>" tabindex="2" /></div> <div id="passBox"><strong><label for="password"><?php echo $langs->trans('Password'); ?></label></strong><input id="password" name="password" class="flat" type="password" size="15" maxlength="30" value="<?php echo $password; ?>" tabindex="2" /></div>
<?php if ($select_entity) { ?> <?php
<div><strong><?php echo $langs->trans('Entity'); ?></strong><?php echo $select_entity; ?></div> if (! empty($hookmanager->resArray['options'])) {
<?php } ?> foreach ($hookmanager->resArray['options'] as $format => $option)
{
if ($format == 'div') {
echo '<!-- Option by hook -->';
echo $option;
}
}
}
?>
<?php if ($captcha) { ?> <?php if ($captcha) { ?>
<div class="captchaBox"> <div class="captchaBox">

View File

@ -34,11 +34,30 @@ print '<head>
print '<!-- Includes for JQuery (Ajax library) -->'."\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 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 else print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/css/'.$jquerytheme.'/jquery-ui-latest.custom.css" />'."\n"; // JQuery
// CSS forced by modules (relative url starting with /)
if (isset($conf->modules_parts['css']))
{
$arraycss=(array) $conf->modules_parts['css'];
foreach($arraycss as $modcss => $filescss)
{
$filescss=(array) $filescss; // To be sure filecss is an array
foreach($filescss as $cssfile)
{
// cssfile is a relative path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '"><!-- Added by module '.$modcss. '-->'."\n";
}
}
}
// JQuery. Must be before other includes // JQuery. Must be before other includes
$ext='.js';
if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz';
print '<!-- Includes JS for JQuery -->'."\n"; print '<!-- Includes JS for JQuery -->'."\n";
if (constant('JS_JQUERY')) print '<script type="text/javascript" src="'.JS_JQUERY.'jquery.min.js"></script>'."\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"; 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.'" />'."\n"; print '<link rel="stylesheet" type="text/css" href="'.dol_escape_htmltag($conf_css).'" />'."\n";
if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER;
print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' --> print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
</head>'; </head>';
@ -57,13 +76,22 @@ print '<!-- HTTP_USER_AGENT = '.$_SERVER['HTTP_USER_AGENT'].' -->
</div> </div>
<div id="parameterBox"> <div id="parameterBox">
<div id="logBox"><strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong><input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" /></div> <div id="logBox">
<strong><label for="username"><?php echo $langs->trans('Login'); ?></label></strong>
<?php if ($select_entity) { ?> <input type="text" <?php echo $disabled; ?> id="username" name="username" class="flat" size="15" maxlength="25" value="<?php echo $login; ?>" tabindex="1" />
<div><?php echo $langs->trans('Entity'); ?> &nbsp;
<?php echo $select_entity; ?>
</div> </div>
<?php } ?>
<?php
if (! empty($hookmanager->resArray['options'])) {
foreach ($hookmanager->resArray['options'] as $format => $option)
{
if ($format == 'div') {
echo '<!-- Option by hook -->';
echo $option;
}
}
}
?>
<?php if ($captcha) { ?> <?php if ($captcha) { ?>
<div class="captchaBox"> <div class="captchaBox">

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2008-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2008-2011 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -27,7 +27,8 @@ define("NOLOGIN",1); // This means this output page does not require to be logge
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
if ($conf->ldap->enabled) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->ldap->enabled))
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
$langs->load("errors"); $langs->load("errors");
$langs->load("users"); $langs->load("users");
@ -42,7 +43,7 @@ if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)
exit; exit;
} }
$action=GETPOST('action'); $action=GETPOST('action', 'alpha');
$mode=$dolibarr_main_authentication; $mode=$dolibarr_main_authentication;
if (! $mode) $mode='http'; if (! $mode) $mode='http';
@ -50,6 +51,14 @@ $username = GETPOST('username');
$passwordmd5 = GETPOST('passwordmd5'); $passwordmd5 = GETPOST('passwordmd5');
$conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1); $conf->entity = (GETPOST('entity') ? GETPOST('entity') : 1);
// Instantiate hooks of thirdparty module only if not already define
if (! is_object($hookmanager))
{
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($db);
}
$hookmanager->initHooks(array('passwordforgottenpage'));
/** /**
* Actions * Actions
@ -167,6 +176,9 @@ else
$conf->css = "/theme/".$conf->theme."/style.css.php?lang=".$langs->defaultlang; $conf->css = "/theme/".$conf->theme."/style.css.php?lang=".$langs->defaultlang;
$conf_css = DOL_URL_ROOT.$conf->css; $conf_css = DOL_URL_ROOT.$conf->css;
$jquerytheme = 'smoothness';
if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png')) if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'))
{ {
$login_background = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_background.png'; $login_background = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_background.png';
@ -196,39 +208,16 @@ elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.
{ {
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=companylogo&amp;file='.urlencode($mysoc->logo); $urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=companylogo&amp;file='.urlencode($mysoc->logo);
$width=128; $width=128;
}elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png')) }
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'))
{ {
$urllogo=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png'; $urllogo=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/dolibarr_logo.png';
}elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) }
elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png'))
{ {
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png'; $urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
} }
// Entity combobox
$select_entity='';
if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_HIDE_LOGIN_COMBOBOX) && ! $disabled)
{
$rowspan++;
$lastuser='';
$lastentity = GETPOST('entity');
if (! empty($conf->global->MULTICOMPANY_COOKIE_ENABLED))
{
$prefix=dol_getprefix();
$entityCookieName = 'DOLENTITYID_'.$prefix;
if (isset($_COOKIE[$entityCookieName]))
{
include_once DOL_DOCUMENT_ROOT . '/core/class/cookie.class.php';
$lastuser = ''; $lastentity = '';
$entityCookie = new DolCookie($conf->file->cookie_cryptkey);
$cookieValue = $entityCookie->_getCookie($entityCookieName);
list($lastuser, $lastentity) = explode('|', $cookieValue);
}
}
$select_entity = $mc->select_entities($lastentity, 'entity', ' tabindex="2"');
}
// Security graphical code // Security graphical code
if (function_exists("imagecreatefrompng") && ! $disabled) if (function_exists("imagecreatefrompng") && ! $disabled)
{ {
@ -236,6 +225,11 @@ if (function_exists("imagecreatefrompng") && ! $disabled)
$captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"'); $captcha_refresh = img_picto($langs->trans("Refresh"),'refresh','id="captcha_refresh_img"');
} }
// Execute hook getPasswordForgottenPageOptions
// Should be an array with differents options in $hookmanager->resArray
$parameters=array('entity' => GETPOST('entity','int'));
$hookmanager->executeHooks('getPasswordForgottenPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks
include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP include $template_dir.'passwordforgotten.tpl.php'; // To use native PHP
?> ?>