forked from Wavyzz/dolibarr
Fix minor
This commit is contained in:
@@ -80,7 +80,8 @@ function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmod
|
||||
$newdir=dol_osencode($dir);
|
||||
|
||||
// Check if file found (do not use dol_is_file to avoid loading files.lib.php)
|
||||
if (is_file($newdir.'/'.$authfile)) $fullauthfile=$newdir.'/'.$authfile;
|
||||
$tmpnewauthfile = $newdir.(preg_match('/\/$/',$newdir)?'':'/').$authfile;
|
||||
if (is_file($tmpnewauthfile)) $fullauthfile=$tmpnewauthfile;
|
||||
}
|
||||
|
||||
$result=false;
|
||||
@@ -89,7 +90,7 @@ function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmod
|
||||
{
|
||||
// Call function to check user/password
|
||||
$function='check_user_password_'.$mode;
|
||||
$login=call_user_func($function,$usertotest,$passwordtotest,$entitytotest);
|
||||
$login=call_user_func($function, $usertotest, $passwordtotest, $entitytotest);
|
||||
if ($login) // Login is successfull
|
||||
{
|
||||
$test=false; // To stop once at first login success
|
||||
|
||||
@@ -33,9 +33,12 @@
|
||||
*/
|
||||
function check_user_password_empty($usertotest,$passwordtotest,$entitytotest)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
dol_syslog("functions_empty::check_user_password_empty usertotest=".$usertotest);
|
||||
|
||||
$login='';
|
||||
$_SESSION["dol_loginmesg"]=$langs->trans("FailedToLogin");
|
||||
|
||||
return $login;
|
||||
}
|
||||
|
||||
@@ -244,9 +244,9 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if (! empty($_SESSION['dol_loginmesg']))
|
||||
<?php
|
||||
// Show error message if defined
|
||||
if (! empty($_SESSION['dol_loginmesg']))
|
||||
{
|
||||
?>
|
||||
<div class="center login_main_message"><div class="error">
|
||||
|
||||
@@ -210,8 +210,11 @@ if (! empty($_POST["DOL_AUTOSET_COOKIE"]))
|
||||
if (empty($cookievalue)) unset($_COOKIE[$cookiename]);
|
||||
}
|
||||
|
||||
|
||||
// Init session. Name of session is specific to Dolibarr instance.
|
||||
// Note: the function dol_getprefix have been redefined to manage another area to protect with a different cookie.
|
||||
$prefix=dol_getprefix('');
|
||||
|
||||
$sessionname='DOLSESSID_'.$prefix;
|
||||
$sessiontimeout='DOLSESSTIMEOUT_'.$prefix;
|
||||
if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
|
||||
@@ -375,12 +378,19 @@ $login='';
|
||||
if (! defined('NOLOGIN'))
|
||||
{
|
||||
// $authmode lists the different means of identification to be tested in order of preference.
|
||||
// Example: 'http', 'dolibarr', 'ldap', 'http,forceuser'
|
||||
// Example: 'http', 'dolibarr', 'ldap', 'http,forceuser', '...'
|
||||
|
||||
if (defined('MAIN_AUTHENTICATION_MODE'))
|
||||
{
|
||||
$dolibarr_main_authentication = constant('MAIN_AUTHENTICATION_MODE');
|
||||
}
|
||||
else
|
||||
{
|
||||
// Authentication mode
|
||||
if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication='http,dolibarr';
|
||||
// Authentication mode: forceuser
|
||||
if ($dolibarr_main_authentication == 'forceuser' && empty($dolibarr_auto_user)) $dolibarr_auto_user='auto';
|
||||
}
|
||||
// Set authmode
|
||||
$authmode=explode(',',$dolibarr_main_authentication);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class modMyModule extends DolibarrModules
|
||||
// for specific css file (eg: /mymodule/css/mymodule.css.php)
|
||||
$this->module_parts = array(
|
||||
'triggers' => 1, // Set this to 1 if module has its own trigger directory (core/triggers)
|
||||
'login' => 0, // Set this to 1 if module has its own login method directory (core/login)
|
||||
'login' => 0, // Set this to 1 if module has its own login method file (core/login)
|
||||
'substitutions' => 1, // Set this to 1 if module has its own substitution function file (core/substitutions)
|
||||
'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus)
|
||||
'theme' => 0, // Set this to 1 if module has its own theme directory (theme)
|
||||
|
||||
Reference in New Issue
Block a user