_('No entry was selected to delete'), 'body'=>_('No entry was selected to delete'), 'type'=>'warn'),'index.php'); if (! is_array($request['dn'])) $request['dn'] = array($request['dn']); $request['children'] = array(); $request['parent'] = array(); foreach ($request['dn'] as $dn) { # Check if the entry exists. if (! $dn || ! $app['server']->dnExists($dn)) system_message(array( 'title'=>_('Entry does not exist'), 'body'=>sprintf('%s (%s/%s)',_('The entry does not exist and will be ignored'),$dn), 'type'=>'error')); # We search all children, not only the visible children in the tree if (! in_array_ignore_case($dn,$request['children'])) { $request['children'] = array_merge($request['children'],$app['server']->getContainerContents($dn,null,0,'(objectClass=*)',LDAP_DEREF_NEVER)); array_push($request['parent'],$dn); } } printf('

%s

',_('Mass delete')); echo "\n"; echo '
'; echo ''; if (count($request['parent']) == 1) printf('',_('Are you sure you want to permanently delete this object?')); else printf('',_('Are you sure you want to permanently delete these objects?')); foreach ($request['parent'] as $dn) printf('', _('DN'),_('DN'),$dn); echo ''; $request['delete'] = $request['parent']; if (count($request['children'])) { printf('',_('Permanently delete all children also?')); echo ''; # We need to see if the children have children $query = array(); $query['scope'] = 'sub'; $query['attrs'] = array('dn'); $query['size_limit'] = 0; $query['deref'] = LDAP_DEREF_NEVER; $request['search'] = array(); foreach ($request['children'] as $dn) { $query['base'] = $dn; $request['search'] = array_merge($request['search'],$app['server']->query($query,null)); } foreach ($request['search'] as $value) array_push($request['delete'],$value['dn']); echo ''; echo ''; printf('',_('List of entries to be deleted:')); echo ''; $i = 0; echo ''; echo "\n"; echo ''; } echo ''; echo ''; echo ''; echo ''; echo "\n"; echo '
%s
%s
%s%s
 
%s
 
'; printf(_('This request also includes %s children entries.'),count($request['children'])); echo '
%s
 
'; printf(''; echo '
 
'; echo '
'; echo ''; printf('',$app['server']->getIndex()); foreach ($request['parent'] as $dn) printf('',htmlspecialchars($dn)); printf('',sprintf(_('Delete all %s objects'),count($request['delete']))); echo '
'; echo '
'; echo '
'; echo ''; printf('',$app['server']->getIndex()); printf('',_('Cancel')); echo '
'; echo '
'; echo '
'; echo '
'; ?>