diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index c9ea31a7117..d1a8ae622f1 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -35,10 +35,12 @@ print ''."\n"; if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery else print ''."\n"; // JQuery // JQuery. Must be before other includes +$ext='.js'; +if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz'; print ''."\n"; if (constant('JS_JQUERY')) print ''."\n"; else print ''."\n"; -print ''."\n"; +print ''."\n"; if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; print ' '; @@ -68,12 +70,15 @@ print ' id="username" name="username" class="flat" size="15" maxlength="25" value="" tabindex="1" /> - -   trans('Entity'); ?>   - - - - +resArray['options'])) { + foreach ($hookmanager->resArray['options'] as $option) + { + echo ''; + echo $option; + } +} +?>   trans('SecurityCode'); ?> diff --git a/htdocs/theme/bureau2crea/tpl/passwordforgotten.tpl.php b/htdocs/theme/bureau2crea/tpl/passwordforgotten.tpl.php index 283959138c0..956263634e4 100644 --- a/htdocs/theme/bureau2crea/tpl/passwordforgotten.tpl.php +++ b/htdocs/theme/bureau2crea/tpl/passwordforgotten.tpl.php @@ -35,10 +35,12 @@ print ''."\n"; if (constant('JS_JQUERY_UI')) print ''."\n"; // JQuery else print ''."\n"; // JQuery // JQuery. Must be before other includes +$ext='.js'; +if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x01)) $ext='.jgz'; print ''."\n"; if (constant('JS_JQUERY')) print ''."\n"; else print ''."\n"; -print ''."\n"; +print ''."\n"; if (! empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER; print ' '; @@ -59,11 +61,15 @@ print '
id="username" name="username" class="flat" size="15" maxlength="25" value="" tabindex="1" />
- -
trans('Entity'); ?>   - -
- + resArray['options'])) { + foreach ($hookmanager->resArray['options'] as $option) + { + echo ''; + echo $option; + } + } + ?>
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 2b7cc2c66b1..b1de66d6a96 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -1,7 +1,7 @@ - * Copyright (C) 2008-2011 Regis Houssin - * Copyright (C) 2008-2011 Juanjo Menent +/* Copyright (C) 2007-2011 Laurent Destailleur + * Copyright (C) 2008-2012 Regis Houssin + * Copyright (C) 2008-2011 Juanjo Menent * * 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 @@ -27,7 +27,8 @@ define("NOLOGIN",1); // This means this output page does not require to be logge require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.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("users"); @@ -42,7 +43,7 @@ if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK) exit; } -$action=GETPOST('action'); +$action=GETPOST('action', 'alpha'); $mode=$dolibarr_main_authentication; if (! $mode) $mode='http'; @@ -50,6 +51,14 @@ $username = GETPOST('username'); $passwordmd5 = GETPOST('passwordmd5'); $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 @@ -204,31 +213,6 @@ elseif (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output. $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 if (function_exists("imagecreatefrompng") && ! $disabled) { @@ -236,6 +220,11 @@ if (function_exists("imagecreatefrompng") && ! $disabled) $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 ?> \ No newline at end of file