From 4c105c7a40d8fbe188c2d33a8bdf58d4d0123271 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 24 Aug 2010 14:17:16 +0000 Subject: [PATCH] Add possibility to include login method in a module --- htdocs/includes/login/functions_empty.php | 42 +++++++++++++++++++++++ htdocs/main.inc.php | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 htdocs/includes/login/functions_empty.php diff --git a/htdocs/includes/login/functions_empty.php b/htdocs/includes/login/functions_empty.php new file mode 100644 index 00000000000..0539aa72c92 --- /dev/null +++ b/htdocs/includes/login/functions_empty.php @@ -0,0 +1,42 @@ + + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/includes/login/functions_empty.php + * \ingroup core + * \brief Empty authentication functions for test + * \version $Id$ + */ + + +/** + * \brief Check user and password + * \param usertotest Login + * \param passwordtotest Password + * \return string Login if ok, '' if ko. + */ +function check_user_password_empty($usertotest,$passwordtotest) +{ + dol_syslog("functions_empty::check_user_password_empty usertotest=".$usertotest); + + $login=''; + + return $login; +} + +?> \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 36f3cf56eff..2033d24404a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -287,7 +287,7 @@ if (! defined('NOLOGIN')) $authmode=explode(',',$dolibarr_main_authentication); // No authentication mode - if (! sizeof($authmode)) + if (! sizeof($authmode) && is_array($conf->login_method_modules) && !empty($conf->login_method_modules)) { $langs->load('main'); dol_print_error('',$langs->trans("ErrorConfigParameterNotDefined",'dolibarr_main_authentication'));