'."\n". '
'."\n". '
'."\n". '
'."\n". ''."\n". '
'."\n". '
'."\n"; if ($_GET['type']) { //$DN2 = explode(";", str_replace("\'", '',$_GET['DN'])); echo '
'; switch ($_GET['type']) { case 'user': echo "
"; echo _('Delete user(s)'); echo "
\n"; echo '
'._('Do you really want to delete user(s):').'
'; break; case 'host': echo "
"; echo _('Delete host(s)'); echo "
\n"; echo '
'._('Do you really want to delete host(s):').'
'); break; case 'group': echo "
"; echo _('Delete group(s)'); echo "
\n"; echo '
'._('Do you really want to delete group(s):').'
'); break; } echo "
\n"; echo "
\n"; foreach ($delete_dn as $dn) echo '
'.$dn.'
'; echo "
\n"; if (($_GET['type']== user) && $config_intern->scriptServer) { echo "
\n"; echo "
\n"; echo '
'; echo _('Delete also Homedirectories'); echo '
'."\n".'
'. '
'."\n"; echo "
\n"; } echo "
\n"; echo '
'. '
'. '
'; echo "
\n"; } if ($_POST['delete_yes'] && !$_POST['backmain']) { switch ($_POST['type5']) { case 'user': echo "
"; echo _('Deleting user(s)...'); echo "
\n"; break; case 'host': echo "
"; echo _('Deleting host(s)...'); echo "
\n"; break; case 'group': echo "
"; echo _('Deleting group(s)...'); echo "
\n"; break; } echo "
\n"; echo '
'; foreach ($delete_dn as $dn) { switch ($_POST['type5']) { case 'user': $temp=explode(',', $dn); $username = str_replace('uid=', '', $temp[0]); if ($config_intern->scriptServer) { if ($_POST['f_rem_home']) remhomedir($username); remquotas($username, $_POST['type5']); } $result = ldap_search($ldap_intern->server(), $config_intern->get_GroupSuffix(), 'objectClass=PosixGroup', array('memberUid')); $entry = ldap_first_entry($ldap_intern->server(), $result); while ($entry) { $attr2 = ldap_get_attributes($ldap_intern->server(), $entry); if ($attr2['memberUid']) { array_shift($attr2['memberUid']); foreach ($attr2['memberUid'] as $nam) { if ($nam==$username) { $todelete['memberUid'] = $nam; $success = ldap_mod_del($ldap_intern->server(), ldap_get_dn($ldap_intern->server(), $entry) ,$todelete); } } } $entry = ldap_next_entry($ldap_intern->server(), $entry); } $success = ldap_delete($ldap_intern->server(), $dn); if (!$success) $error = _('Could not delete user:').' '.$dn; break; case 'host': $success = ldap_delete($ldap_intern->server(), $dn); if (!$success) $error = _('Could not delete host:').' '.$dn; break; case 'group': $temp=explode(',', $dn); $groupname = str_replace('cn=', '', $temp[0]); $result = ldap_search($ldap_intern->server(), $dn, 'objectClass=*', array('gidNumber')); $entry = ldap_first_entry($ldap_intern->server(), $result); while ($entry) { $attr2 = ldap_get_attributes($ldap_intern->server(), $entry); if ($attr2['gidNumber']==getgid($groupname)) $error = _('Could not delete group. Still users in group:').' '.$dn; $entry = ldap_next_entry($ldap_intern->server(), $entry); } if (!$error) { if ($config_intern->scriptServer) remquotas($groupname, $_POST['type5']); $success = ldap_delete($ldap_intern->server(), $dn); if (!$success) $error = _('Could not delete group:').' '.$dn; } break; } if (!$error) echo "
$dn ". _('deleted').".
\n"; else echo "
$error
\n"; } echo "
\n"; switch ($_POST['type5']) { case 'user': echo '
'; break; case 'group': echo '
'; break; case 'host': echo '
'; break; } echo "
\n"; } if ($_POST['delete_no']) { switch ($_POST['type5']) { case 'user': echo "
"; echo _('Deleting user(s) canceled.'); echo "
\n"; echo _('No user(s) were deleted'); echo "
"; echo '
'; echo "
\n"; break; case 'host': echo "
"; echo _('Deleting host(s) canceled.'); echo "
\n"; echo _('No host(s) were deleted'); echo "
"; echo '
'; echo "
\n"; break; case 'group': echo "
"; echo _('Deleting group(s) canceled.'); echo "
\n"; echo _('No group(s) were deleted'); echo "
"; echo '
'; echo "
\n"; break; } } echo '