2009-06-30 09:22:30 +00:00
|
|
|
<?php
|
2009-06-30 09:29:51 +00:00
|
|
|
/**
|
2009-06-30 08:05:37 +00:00
|
|
|
* Deletes a DN and presents a "job's done" message.
|
|
|
|
*
|
2009-06-30 09:29:51 +00:00
|
|
|
* @package phpLDAPadmin
|
2009-07-01 06:09:17 +00:00
|
|
|
* @subpackage Page
|
2009-06-30 09:29:51 +00:00
|
|
|
*/
|
2009-07-01 06:09:17 +00:00
|
|
|
|
2009-06-30 09:29:51 +00:00
|
|
|
/**
|
2009-06-30 08:05:37 +00:00
|
|
|
*/
|
|
|
|
|
2009-06-30 09:29:51 +00:00
|
|
|
require './common.php';
|
2009-06-30 08:05:37 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
# The DNs we are working with
|
|
|
|
$request = array();
|
|
|
|
$request['dn'] = get_request('dn','REQUEST',true);
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
if (! $app['server']->dnExists($request['dn']))
|
|
|
|
error(sprintf('%s (%s)',_('No such entry.'),'<b>'.pretty_print_dn($request['dn']).'</b>'),'error','index.php');
|
2009-06-30 08:05:37 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
# Delete the entry.
|
|
|
|
$result = $app['server']->delete($request['dn']);
|
2009-06-30 09:29:51 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
if ($result)
|
2009-06-30 10:46:00 +00:00
|
|
|
system_message(array(
|
|
|
|
'title'=>_('Delete DN'),
|
2009-07-01 06:09:17 +00:00
|
|
|
'body'=>_('Successfully deleted DN ').sprintf('<b>%s</b>',$request['dn']),
|
2009-06-30 10:46:00 +00:00
|
|
|
'type'=>'info'),
|
2009-07-01 06:09:17 +00:00
|
|
|
sprintf('index.php?server_id=%s',$app['server']->getIndex()));
|
|
|
|
else
|
2009-06-30 11:52:55 +00:00
|
|
|
system_message(array(
|
2009-07-01 06:09:17 +00:00
|
|
|
'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($request['dn'])),
|
|
|
|
'body'=>ldap_error_msg($app['server']->getErrorMessage(null),$app['server']->getErrorNum(null)),
|
2009-06-30 11:52:55 +00:00
|
|
|
'type'=>'error'));
|
2009-06-30 09:29:51 +00:00
|
|
|
?>
|