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
ab558f8e
Commit
ab558f8e
authored
9 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Use hooks (Multicompany)
parent
55cb103a
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/main.inc.php
+1
-32
1 addition, 32 deletions
htdocs/main.inc.php
with
1 addition
and
32 deletions
htdocs/main.inc.php
+
1
−
32
View file @
ab558f8e
...
...
@@ -578,7 +578,7 @@ if (! defined('NOLOGIN'))
exit
;
}
else
{
{
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager
->
initHooks
(
array
(
'main'
));
...
...
@@ -647,25 +647,6 @@ if (! defined('NOLOGIN'))
$db
->
commit
();
}
// Create entity cookie, just used for login page
// TODO Multicompany Move this into hook
if
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
!
empty
(
$conf
->
global
->
MULTICOMPANY_COOKIE_ENABLED
)
&&
isset
(
$_POST
[
"entity"
]))
{
include_once
DOL_DOCUMENT_ROOT
.
'/core/class/cookie.class.php'
;
$entity
=
$_SESSION
[
"dol_login"
]
.
'|'
.
$_POST
[
"entity"
];
$prefix
=
dol_getprefix
();
$entityCookieName
=
'DOLENTITYID_'
.
$prefix
;
// TTL : is defined in the config page multicompany
$ttl
=
(
!
empty
(
$conf
->
global
->
MULTICOMPANY_COOKIE_TTL
)
?
dol_now
()
+
$conf
->
global
->
MULTICOMPANY_COOKIE_TTL
:
dol_now
()
+
60
*
60
*
8
);
// Cryptkey : will be created randomly in the config page multicompany
$cryptkey
=
(
!
empty
(
$conf
->
file
->
cookie_cryptkey
)
?
$conf
->
file
->
cookie_cryptkey
:
''
);
$entityCookie
=
new
DolCookie
(
$cryptkey
);
$entityCookie
->
_setCookie
(
$entityCookieName
,
$entity
,
$ttl
);
}
// Hooks on successfull login
$action
=
''
;
$hookmanager
->
initHooks
(
array
(
'login'
));
...
...
@@ -831,18 +812,6 @@ else
$heightforframes
=
52
;
// Switch to another entity
// TODO Multicompany Remove this
if
(
!
empty
(
$conf
->
multicompany
->
enabled
)
&&
GETPOST
(
'action'
)
==
'switchentity'
)
{
if
(
$mc
->
switchEntity
(
GETPOST
(
'entity'
,
'int'
))
>
0
)
{
header
(
"Location: "
.
DOL_URL_ROOT
.
'/'
);
exit
;
}
}
// Init menu manager
if
(
!
defined
(
'NOREQUIREMENU'
))
{
...
...
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