'; foreach ($DN2 as $dn) echo ''; echo '
'; echo ''; ?>
'; if ($type) { $DN2 = explode(";", str_replace("\'", '',$DN)); echo ''; echo ''; switch ($type) { case 'user': echo _('Do you really want to delete user(s):'); break; case 'host': echo _('Do you really want to delete host(s):'); break; case 'group': echo _('Do you really want to delete group(s):'); break; } echo '
'.$dn.'
'; } if ($delete_yes) { $DN = str_replace("\'", '',$DN); $DN2 = explode(";", str_replace("\\", '',$DN)); foreach ($DN2 as $dn) { switch ($type5) { 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 host: ').$dn; break; case 'group': $result = ldap_search($_SESSION['ldap']->server(), $dn, 'objectClass=*'); if (!$result) $error = _('Could not delete group: ').$dn; $entry = ldap_first_entry($_SESSION['ldap']->server(), $result); $attr = ldap_get_attributes($_SESSION['ldap']->server(), $entry); if ($attr['memberUid']) $error = _('Could not delete group. Still users in group: ').$dn; else { $success = ldap_delete($_SESSION['ldap']->server(), $dn); if (!$success) $error = _('Could not delete user: ').$dn; } break; } if (!$error) echo $dn. _(' deleted.'); else echo $error; echo '
'; } } if ($delete_no) echo _('Nothing was deleted.'); echo '