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
3651f540
Commit
3651f540
authored
6 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
ambulance: fix(standAlonePage) Fixes in directory_chooser handling, should fix a PHP error
issue #5854
parent
ab06a1fc
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
+36
-27
include/class_standAlonePage.inc
with
36 additions
and
27 deletions
+36
-27
include/class_standAlonePage.inc
+
36
−
27
View file @
3651f540
...
...
@@ -21,6 +21,7 @@
/* base class for passwordRecovery and such classes handling requests on their own */
class
standAlonePage
{
protected
$directories
;
protected
$directory
;
protected
$activated
;
protected
$interactive
;
...
...
@@ -38,45 +39,43 @@ class standAlonePage {
session
::
start
();
$config
=
$this
->
loadConfig
();
session
::
global_set
(
'config'
,
$config
);
/* Generate server list */
$
server
s
=
array
();
$
this
->
directorie
s
=
array
();
foreach
(
$config
->
data
[
'LOCATIONS'
]
as
$key
=>
$ignored
)
{
$
server
s
[
$key
]
=
$key
;
$
this
->
directorie
s
[
$key
]
=
$key
;
}
if
(
isset
(
$_POST
[
'server'
])
&&
isset
(
$servers
[
$_POST
[
'server'
]]))
{
$ui
=
new
userinfoNoAuth
(
get_class
(
$this
));
session
::
global_set
(
'ui'
,
$ui
);
static
::
init
();
}
function
checkDirectoryChooser
()
{
global
$config
;
$olddirectory
=
$this
->
directory
;
if
(
isset
(
$_POST
[
'server'
])
&&
isset
(
$this
->
directories
[
$_POST
[
'server'
]]))
{
$this
->
directory
=
validate
(
$_POST
[
'server'
]);
}
elseif
(
isset
(
$_GET
[
'directory'
])
&&
isset
(
$
server
s
[
$_GET
[
'directory'
]]))
{
}
elseif
(
isset
(
$_GET
[
'directory'
])
&&
isset
(
$
this
->
directorie
s
[
$_GET
[
'directory'
]]))
{
$this
->
directory
=
validate
(
$_GET
[
'directory'
]);
}
else
{
}
else
if
(
empty
(
$this
->
directory
))
{
$this
->
directory
=
$config
->
data
[
'MAIN'
][
'DEFAULT'
];
if
(
!
isset
(
$
server
s
[
$this
->
directory
]))
{
$this
->
directory
=
key
(
$
server
s
);
if
(
!
isset
(
$
this
->
directorie
s
[
$this
->
directory
]))
{
$this
->
directory
=
key
(
$
this
->
directorie
s
);
}
}
/* Set config to selected one */
$config
->
set_current
(
$this
->
directory
);
session
::
global_set
(
'config'
,
$config
);
if
(
$this
->
directory
!=
$olddirectory
)
{
/* Set config to selected one */
$config
->
set_current
(
$this
->
directory
);
$this
->
activated
=
$this
->
readLdapConfig
();
$ui
=
new
userinfoNoAuth
(
get_class
(
$this
));
session
::
global_set
(
'ui'
,
$ui
);
static
::
init
();
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
);
}
$this
->
activated
=
$this
->
readLdapConfig
();
}
}
...
...
@@ -84,6 +83,8 @@ class standAlonePage {
{
global
$config
,
$ssl
,
$ui
;
static
::
checkDirectoryChooser
();
reset_errors
();
static
::
securityHeaders
();
...
...
@@ -159,6 +160,14 @@ class standAlonePage {
$smarty
->
assign
(
'must'
,
'<span class="must">*</span>'
);
$smarty
->
assign
(
'usePrototype'
,
'FALSE'
);
$smarty
->
assign
(
'CSRFtoken'
,
CSRFProtection
::
getToken
());
if
(
count
(
$this
->
directories
)
>
1
)
{
$smarty
->
assign
(
'show_directory_chooser'
,
TRUE
);
$smarty
->
assign
(
'server_options'
,
$this
->
directories
);
$smarty
->
assign
(
'server_id'
,
$this
->
directory
);
}
else
{
$smarty
->
assign
(
'show_directory_chooser'
,
FALSE
);
}
}
function
assignSmartyVars
()
...
...
@@ -222,7 +231,7 @@ class standAlonePage {
$pageURL
=
$protocol
.
'://'
;
$pageURL
.
=
$host
;
if
(
$port
!=
'80'
)
{
if
(
((
$protocol
==
'http'
)
&&
(
$port
!=
'80'
))
||
((
$protocol
==
'https'
)
&&
(
$port
!=
'443'
))
)
{
$pageURL
.
=
':'
.
$port
;
}
if
(
empty
(
$_SERVER
[
'PATH_INFO'
]))
{
...
...
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