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
ca28aa77
Commit
ca28aa77
authored
12 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: multicompany transverse mode compatibility
parent
e9de1230
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/user/class/user.class.php
+7
-4
7 additions, 4 deletions
htdocs/user/class/user.class.php
with
7 additions
and
4 deletions
htdocs/user/class/user.class.php
+
7
−
4
View file @
ca28aa77
...
@@ -512,7 +512,7 @@ class User extends CommonObject
...
@@ -512,7 +512,7 @@ class User extends CommonObject
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"user_rights as ur"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"user_rights as ur"
;
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"rights_def as r"
;
$sql
.
=
", "
.
MAIN_DB_PREFIX
.
"rights_def as r"
;
$sql
.
=
" WHERE r.id = ur.fk_id"
;
$sql
.
=
" WHERE r.id = ur.fk_id"
;
$sql
.
=
" AND r.entity IN (0,"
.
(
!
empty
(
$conf
->
multicompany
->
transverse_mode
)
?
"1,"
:
""
)
.
$conf
->
entity
.
")"
;
$sql
.
=
" AND r.entity IN (0,"
.
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
!
empty
(
$conf
->
multicompany
->
transverse_mode
)
?
"1,"
:
""
)
.
$conf
->
entity
.
")"
;
$sql
.
=
" AND ur.fk_user= "
.
$this
->
id
;
$sql
.
=
" AND ur.fk_user= "
.
$this
->
id
;
$sql
.
=
" AND r.perms IS NOT NULL"
;
$sql
.
=
" AND r.perms IS NOT NULL"
;
if
(
$moduletag
)
$sql
.
=
" AND r.module = '"
.
$this
->
db
->
escape
(
$moduletag
)
.
"'"
;
if
(
$moduletag
)
$sql
.
=
" AND r.module = '"
.
$this
->
db
->
escape
(
$moduletag
)
.
"'"
;
...
@@ -557,11 +557,14 @@ class User extends CommonObject
...
@@ -557,11 +557,14 @@ class User extends CommonObject
$sql
.
=
" "
.
MAIN_DB_PREFIX
.
"usergroup_user as gu,"
;
$sql
.
=
" "
.
MAIN_DB_PREFIX
.
"usergroup_user as gu,"
;
$sql
.
=
" "
.
MAIN_DB_PREFIX
.
"rights_def as r"
;
$sql
.
=
" "
.
MAIN_DB_PREFIX
.
"rights_def as r"
;
$sql
.
=
" WHERE r.id = gr.fk_id"
;
$sql
.
=
" WHERE r.id = gr.fk_id"
;
if
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
!
empty
(
$conf
->
multicompany
->
transverse_mode
))
{
$sql
.
=
" AND gu.entity IN (0,"
.
$conf
->
entity
.
")"
;
}
else
{
$sql
.
=
" AND r.entity = "
.
$conf
->
entity
;
}
$sql
.
=
" AND gr.fk_usergroup = gu.fk_usergroup"
;
$sql
.
=
" AND gr.fk_usergroup = gu.fk_usergroup"
;
$sql
.
=
" AND gu.fk_user = "
.
$this
->
id
;
$sql
.
=
" AND gu.fk_user = "
.
$this
->
id
;
$sql
.
=
" AND r.perms IS NOT NULL"
;
$sql
.
=
" AND r.perms IS NOT NULL"
;
$sql
.
=
" AND r.entity = "
.
$conf
->
entity
;
$sql
.
=
" AND gu.entity IN (0,"
.
$conf
->
entity
.
")"
;
if
(
$moduletag
)
$sql
.
=
" AND r.module = '"
.
$this
->
db
->
escape
(
$moduletag
)
.
"'"
;
if
(
$moduletag
)
$sql
.
=
" AND r.module = '"
.
$this
->
db
->
escape
(
$moduletag
)
.
"'"
;
dol_syslog
(
get_class
(
$this
)
.
'::getrights sql='
.
$sql
,
LOG_DEBUG
);
dol_syslog
(
get_class
(
$this
)
.
'::getrights sql='
.
$sql
,
LOG_DEBUG
);
...
@@ -1418,7 +1421,7 @@ class User extends CommonObject
...
@@ -1418,7 +1421,7 @@ class User extends CommonObject
}
}
if
(
!
empty
(
$dolibarr_main_force_https
)
if
(
!
empty
(
$dolibarr_main_force_https
)
||
(
!
empty
(
$_SERVER
[
"HTTPS"
])
&&
$_SERVER
[
"HTTPS"
]
==
'on'
))
$urlwithouturlroot
=
preg_replace
(
'/http:/i'
,
'https:'
,
$urlwithouturlroot
);
||
(
!
empty
(
$_SERVER
[
"HTTPS"
])
&&
$_SERVER
[
"HTTPS"
]
==
'on'
))
$urlwithouturlroot
=
preg_replace
(
'/http:/i'
,
'https:'
,
$urlwithouturlroot
);
// TODO Use outputlangs to translate messages
// TODO Use outputlangs to translate messages
if
(
!
$changelater
)
if
(
!
$changelater
)
{
{
...
...
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