Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
86c58056
Commit
86c58056
authored
Mar 12, 2015
by
Côme Bernigaud
Committed by
Benoit Mortier
Mar 16, 2015
Browse files
Fixes #3397 Cleaned error handling of password change and lock
parent
a29c758e
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/functions.inc
View file @
86c58056
...
...
@@ -3073,16 +3073,17 @@ function change_password ($dn, $password, $mode = 0, $hash = "")
$ldap
->
modify
(
$attrs
);
/* Read ! if user was deactivated */
if
(
$deactivated
)
{
$test
->
lock_account
(
$config
,
$dn
);
}
new
log
(
"modify"
,
"user/passwordMethod"
,
$dn
,
array_keys
(
$attrs
),
$ldap
->
get_error
());
if
(
!
$ldap
->
success
())
{
msg_dialog
::
display
(
_
(
"LDAP error"
),
msgPool
::
ldaperror
(
$ldap
->
get_error
(),
$dn
,
LDAP_MOD
),
LDAP_ERROR
);
}
else
{
/* Re-add ! if user was deactivated */
if
(
$deactivated
)
{
if
(
!
$test
->
lock_account
(
$config
,
$dn
))
{
msg_dialog
::
display
(
_
(
'Error'
),
_
(
'Could not re-lock the account after password change'
),
ERROR_DIALOG
);
}
}
/* Run backend method for change/create */
if
(
!
$test
->
set_password
(
$password
))
{
...
...
include/password-methods/class_password-methods.inc
View file @
86c58056
...
...
@@ -191,7 +191,9 @@ class passwordMethod
// Call the password post-lock hook, if defined.
if
(
$ldap
->
success
())
{
$pwdClass
->
callHook
(
$pwdClass
,
'POST'
.
$mode
,
array
(),
$ret
);
$pwdClass
->
callHook
(
$pwdClass
,
'POST'
.
$mode
,
array
(),
$ret
);
}
else
{
msg_dialog
::
display
(
_
(
'LDAP error'
),
msgPool
::
ldaperror
(
$ldap
->
get_error
(),
$dn
,
LDAP_MOD
),
LDAP_ERROR
);
}
return
$ldap
->
success
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment