Skip to content
Snippets Groups Projects
Commit e53157b2 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

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

parents a46a6ccc 425a853e
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,8 @@ English Dolibarr ChangeLog ...@@ -5,6 +5,8 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* ***** ***** ChangeLog for 3.7 compared to 3.6.* *****
For users: For users:
- New: Match other auth system: Login can be done entering login or user
email (this open the road for SSO).
- New: Agenda export by project #1967. - New: Agenda export by project #1967.
- New: Increase length of thirdparty to 128 chars. - New: Increase length of thirdparty to 128 chars.
- New: "Is Order shippable" icon #1975. - New: "Is Order shippable" icon #1975.
......
<?php <?php
/* Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2007-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2007-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* *
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/** /**
* \file htdocs/core/login/functions_dolibarr.php * \file htdocs/core/login/functions_dolibarr.php
* \ingroup core * \ingroup core
* \brief Authentication functions for Dolibarr mode * \brief Authentication functions for Dolibarr mode (check user on login or email and check pass)
*/ */
...@@ -50,13 +50,15 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= ...@@ -50,13 +50,15 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
{ {
// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko // If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
$table = MAIN_DB_PREFIX."user"; $table = MAIN_DB_PREFIX."user";
$usernamecol = 'login'; $usernamecol1 = 'login';
$usernamecol2 = 'email';
$entitycol = 'entity'; $entitycol = 'entity';
$sql ='SELECT rowid, entity, pass, pass_crypted'; $sql ='SELECT rowid, login, entity, pass, pass_crypted';
$sql.=' FROM '.$table; $sql.=' FROM '.$table;
$sql.=' WHERE '.$usernamecol." = '".$db->escape($usertotest)."'"; $sql.=' WHERE ('.$usernamecol1." = '".$db->escape($usertotest)."'";
$sql.=' AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")"; if (preg_match('/@/',$usertotest)) $sql.=' OR '.$usernamecol2." = '".$db->escape($usertotest)."'";
$sql.=') AND '.$entitycol." IN (0," . ($entity ? $entity : 1) . ")";
dol_syslog("functions_dolibarr::check_user_password_dolibarr", LOG_DEBUG); dol_syslog("functions_dolibarr::check_user_password_dolibarr", LOG_DEBUG);
$resql=$db->query($sql); $resql=$db->query($sql);
...@@ -106,7 +108,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest= ...@@ -106,7 +108,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
// Password ok ? // Password ok ?
if ($passok) if ($passok)
{ {
$login=$usertotest; $login=$obj->login;
} }
else else
{ {
......
...@@ -1414,6 +1414,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a ...@@ -1414,6 +1414,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$loginhtmltext.='<u>'.$langs->trans("User").'</u>'; $loginhtmltext.='<u>'.$langs->trans("User").'</u>';
$loginhtmltext.='<br><b>'.$langs->trans("Name").'</b>: '.$user->getFullName($langs); $loginhtmltext.='<br><b>'.$langs->trans("Name").'</b>: '.$user->getFullName($langs);
$loginhtmltext.='<br><b>'.$langs->trans("Login").'</b>: '.$user->login; $loginhtmltext.='<br><b>'.$langs->trans("Login").'</b>: '.$user->login;
$loginhtmltext.='<br><b>'.$langs->trans("EMail").'</b>: '.$user->email;
$loginhtmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin); $loginhtmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
$type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal")); $type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
$loginhtmltext.='<br><b>'.$langs->trans("Type").'</b>: '.$type; $loginhtmltext.='<br><b>'.$langs->trans("Type").'</b>: '.$type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment