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