2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.28.2.1 2007/12/26 09:26:32 wurley Exp $
2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/rdelete.php,v 1.28.2.3 2008/12/12 12:20:22 wurley Exp $
5
5
* Recursively deletes the specified DN and all of its children
15
15
require './common.php';
17
17
if ($ldapserver->isReadOnly())
18
pla_error(_('You cannot perform updates while server is in read-only mode'));
20
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete', 'simple_delete'))
21
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')));
23
$entry['dn'] = $_POST['dn'];
18
error(_('You cannot perform updates while server is in read-only mode'),'error','index.php');
20
if (! $_SESSION[APPCONFIG]->isCommandAvailable('entry_delete','simple_delete'))
21
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('delete entry')),'error','index.php');
24
$entry['dn'] = get_request('dn');
24
25
if (! $entry['dn'])
25
pla_error(_('You must specify a DN'));
26
error(_('You must specify a DN'),'error','index.php');
27
28
if (! $ldapserver->dnExists($entry['dn']))
28
pla_error(sprintf(_('No such entry: %s'),htmlspecialchars($entry['dn'])));
29
error(sprintf('%s (%s)',_('No such entry.'),htmlspecialchars($entry['dn'])),'error','index.php');
30
31
printf('<h3 class="title">'._('Deleting %s').'</h3>',htmlspecialchars(get_rdn($entry['dn'])));
31
32
printf('<h3 class="subtitle">%s</h3>',_('Recursive delete progress'));
42
43
printf(_('Entry %s and sub-tree deleted successfully.'),'<b>'.htmlspecialchars($entry['dn']).'</b>');
45
pla_error(sprintf(_('Could not delete the entry: %s'),htmlspecialchars($entry['dn'])),
46
$ldapserver->error(),$ldapserver->errno());
47
'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
48
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
49
52
function pla_rdelete($ldapserver,$dn) {
63
pla_error(sprintf(_('Failed to delete entry %s'),htmlspecialchars($dn)),
64
$ldapserver->error(),$ldapserver->errno());
67
'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
68
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),
80
pla_error(sprintf(_('Failed to delete entry %s'),htmlspecialchars($dn)),
81
$ldapserver->error(),$ldapserver->errno());
86
'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($entry['dn'])),
87
'body'=>ldap_error_msg($ldapserver->error(),$ldapserver->errno()),