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
50de4b6b
Commit
50de4b6b
authored
Oct 28, 2014
by
Côme Bernigaud
Committed by
Benoit Mortier
Oct 28, 2014
Browse files
Fixes #3397 Applying default ppolicy if no other
parent
d911208c
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/personal/password/class_password.inc
View file @
50de4b6b
...
...
@@ -209,9 +209,21 @@ class password extends plugin
$ldap
=
$config
->
get_ldap_link
();
$ldap
->
cat
(
$user
,
array
(
'pwdPolicySubentry'
,
'pwdHistory'
,
'pwdChangedTime'
));
$attrs
=
$ldap
->
fetch
();
$ppolicydn
=
''
;
if
(
isset
(
$attrs
[
'pwdPolicySubentry'
]))
{
$ldap
->
cat
(
$attrs
[
'pwdPolicySubentry'
],
array
(
'pwdAllowUserChange'
,
'pwdMinLength'
,
'pwdMinAge'
,
'pwdSafeModify'
));
$ppolicydn
=
$attrs
[
'pwdPolicySubentry'
];
}
else
{
$ppolicydn
=
$config
->
get_cfg_value
(
'ppolicyDefaultCn'
,
''
);
if
(
!
empty
(
$ppolicydn
))
{
$ppolicydn
=
'cn='
.
$ppolicydn
.
','
.
get_ou
(
'ppolicyRDN'
)
.
$config
->
current
[
'BASE'
];
}
}
if
(
!
empty
(
$ppolicydn
))
{
$ldap
->
cat
(
$ppolicydn
,
array
(
'pwdAllowUserChange'
,
'pwdMinLength'
,
'pwdMinAge'
,
'pwdSafeModify'
));
$policy
=
$ldap
->
fetch
();
if
(
!
$policy
)
{
return
sprintf
(
_
(
'Ppolicy "%s" could not be found in the LDAP!'
),
$ppolicydn
);
}
if
(
isset
(
$policy
[
'pwdAllowUserChange'
])
&&
(
$policy
[
'pwdAllowUserChange'
]
==
'FALSE'
)
&&
(
$ui
->
dn
==
$user
))
{
return
_
(
'You are not allowed to change your own password'
);
}
...
...
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