Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
425a853e
Commit
425a853e
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
- New: Match other auth system: Login can be done entering login or
user email (this open the road for SSO).
parent
6bac7447
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+2
-0
2 additions, 0 deletions
ChangeLog
htdocs/core/login/functions_dolibarr.php
+9
-7
9 additions, 7 deletions
htdocs/core/login/functions_dolibarr.php
htdocs/main.inc.php
+1
-0
1 addition, 0 deletions
htdocs/main.inc.php
with
12 additions
and
7 deletions
ChangeLog
+
2
−
0
View file @
425a853e
...
...
@@ -5,6 +5,8 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* *****
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: Increase length of thirdparty to 128 chars.
- New: "Is Order shippable" icon #1975.
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/login/functions_dolibarr.php
+
9
−
7
View file @
425a853e
<?php
/* Copyright (C) 2007-20
08
Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-20
14
Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
*
...
...
@@ -20,7 +20,7 @@
/**
* \file htdocs/core/login/functions_dolibarr.php
* \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=
{
// 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"
;
$usernamecol
=
'login'
;
$usernamecol1
=
'login'
;
$usernamecol2
=
'email'
;
$entitycol
=
'entity'
;
$sql
=
'SELECT rowid, entity, pass, pass_crypted'
;
$sql
=
'SELECT rowid,
login,
entity, pass, pass_crypted'
;
$sql
.
=
' FROM '
.
$table
;
$sql
.
=
' WHERE '
.
$usernamecol
.
" = '"
.
$db
->
escape
(
$usertotest
)
.
"'"
;
$sql
.
=
' AND '
.
$entitycol
.
" IN (0,"
.
(
$entity
?
$entity
:
1
)
.
")"
;
$sql
.
=
' WHERE ('
.
$usernamecol1
.
" = '"
.
$db
->
escape
(
$usertotest
)
.
"'"
;
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
);
$resql
=
$db
->
query
(
$sql
);
...
...
@@ -106,7 +108,7 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
// Password ok ?
if
(
$passok
)
{
$login
=
$
usertotest
;
$login
=
$
obj
->
login
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/main.inc.php
+
1
−
0
View file @
425a853e
...
...
@@ -1414,6 +1414,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$loginhtmltext
.
=
'<u>'
.
$langs
->
trans
(
"User"
)
.
'</u>'
;
$loginhtmltext
.
=
'<br><b>'
.
$langs
->
trans
(
"Name"
)
.
'</b>: '
.
$user
->
getFullName
(
$langs
);
$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
);
$type
=
(
$user
->
societe_id
?
$langs
->
trans
(
"External"
)
.
$company
:
$langs
->
trans
(
"Internal"
));
$loginhtmltext
.
=
'<br><b>'
.
$langs
->
trans
(
"Type"
)
.
'</b>: '
.
$type
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment