changed toe expected dataformat
This commit is contained in:
parent
26fb38cb0f
commit
4102d605b1
|
@ -24,6 +24,8 @@ $Id$
|
||||||
*/
|
*/
|
||||||
include_once('../lib/ldap.inc');
|
include_once('../lib/ldap.inc');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo '<html><head><title>';
|
echo '<html><head><title>';
|
||||||
echo _('Delete Account');
|
echo _('Delete Account');
|
||||||
echo '</title>
|
echo '</title>
|
||||||
|
@ -35,28 +37,31 @@ echo '</title>
|
||||||
<table rules="all" class="delete" width="100%">
|
<table rules="all" class="delete" width="100%">
|
||||||
<tr><td>';
|
<tr><td>';
|
||||||
|
|
||||||
if ($DN && $type)
|
if ($type) {
|
||||||
foreach ($DN as $dn) {
|
$DN = split("[\?&]", $QUERY_STRING]);
|
||||||
$dn = str_replace("\'", '',$dn);
|
array_shift($DN);
|
||||||
switch ($type) {
|
foreach ($DN as $dn) {
|
||||||
case 'user':
|
$dn = str_replace("\'", '',$dn);
|
||||||
$success = ldap_delete($_SESSION['ldap']->server(), $dn);
|
|
||||||
if (!$success) $error = _('Could not delete user: ').$dn;
|
|
||||||
break;
|
|
||||||
case 'host':
|
|
||||||
$success = ldap_delete($_SESSION['ldap']->server(), $dn);
|
|
||||||
if (!$success) $error = _('Could not delete user: ').$dn;
|
|
||||||
break;
|
|
||||||
case 'group':
|
|
||||||
$entry = ldap_read($_SESSION['ldap']->server(), $dn, "");
|
|
||||||
if (!$entry) $error = _('Could not delete group: ').$dn;
|
|
||||||
$attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
|
|
||||||
if ($attr['memberUid']) $error = _('Could not delete group. Still users in group: ').$dn;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (!$error) echo $dn. _('deleted.');
|
|
||||||
echo '</td></tr><tr><td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
switch ($type) {
|
||||||
|
case 'user':
|
||||||
|
$success = ldap_delete($_SESSION['ldap']->server(), $dn);
|
||||||
|
if (!$success) $error = _('Could not delete user: ').$dn;
|
||||||
|
break;
|
||||||
|
case 'host':
|
||||||
|
$success = ldap_delete($_SESSION['ldap']->server(), $dn);
|
||||||
|
if (!$success) $error = _('Could not delete user: ').$dn;
|
||||||
|
break;
|
||||||
|
case 'group':
|
||||||
|
$entry = ldap_read($_SESSION['ldap']->server(), $dn, "");
|
||||||
|
if (!$entry) $error = _('Could not delete group: ').$dn;
|
||||||
|
$attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry);
|
||||||
|
if ($attr['memberUid']) $error = _('Could not delete group. Still users in group: ').$dn;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!$error) echo $dn. _('deleted.');
|
||||||
|
echo '</td></tr><tr><td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
echo '</form></body></html>';
|
echo '</form></body></html>';
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue