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
550d95fa
Unverified
Commit
550d95fa
authored
4 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
fix(login) Use new Error classes in login methods
issue #6071
parent
cf826461
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/errors/class_FusionDirectoryWarning.inc
+30
-0
include/errors/class_FusionDirectoryWarning.inc
include/login/class_LoginMethod.inc
+7
-6
include/login/class_LoginMethod.inc
with
37 additions
and
6 deletions
+37
-6
include/errors/class_FusionDirectoryWarning.inc
0 → 100644
+
30
−
0
View file @
550d95fa
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2019-2020 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*! \class FusionDirectoryWarning
*/
class
FusionDirectoryWarning
extends
FusionDirectoryError
{
public
function
computeMsgDialogParameters
():
array
{
return
[
_
(
'Warning'
),
$this
->
htmlMessage
,
WARNING_DIALOG
,
static
::
formatTrace
(
$this
)];
}
}
This diff is collapsed.
Click to expand it.
include/login/class_LoginMethod.inc
+
7
−
6
View file @
550d95fa
...
...
@@ -36,7 +36,7 @@ class LoginMethod
}
/*! \brief Runs schemaCheck if activated in configuration */
static
function
runSchemaCheck
()
static
function
runSchemaCheck
()
:
bool
{
global
$config
;
if
(
$config
->
get_cfg_value
(
'schemaCheck'
)
!=
'TRUE'
)
{
...
...
@@ -51,9 +51,10 @@ class LoginMethod
foreach
(
$str
as
$tr
)
{
if
(
!
$tr
[
'STATUS'
])
{
if
(
$tr
[
'IS_MUST_HAVE'
])
{
return
htmlescape
(
_
(
'LDAP schema check reported errors:'
))
.
'<br/><br/><i>'
.
htmlescape
(
$tr
[
'MSG'
])
.
'</i>'
;
throw
new
FusionDirectoryError
(
htmlescape
(
_
(
'LDAP schema check reported errors:'
))
.
'<br/><br/><i>'
.
htmlescape
(
$tr
[
'MSG'
])
.
'</i>'
)
;
}
else
{
msg_dialog
::
display
(
_
(
'LDAP schema error'
),
htmlescape
(
$tr
[
'MSG'
]),
WARNING_DIALOG
);
$warning
=
new
FusionDirectoryWarning
(
nl2br
(
htmlescape
(
sprintf
(
_
(
"LDAP schema error:
\n
%s"
),
$tr
[
'MSG'
]))));
$warning
->
display
();
}
}
}
...
...
@@ -81,7 +82,7 @@ class LoginMethod
/*! \brief Check username for invalid characters and check password is not empty
* Also trims username */
static
function
validateUserInput
()
static
function
validateUserInput
()
:
bool
{
global
$message
,
$smarty
;
static
::
$username
=
trim
(
static
::
$username
);
...
...
@@ -97,7 +98,7 @@ class LoginMethod
}
/*! \brief Performs an LDAP bind with $username and $password */
static
function
ldapLoginUser
()
static
function
ldapLoginUser
()
:
bool
{
global
$ui
,
$config
,
$message
,
$smarty
;
/* Login as user, initialize user ACL's */
...
...
@@ -116,7 +117,7 @@ class LoginMethod
}
/*! \brief Called after successful login, return FALSE if account is expired */
static
function
loginAndCheckExpired
()
static
function
loginAndCheckExpired
()
:
bool
{
global
$ui
,
$config
,
$plist
,
$message
,
$smarty
;
...
...
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