RELEASE 0.9.8
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.20 2005/07/22 05:47:44 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/delete_form.php,v 1.20.4.5 2005/12/11 08:21:03 wurley Exp $
|
||||
|
||||
/**
|
||||
* delete_form.php
|
||||
@@ -18,49 +18,43 @@
|
||||
require './common.php';
|
||||
|
||||
if ($ldapserver->isReadOnly())
|
||||
pla_error($lang['no_updates_in_read_only_mode']);
|
||||
pla_error(_('You cannot perform updates while server is in read-only mode'));
|
||||
if (! $ldapserver->haveAuthInfo())
|
||||
pla_error($lang['not_enough_login_info']);
|
||||
pla_error(_('Not enough information to login to server. Please check your configuration.'));
|
||||
|
||||
$dn = $_GET['dn'];
|
||||
|
||||
$encoded_dn = rawurlencode( $dn );
|
||||
$rdn = pla_explode_dn( $dn );
|
||||
$rdn = $rdn[0];
|
||||
$children = get_container_contents( $ldapserver,$dn,0,'(objectClass=*)',LDAP_DEREF_NEVER );
|
||||
$children = $ldapserver->getContainerContents($dn,0,'(objectClass=*)',LDAP_DEREF_NEVER);
|
||||
$has_children = count($children) > 0 ? true : false;
|
||||
|
||||
include './header.php'; ?>
|
||||
include './header.php';
|
||||
|
||||
<body>
|
||||
echo '<body>';
|
||||
printf('<h3 class="title">'._('Delete %s').'</h3>',htmlspecialchars(get_rdn($dn)));
|
||||
printf('<h3 class="subtitle">%s: <b>%s</b> %s: <b>%s</b></h3>',
|
||||
_('Server'),$ldapserver->name,_('Distinguished Name'),htmlspecialchars(($dn)));
|
||||
|
||||
<h3 class="title"><?php echo sprintf( $lang['delete_dn'], htmlspecialchars( $rdn ) ); ?></b></h3>
|
||||
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> <?php echo $lang['distinguished_name']; ?>: <b><?php echo htmlspecialchars( ( $dn ) ); ?></b></h3>
|
||||
|
||||
<?php if( $has_children ) { ?>
|
||||
|
||||
<center><b><?php echo $lang['permanently_delete_children']; ?></b><br /><br />
|
||||
|
||||
<?php
|
||||
if ($has_children) {
|
||||
echo '<center>';
|
||||
printf('<b>%s</b><br /><br />',_('Permanently delete all children also?'));
|
||||
flush();
|
||||
|
||||
# get the total number of child objects (whole sub-tree)
|
||||
$s = pla_ldap_search( $ldapserver, 'objectClass=*', $dn, array('dn'), 'sub' );
|
||||
$sub_tree_count = count( $s );
|
||||
$s = $ldapserver->search(null,dn_escape($dn),'objectClass=*',array('dn'));
|
||||
$sub_tree_count = count($s);
|
||||
?>
|
||||
|
||||
<table class="delete_confirm">
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<?php echo sprintf( $lang['entry_is_root_sub_tree'], $sub_tree_count ); ?>
|
||||
<small>(<a href="search.php?search=true&server_id=<?php echo $ldapserver->server_id; ?>&filter=<?php echo rawurlencode('objectClass=*'); ?>&base_dn=<?php echo $encoded_dn; ?>&form=advanced&scope=sub"><?php echo $lang['view_entries']; ?></a>)</small>
|
||||
<?php printf(_('This entry is the root of a sub-tree containing %s entries.'),$sub_tree_count); ?>
|
||||
<small>(<a href="search.php?search=true&server_id=<?php echo $ldapserver->server_id; ?>&filter=<?php echo rawurlencode('objectClass=*'); ?>&base_dn=<?php echo rawurlencode($dn); ?>&form=advanced&scope=sub"><?php echo _('view entries'); ?></a>)</small>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<?php echo sprintf( $lang['confirm_recursive_delete'], ($sub_tree_count-1) ); ?><br />
|
||||
<?php printf(_('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?'),($sub_tree_count-1)); ?><br />
|
||||
<br />
|
||||
<small><?php echo $lang['confirm_recursive_delete_note']; ?></small>
|
||||
<small><?php echo _('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.'); ?></small>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
@@ -71,17 +65,17 @@ include './header.php'; ?>
|
||||
<form action="rdelete.php" method="post">
|
||||
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
|
||||
<input type="submit" class="scary" value="<?php echo sprintf( $lang['delete_all_x_objects'], $sub_tree_count ); ?>" />
|
||||
<input type="submit" class="scary" value="<?php printf(_('Delete all %s objects'),$sub_tree_count); ?>" />
|
||||
</form>
|
||||
</center>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<center>
|
||||
<form action="edit.php" method="get">
|
||||
<form action="template_engine.php" method="get">
|
||||
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
|
||||
<input type="submit" name="submit" value="<?php echo $lang['cancel']; ?>" class="cancel" />
|
||||
<input type="submit" name="submit" value="<?php echo _('Cancel'); ?>" class="cancel" />
|
||||
</form>
|
||||
</center>
|
||||
</td>
|
||||
@@ -94,16 +88,17 @@ include './header.php'; ?>
|
||||
<?php flush(); ?>
|
||||
<br />
|
||||
<br />
|
||||
<?php echo $lang['list_of_entries_to_be_deleted']; ?><br />
|
||||
<?php echo _('List of entries to be deleted:'); ?><br />
|
||||
|
||||
<select size="<?php echo min( 10, $sub_tree_count );?>" multiple disabled style="background:white; color:black;width:500px" >
|
||||
<select size="<?php echo min(10,$sub_tree_count);?>" multiple disabled style="background:white; color:black;width:500px" >
|
||||
<?php $i=0;
|
||||
foreach( $s as $dn => $junk ) {
|
||||
foreach ($s as $dn => $junk) {
|
||||
$i++; ?>
|
||||
|
||||
<option><?php echo $i; ?>. <?php echo htmlspecialchars( ( $dn ) ); ?></option>
|
||||
<option><?php echo $i; ?>. <?php echo htmlspecialchars((dn_unescape($dn))); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</center>
|
||||
|
||||
<br />
|
||||
|
||||
@@ -113,10 +108,10 @@ include './header.php'; ?>
|
||||
<table class="delete_confirm">
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $lang['sure_permanent_delete_object']; ?><br />
|
||||
<?php echo _('Are you sure you want to permanently delete this object?'); ?><br />
|
||||
<br />
|
||||
<nobr><acronym title="<?php echo $lang['distinguished_name']; ?>"><?php echo $lang['dn']; ?></acronym>: <b><?php echo pretty_print_dn( $dn ); ?></b><nobr><br />
|
||||
<nobr><?php echo $lang['server']; ?>: <b><?php echo htmlspecialchars($ldapserver->name); ?></b></nobr><br />
|
||||
<nobr><acronym title="<?php echo _('Distinguished Name'); ?>"><?php echo _('DN'); ?></acronym>: <b><?php echo pretty_print_dn($dn); ?></b></nobr><br />
|
||||
<nobr><?php echo _('Server'); ?>: <b><?php echo htmlspecialchars($ldapserver->name); ?></b></nobr><br />
|
||||
<br />
|
||||
|
||||
<table width="100%">
|
||||
@@ -126,17 +121,17 @@ include './header.php'; ?>
|
||||
<form action="delete.php" method="post">
|
||||
<input type="hidden" name="dn" value="<?php echo htmlspecialchars($dn); ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
|
||||
<input type="submit" name="submit" value="<?php echo $lang['delete']; ?>" class="scary" />
|
||||
<input type="submit" name="submit" value="<?php echo _('Delete'); ?>" class="scary" />
|
||||
</form>
|
||||
</center>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<center>
|
||||
<form action="edit.php" method="get">
|
||||
<form action="template_engine.php" method="get">
|
||||
<input type="hidden" name="dn" value="<?php echo $dn; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
|
||||
<input type="submit" name="submit" value="<?php echo $lang['cancel']; ?>" class="cancel" />
|
||||
<input type="submit" name="submit" value="<?php echo _('Cancel'); ?>" class="cancel" />
|
||||
</form>
|
||||
</center>
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user