getIndex(),get_request('template','REQUEST',false,'none')); $request['page']->setDN($request['dn']); $request['page']->accept(); $request['template'] = $request['page']->getTemplate(); # Check if the entry exists. if (! $request['dn'] || ! $app['server']->dnExists($request['dn'])) system_message(array( 'title'=>_('Entry does not exist'), 'body'=>sprintf(_('The entry (%s) does not exist.'),htmlspecialchars($request['dn'])), 'type'=>'error'),'index.php'); # We search all children, not only the visible children in the tree $request['children'] = $app['server']->getContainerContents($request['dn'],null,0,'(objectClass=*)',LDAP_DEREF_NEVER); printf('

%s %s

',_('Delete'),htmlspecialchars(htmlspecialchars(get_rdn($request['dn'])))); printf('

%s: %s

', _('DN'),htmlspecialchars($request['dn'])); echo "\n"; echo '
'; if (count($request['children'])) { printf('%s

',_('Permanently delete all children also?')); $search['href'] = htmlspecialchars(sprintf('cmd.php?cmd=query_engine&server_id=%s&filter=%s&base=%s&scope=sub&query=none&format=list&search=true', $app['server']->getIndex(),rawurlencode('objectClass=*'),rawurlencode($request['dn']))); $query = array(); $query['base'] = $request['dn']; $query['scope'] = 'sub'; $query['attrs'] = array('dn'); $query['size_limit'] = 0; $query['deref'] = LDAP_DEREF_NEVER; $request['search'] = $app['server']->query($query,null); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo "\n"; echo '
'; printf(_('This entry is the root of a sub-tree containing %s entries.'),count($request['search'])); printf(' (%s)', $search['href'],_('view entries')); echo '
 
'; echo '
'; echo ''; printf('',$app['server']->getIndex()); printf('',$request['template']->getDNEncode(false)); //@todo need to refresh the tree after a delete printf('', sprintf(_('Delete all %s objects'),count($request['search'])), (isAjaxEnabled() ? sprintf('onclick="return ajSUBMIT(\'BODY\',document.getElementById(\'delete_form\'),\'%s\');"',_('Deleting objects')) : '')); echo '
'; echo '
'; echo '
'; echo ''; printf('',$app['server']->getIndex()); printf('',$request['template']->getDNEncode(false)); printf('', _('Cancel'), (isAjaxEnabled() ? sprintf('onclick="return ajDISPLAY(\'BODY\',\'cmd=template_engine&server_id=%s&dn=%s\',\'%s\');"',$app['server']->getIndex(),$request['template']->getDNEncode(),_('Retrieving DN')) : '')); echo '
'; echo '
'; echo "\n"; echo '

'; echo _('List of entries to be deleted:'); echo '
'; $i = 0; printf(''; echo "\n"; } else { echo ''; printf('',_('Are you sure you want to permanently delete this object?')); echo ''; printf('',_('Server'),$app['server']->getName()); printf('', _('DN'),_('DN'),htmlspecialchars($request['dn'])); echo ''; echo "\n"; echo ''; echo ''; echo ''; echo ''; echo '
%s
 
%s:%s
%s%s
 
'; echo '
'; echo ''; printf('',$app['server']->getIndex()); printf('',$request['template']->getDNEncode(false)); //@todo need to refresh the tree after a delete printf('', _('Delete'), (isAjaxEnabled() ? sprintf('onclick="return ajSUBMIT(\'BODY\',document.getElementById(\'delete_form\'),\'%s\');"',_('Deleting objects')) : '')); echo '
'; echo '
'; echo '
'; echo ''; printf('',$app['server']->getIndex()); printf('',$request['template']->getDNEncode(false)); printf('', _('Cancel'), (isAjaxEnabled() ? sprintf('onclick="return ajDISPLAY(\'BODY\',\'cmd=template_engine&server_id=%s&dn=%s\',\'%s\');"',$app['server']->getIndex(),$request['template']->getDNEncode(),_('Retrieving DN')) : '')); echo '
'; echo '
'; echo "\n"; } echo '
'; echo '
'; ?>