show 389ds deactivation status in account list

This commit is contained in:
Roland Gruber 2016-05-14 13:28:22 +02:00
parent bbf6d31827
commit 016025fe2d
1 changed files with 20 additions and 7 deletions

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2005 - 2015 Roland Gruber Copyright (C) 2005 - 2016 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -808,6 +808,7 @@ class lamUserList extends lamList {
$attrs[] = 'sambaAcctFlags'; $attrs[] = 'sambaAcctFlags';
$attrs[] = 'userPassword'; $attrs[] = 'userPassword';
$attrs[] = 'userAccountControl'; $attrs[] = 'userAccountControl';
$attrs[] = 'nsAccountLock';
$attrs[] = 'objectClass'; $attrs[] = 'objectClass';
} }
return $attrs; return $attrs;
@ -866,15 +867,13 @@ class lamUserList extends lamList {
$sambaAvailable = self::isSambaAvailable($attrs); $sambaAvailable = self::isSambaAvailable($attrs);
$ppolicyAvailable = self::isPPolicyAvailable($attrs); $ppolicyAvailable = self::isPPolicyAvailable($attrs);
$windowsAvailable = self::isWindowsAvailable($attrs); $windowsAvailable = self::isWindowsAvailable($attrs);
if (!$unixAvailable && !$sambaAvailable && !$ppolicyAvailable && !$windowsAvailable) {
return;
}
$unixLocked = self::isUnixLocked($attrs); $unixLocked = self::isUnixLocked($attrs);
$sambaLocked = self::isSambaLocked($attrs); $sambaLocked = self::isSambaLocked($attrs);
$ppolicyLocked = self::isPPolicyLocked($attrs); $ppolicyLocked = self::isPPolicyLocked($attrs);
$windowsLocked = self::isWindowsLocked($attrs); $windowsLocked = self::isWindowsLocked($attrs);
$partiallyLocked = $unixLocked || $sambaLocked || $ppolicyLocked || $windowsLocked; $is389dsDeactivated = self::is389dsDeactivated($attrs);
$fullyLocked = ($unixAvailable || $sambaAvailable || $ppolicyAvailable || $windowsAvailable) $partiallyLocked = $unixLocked || $sambaLocked || $ppolicyLocked || $windowsLocked || $is389dsDeactivated;
$fullyLocked = ($unixAvailable || $sambaAvailable || $ppolicyAvailable || $windowsAvailable || $is389dsDeactivated)
&& (!$unixAvailable || $unixLocked) && (!$unixAvailable || $unixLocked)
&& (!$sambaAvailable || $sambaLocked) && (!$sambaAvailable || $sambaLocked)
&& (!$ppolicyAvailable || $ppolicyLocked) && (!$ppolicyAvailable || $ppolicyLocked)
@ -887,7 +886,7 @@ class lamUserList extends lamList {
$icon = 'partiallyLocked.png'; $icon = 'partiallyLocked.png';
} }
// print icon and detail tooltips // print icon and detail tooltips
if ($unixAvailable || $sambaAvailable || $ppolicyAvailable || $windowsAvailable) { if ($unixAvailable || $sambaAvailable || $ppolicyAvailable || $windowsAvailable || $is389dsDeactivated) {
$tipContent = '<table border=0>'; $tipContent = '<table border=0>';
// Unix // Unix
if ($unixAvailable) { if ($unixAvailable) {
@ -921,6 +920,10 @@ class lamUserList extends lamList {
} }
$tipContent .= '<tr><td>' . _('Windows') . '&nbsp;&nbsp;</td><td><img height=16 width=16 src=&quot;../../graphics/' . $windowsIcon . '&quot;></td></tr>'; $tipContent .= '<tr><td>' . _('Windows') . '&nbsp;&nbsp;</td><td><img height=16 width=16 src=&quot;../../graphics/' . $windowsIcon . '&quot;></td></tr>';
} }
// 389 deactivation
if ($is389dsDeactivated) {
$tipContent .= '<tr><td>' . _('Deactivated') . '&nbsp;&nbsp;</td><td><img height=16 width=16 src=&quot;../../graphics/lock.png&quot;></td></tr>';
}
$tipContent .= '</table>'; $tipContent .= '</table>';
echo '<img helptitle="' . _('Account status') . '" helpdata="' . $tipContent . '" alt="status" height=16 width=16 src="../../graphics/' . $icon . '">'; echo '<img helptitle="' . _('Account status') . '" helpdata="' . $tipContent . '" alt="status" height=16 width=16 src="../../graphics/' . $icon . '">';
} }
@ -1009,6 +1012,16 @@ class lamUserList extends lamList {
return windowsUser::isDeactivated($attrs); return windowsUser::isDeactivated($attrs);
} }
/**
* Returns if deactivated by nsAccountLock.
*
* @param array $attrs LDAP attributes
* @return boolean account is deactivated
*/
public static function is389dsDeactivated(&$attrs) {
return (isset($attrs['nsaccountlock'][0]) && ($attrs['nsaccountlock'][0] == 'true'));
}
} }
?> ?>