Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory
Commits
36e81538
Commit
36e81538
authored
6 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
fix(standAlonePage) Reworked constructor to use init() method as well
issue
#5854
parent
9e4d40a9
dev
6342-update-the-locales-for-1-5
6344-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen
6365-core-locking-mechanism-is-not-changing-the-mail-ressource-it-does-lock-the-mail-account
6365-core-when-lock-mechanism-is-trigger-the-user-should-not-be-editable-if-not-unlock
6378-orcid-test-method-is-wrong-and-break-orcid-saving
core-php8
master
fusiondirectory-1.5
fusiondirectory-1.4
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class_standAlonePage.inc
+41
-65
include/class_standAlonePage.inc
with
41 additions
and
65 deletions
+41
-65
include/class_standAlonePage.inc
+
41
−
65
View file @
36e81538
...
...
@@ -32,77 +32,55 @@ class standAlonePage {
$this
->
interactive
=
$interactive
;
if
(
$this
->
interactive
)
{
/* Destroy old session if exists.
Else you will get your old session back, if you not logged out correctly. */
session
::
destroy
();
session
::
start
();
/* Reset errors */
reset_errors
();
$config
=
$this
->
loadConfig
();
/* If SSL is forced, just forward to the SSL enabled site */
if
((
$config
->
get_cfg_value
(
'forcessl'
)
==
'TRUE'
)
&&
(
$ssl
!=
''
))
{
header
(
"Location:
$ssl
"
);
exit
;
}
static
::
securityHeaders
();
$this
->
setupSmarty
();
$smarty
=
get_smarty
();
/* Generate server list */
$servers
=
array
();
foreach
(
$config
->
data
[
'LOCATIONS'
]
as
$key
=>
$ignored
)
{
$servers
[
$key
]
=
$key
;
}
/* Destroy old session if exists.
Else you will get your old session back, if you not logged out correctly. */
session
::
destroy
();
session
::
start
();
$smarty
->
assign
(
'show_directory_chooser'
,
FALSE
);
$config
=
$this
->
loadConfig
(
);
if
(
isset
(
$_POST
[
'server'
]))
{
$this
->
directory
=
validate
(
$_POST
[
'server'
]);
}
elseif
(
isset
(
$_GET
[
'directory'
])
&&
isset
(
$servers
[
$_GET
[
'directory'
]]))
{
$this
->
directory
=
validate
(
$_GET
[
'directory'
]);
}
else
{
$this
->
directory
=
$config
->
data
[
'MAIN'
][
'DEFAULT'
];
/* Generate server list */
$servers
=
array
();
foreach
(
$config
->
data
[
'LOCATIONS'
]
as
$key
=>
$ignored
)
{
$servers
[
$key
]
=
$key
;
}
if
(
!
isset
(
$servers
[
$this
->
directory
]))
{
$this
->
directory
=
key
(
$servers
);
}
if
(
isset
(
$_POST
[
'server'
])
&&
isset
(
$servers
[
$_POST
[
'server'
]]))
{
$this
->
directory
=
validate
(
$_POST
[
'server'
]);
}
elseif
(
isset
(
$_GET
[
'directory'
])
&&
isset
(
$servers
[
$_GET
[
'directory'
]]))
{
$this
->
directory
=
validate
(
$_GET
[
'directory'
]);
}
else
{
$this
->
directory
=
$config
->
data
[
'MAIN'
][
'DEFAULT'
];
if
(
count
(
$servers
)
>
1
)
{
$smarty
->
assign
(
'show_directory_chooser'
,
TRUE
);
$smarty
->
assign
(
'server_options'
,
$servers
);
$smarty
->
assign
(
'server_id'
,
$this
->
directory
);
}
if
(
!
isset
(
$servers
[
$this
->
directory
]))
{
$this
->
directory
=
key
(
$servers
);
}
/* Set config to selected one */
$config
->
set_current
(
$this
->
directory
);
session
::
global_set
(
'config'
,
$config
);
}
/* Set config to selected one */
$config
->
set_current
(
$this
->
directory
);
session
::
global_set
(
'config'
,
$config
);
$this
->
activated
=
$this
->
readLdapConfig
();
if
(
!
$this
->
activated
)
{
/* Password recovery has been disabled */
if
(
!
$this
->
activated
)
{
/* This page has been disabled */
return
;
}
if
(
$this
->
interactive
)
{
Language
::
init
(
);
$ui
=
new
userinfoNoAuth
(
get_class
(
$this
));
session
::
global_set
(
'ui'
,
$ui
);
$ui
=
new
userinfoNoAuth
(
get_class
(
$this
));
session
::
global_set
(
'ui'
,
$ui
);
static
::
init
();
if
(
session
::
global_is_set
(
'plist'
))
{
session
::
global_un_set
(
'plist'
);
if
(
$this
->
interactive
)
{
$smarty
=
get_smarty
();
if
(
count
(
$servers
)
>
1
)
{
$smarty
->
assign
(
'show_directory_chooser'
,
TRUE
);
$smarty
->
assign
(
'server_options'
,
$servers
);
$smarty
->
assign
(
'server_id'
,
$this
->
directory
);
}
else
{
$smarty
->
assign
(
'show_directory_chooser'
,
FALSE
);
}
pluglist
::
load
();
$ssl
=
$this
->
checkForSSL
();
}
}
...
...
@@ -119,17 +97,15 @@ class standAlonePage {
$ui
=
session
::
global_get
(
'ui'
);
$config
=
session
::
global_get
(
'config'
);
/* If SSL is forced, just forward to the SSL enabled site */
if
((
$config
->
get_cfg_value
(
'forcessl'
)
==
'TRUE'
)
&&
(
$ssl
!=
''
))
{
header
(
"Location:
$ssl
"
);
exit
;
}
if
(
$this
->
interactive
)
{
timezone
::
setDefaultTimezoneFromConfig
();
timezone
::
setDefaultTimezoneFromConfig
();
Language
::
init
();
Language
::
init
();
$this
->
setupSmarty
();
}
$
this
->
setupSmarty
();
$
ssl
=
$this
->
checkForSSL
();
/* Prepare plugin list */
pluglist
::
load
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets