isReadOnly()) error(_('You cannot perform updates while server is in read-only mode'),'error','index.php'); $entry = array(); $entry['dn']['string'] = get_request('dn','GET'); $entry['dn']['html'] = htmlspecialchars($entry['dn']['string']); # We search all children, not only the visible children in the tree $entry['children'] = $ldapserver->getContainerContents($entry['dn']['string'],0,'(objectClass=*)',LDAP_DEREF_NEVER); printf('

'._('Delete %s').'

',htmlspecialchars(get_rdn($entry['dn']['string']))); printf('

%s: %s     %s: %s

', _('Server'),$ldapserver->name,_('Distinguished Name'),$entry['dn']['html']); echo "\n"; echo '
'; if (count($entry['children'])) { printf('%s

',_('Permanently delete all children also?')); # Get the total number of child objects (whole sub-tree) $search['entries'] = $ldapserver->search(null,dn_escape($entry['dn']['string']),'objectClass=*',array('dn')); $search['count'] = count($search['entries']); $search['href'] = htmlspecialchars(sprintf('cmd.php?cmd=search&search=true&;server_id=%s&filter=%s&base_dn=%s&form=advanced&scope=sub', $ldapserver->server_id,rawurlencode('objectClass=*'),rawurlencode($entry['dn']['string']))); echo ''; echo ''; echo ''; echo ''; printf('', sprintf(_('phpLDAPadmin can recursively delete this entry and all %s of its children. See below for a list of all the entries that this action will delete. Do you want to do this?'),$search['count']-1)); echo ''; printf('', _('Note: this is potentially very dangerous and you do this at your own risk. This operation cannot be undone. Take into consideration aliases, referrals, and other things that may cause problems.')); echo "\n"; echo ''; echo ''; echo ''; echo ''; echo "\n"; echo '
'; printf(_('This entry is the root of a sub-tree containing %s entries.'),$search['count']); printf(' (%s)', $search['href'],_('view entries')); echo '
 
%s
 
%s
'; echo '
'; echo ''; printf('',htmlspecialchars($entry['dn']['string'])); printf('',$ldapserver->server_id); printf('',sprintf(_('Delete all %s objects'),$search['count'])); echo '
'; echo '
'; echo '
'; echo ''; printf('',htmlspecialchars($entry['dn']['string'])); printf('',$ldapserver->server_id); printf('',_('Cancel')); echo '
'; echo '
'; echo "\n"; echo '

'; echo _('List of entries to be deleted:'); echo '
'; printf(''; echo "\n"; } else { echo ''; printf('',_('Are you sure you want to permanently delete this object?')); echo ''; printf('',_('Server'),htmlspecialchars($ldapserver->name)); printf('', _('Distinguished Name'),_('DN'),$entry['dn']['string']); echo ''; echo "\n"; echo ''; echo ''; echo ''; echo ''; echo '
%s
 
%s:%s
%s%s
 
'; echo '
'; echo ''; printf('',htmlspecialchars($entry['dn']['string'])); printf('',$ldapserver->server_id); printf('',_('Delete')); echo '
'; echo '
'; echo '
'; echo ''; printf('',htmlspecialchars($entry['dn']['string'])); printf('',$ldapserver->server_id); printf('',_('Cancel')); echo '
'; echo '
'; echo "\n"; } echo '
'; echo '
'; ?>