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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
7e246961
Commit
7e246961
authored
12 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Change-Id: I5f8bcf59cf2fc0d902edb4d61f8c20a2880765a2
parent
ba459532
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/core/lib/security2.lib.php
+1
-1
1 addition, 1 deletion
htdocs/core/lib/security2.lib.php
htdocs/core/login/functions_dolibarr.php
+13
-2
13 additions, 2 deletions
htdocs/core/login/functions_dolibarr.php
htdocs/user/class/user.class.php
+1
-1
1 addition, 1 deletion
htdocs/user/class/user.class.php
with
15 additions
and
4 deletions
htdocs/core/lib/security2.lib.php
+
1
−
1
View file @
7e246961
...
@@ -54,7 +54,7 @@ function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmod
...
@@ -54,7 +54,7 @@ function checkLoginPassEntity($usertotest,$passwordtotest,$entitytotest,$authmod
global
$conf
,
$langs
;
global
$conf
,
$langs
;
//global $dolauthmode; // To return authentication finally used
//global $dolauthmode; // To return authentication finally used
// Check parame
e
trs
// Check paramet
e
rs
if
(
$entitytotest
==
''
)
$entitytotest
=
1
;
if
(
$entitytotest
==
''
)
$entitytotest
=
1
;
dol_syslog
(
"checkLoginPassEntity usertotest="
.
$usertotest
.
" entitytotest="
.
$entitytotest
.
" authmode="
.
join
(
','
,
$authmode
));
dol_syslog
(
"checkLoginPassEntity usertotest="
.
$usertotest
.
" entitytotest="
.
$entitytotest
.
" authmode="
.
join
(
','
,
$authmode
));
...
...
This diff is collapsed.
Click to expand it.
htdocs/core/login/functions_dolibarr.php
+
13
−
2
View file @
7e246961
...
@@ -36,9 +36,14 @@
...
@@ -36,9 +36,14 @@
function
check_user_password_dolibarr
(
$usertotest
,
$passwordtotest
,
$entitytotest
=
1
)
function
check_user_password_dolibarr
(
$usertotest
,
$passwordtotest
,
$entitytotest
=
1
)
{
{
global
$db
,
$conf
,
$langs
;
global
$db
,
$conf
,
$langs
;
global
$mc
;
dol_syslog
(
"functions_dolibarr::check_user_password_dolibarr usertotest="
.
$usertotest
);
dol_syslog
(
"functions_dolibarr::check_user_password_dolibarr usertotest="
.
$usertotest
);
// Force master entity in transversal mode
$entity
=
$entitytotest
;
if
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
!
empty
(
$conf
->
multicompany
->
transverse_mode
))
$entity
=
1
;
$login
=
''
;
$login
=
''
;
if
(
!
empty
(
$usertotest
))
if
(
!
empty
(
$usertotest
))
...
@@ -48,10 +53,10 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
...
@@ -48,10 +53,10 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
$usernamecol
=
'login'
;
$usernamecol
=
'login'
;
$entitycol
=
'entity'
;
$entitycol
=
'entity'
;
$sql
=
'SELECT pass, pass_crypted'
;
$sql
=
'SELECT
rowid, entity,
pass, pass_crypted'
;
$sql
.
=
' FROM '
.
$table
;
$sql
.
=
' FROM '
.
$table
;
$sql
.
=
' WHERE '
.
$usernamecol
.
" = '"
.
$db
->
escape
(
$usertotest
)
.
"'"
;
$sql
.
=
' WHERE '
.
$usernamecol
.
" = '"
.
$db
->
escape
(
$usertotest
)
.
"'"
;
$sql
.
=
' AND '
.
$entitycol
.
" IN (0,"
.
(
$entity
totest
?
$entity
totest
:
1
)
.
")"
;
$sql
.
=
' AND '
.
$entitycol
.
" IN (0,"
.
(
$entity
?
$entity
:
1
)
.
")"
;
dol_syslog
(
"functions_dolibarr::check_user_password_dolibarr sql="
.
$sql
);
dol_syslog
(
"functions_dolibarr::check_user_password_dolibarr sql="
.
$sql
);
$resql
=
$db
->
query
(
$sql
);
$resql
=
$db
->
query
(
$sql
);
...
@@ -92,6 +97,12 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
...
@@ -92,6 +97,12 @@ function check_user_password_dolibarr($usertotest,$passwordtotest,$entitytotest=
}
}
}
}
if
(
$passok
&&
!
empty
(
$obj
->
entity
)
&&
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
!
empty
(
$conf
->
multicompany
->
transverse_mode
)))
{
$ret
=
$mc
->
checkRight
(
$obj
->
rowid
,
$entitytotest
);
if
(
$ret
<
0
)
$passok
=
false
;
}
// Password ok ?
// Password ok ?
if
(
$passok
)
if
(
$passok
)
{
{
...
...
This diff is collapsed.
Click to expand it.
htdocs/user/class/user.class.php
+
1
−
1
View file @
7e246961
...
@@ -150,7 +150,7 @@ class User extends CommonObject
...
@@ -150,7 +150,7 @@ class User extends CommonObject
$sql
.
=
" u.ref_int, u.ref_ext"
;
$sql
.
=
" u.ref_int, u.ref_ext"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"user as u"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"user as u"
;
if
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
$conf
->
entity
==
1
)
if
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
!
empty
(
$conf
->
multicompany
->
transverse_mode
)
)
{
{
$sql
.
=
" WHERE u.entity IS NOT NULL"
;
$sql
.
=
" WHERE u.entity IS NOT NULL"
;
}
}
...
...
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