RELEASE 0.9.8
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.24 2005/07/22 05:47:43 wurley Exp $
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.24.4.4 2005/12/11 08:21:03 wurley Exp $
|
||||
|
||||
/**
|
||||
* Copies a given object to create a new one.
|
||||
@@ -17,30 +17,26 @@
|
||||
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 = get_rdn( $dn );
|
||||
$container = get_container( $dn );
|
||||
|
||||
$attrs = get_object_attrs( $ldapserver, $dn );
|
||||
$rdn = get_rdn($dn);
|
||||
$attrs = $ldapserver->getDNAttrs($dn);
|
||||
$select_server_html = server_select_list($ldapserver->server_id,true,'dest_server_id');
|
||||
$children = get_container_contents( $ldapserver, $dn );
|
||||
$children = $ldapserver->getContainerContents($dn);
|
||||
|
||||
include './header.php';
|
||||
|
||||
// Draw some javaScrpt to enable/disable the filter field if this may be a recursive copy
|
||||
if( is_array( $children ) && count( $children ) > 0 ) { ?>
|
||||
# Draw some javaScrpt to enable/disable the filter field if this may be a recursive copy
|
||||
if (is_array($children) && count($children) > 0) { ?>
|
||||
|
||||
<script language="javascript">
|
||||
<script type="text/javascript" language="javascript">
|
||||
//<!--
|
||||
function toggle_disable_filter_field( recursive_checkbox )
|
||||
function toggle_disable_filter_field(recursive_checkbox)
|
||||
{
|
||||
if( recursive_checkbox.checked ) {
|
||||
if (recursive_checkbox.checked) {
|
||||
recursive_checkbox.form.remove.disabled = false;
|
||||
recursive_checkbox.form.filter.disabled = false;
|
||||
} else {
|
||||
@@ -52,73 +48,60 @@ if( is_array( $children ) && count( $children ) > 0 ) { ?>
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
|
||||
<body>
|
||||
echo '<body>';
|
||||
|
||||
<h3 class="title"><?php echo $lang['copyf_title_copy'] . $rdn; ?></h3>
|
||||
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> <?php echo $lang['distinguished_name']?>: <b><?php echo $dn; ?></b></h3>
|
||||
printf('<h3 class="title">%s %s</h3>',_('Copy '),$rdn);
|
||||
printf('<h3 class="subtitle">%s: <b>%s</b> %s: <b>%s</b></h3>',_('Server'),$ldapserver->name,_('Distinguished Name'),$dn);
|
||||
|
||||
<center>
|
||||
<?php echo $lang['copyf_title_copy'] ?><b><?php echo htmlspecialchars( $rdn ); ?></b> <?php echo $lang['copyf_to_new_object']?>:<br />
|
||||
<br />
|
||||
echo '<center>';
|
||||
printf('%s <b>%s</b> %s:<br /><br />',_('Copy '),htmlspecialchars($rdn),_('to a new object'));
|
||||
|
||||
<form action="copy.php" method="post" name="copy_form">
|
||||
<input type="hidden" name="old_dn" value="<?php echo $dn; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
|
||||
echo '<form action="copy.php" method="post" name="copy_form">';
|
||||
printf('<input type="hidden" name="old_dn" value="%s" />',$dn);
|
||||
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
|
||||
|
||||
<table style="border-spacing: 10px">
|
||||
<tr>
|
||||
<td><acronym title="<?php echo $lang['copyf_dest_dn_tooltip']; ?>"><?php echo $lang['copyf_dest_dn']?></acronym>:</td>
|
||||
<td>
|
||||
<input type="text" name="new_dn" size="45" value="<?php echo htmlspecialchars( $dn ); ?>" />
|
||||
<?php draw_chooser_link( 'copy_form.new_dn', 'true', $rdn ); ?></td>
|
||||
</td>
|
||||
</tr>
|
||||
echo '<table style="border-spacing: 10px">';
|
||||
echo '<tr>';
|
||||
printf('<td><acronym title="%s">%s</acronym>:</td>',_('The full DN of the new entry to be created when copying the source entry'),_('Destination DN'));
|
||||
printf('<td><input type="text" name="new_dn" size="45" value="%s" />',htmlspecialchars($dn));
|
||||
draw_chooser_link('copy_form.new_dn','true',$rdn);
|
||||
echo '</td></tr>';
|
||||
|
||||
<tr>
|
||||
<td><?php echo $lang['copyf_dest_server']?>:</td>
|
||||
<td><?php echo $select_server_html; ?></td>
|
||||
</tr>
|
||||
printf('<tr><td>%s</td><td>%s</td></tr>',_('Destination Server'),$select_server_html);
|
||||
|
||||
<?php if( is_array( $children ) && count( $children ) > 0 ) { ?>
|
||||
<tr>
|
||||
<td><label for="recursive"><?php echo $lang['recursive_copy']; ?></label>:</td>
|
||||
<td><input type="checkbox" id="recursive" name="recursive" onClick="toggle_disable_filter_field(this)" />
|
||||
<small>(<?php echo $lang['copyf_recursive_copy']?>)</small></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><acronym title="<?php echo $lang['filter_tooltip']; ?>"><?php echo $lang['filter']; ?></acronym>:</td>
|
||||
<td><input type="text" name="filter" value="(objectClass=*)" size="45" disabled />
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo $lang['delete_after_copy']; ?></td>
|
||||
<td><input type="checkbox" name="remove" value="yes"/ disabled>
|
||||
<small>(<?php echo $lang['delete_after_copy_warn']; ?>)</small)</td>
|
||||
</tr>
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<td><?php echo $lang['delete_after_copy']; ?></td>
|
||||
<td><input type="checkbox" name="remove" value="yes"/></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td colspan="2" align="right"><input type="submit" value="<?php echo $lang['copyf_title_copy']; ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
if (is_array($children) && count($children) > 0) {
|
||||
echo '<tr>';
|
||||
printf('<td><label for="recursive">%s</label>:</td>',_('Recursive copy'));
|
||||
echo '<td><input type="checkbox" id="recursive" name="recursive" onClick="toggle_disable_filter_field(this)" />';
|
||||
printf('<small>(%s)</small></td>',_('Recursively copy all children of this object as well.'));
|
||||
echo '</tr><tr>';
|
||||
printf('<td><acronym title="%s">%s</acronym>:</td>',_('When performing a recursive copy, only copy those entries which match this filter'),_('Filter'));
|
||||
echo '<td><input type="text" name="filter" value="(objectClass=*)" size="45" disabled />';
|
||||
echo '</tr><tr>';
|
||||
printf('<td>%s</td>',_('Delete after copy (move):'));
|
||||
echo '<td><input type="checkbox" name="remove" value="yes"/ disabled>';
|
||||
printf('<small>(%s)</small)</td>',_('Make sure your filter (above) will select all child records.'));
|
||||
echo '</tr>';
|
||||
|
||||
<script language="javascript">
|
||||
//<!--
|
||||
/* If the user uses the back button, this way we draw the filter field properly. */
|
||||
toggle_disable_filter_field( document.copy_form.recursive );
|
||||
//-->
|
||||
</script>
|
||||
} else {
|
||||
printf('<tr><td>%s</td><td><input type="checkbox" name="remove" value="yes"/></td></tr>',_('Delete after copy (move):'));
|
||||
}
|
||||
|
||||
<?php if ($config->GetValue('appearance','show_hints')) {?>
|
||||
<small><img src="images/light.png" /><span class="hint"><?php echo $lang['copyf_note']?></span></small>
|
||||
<?php } ?>
|
||||
printf('<tr><td colspan="2" align="right"><input type="submit" value="%s" /></td></tr>',_('Copy '));
|
||||
echo '</table></form>';
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
echo '<script type="text/javascript" language="javascript">';
|
||||
echo '<!--';
|
||||
echo '/* If the user uses the back button, this way we draw the filter field properly. */';
|
||||
echo 'toggle_disable_filter_field(document.copy_form.recursive);';
|
||||
echo '//-->';
|
||||
echo '</script>';
|
||||
|
||||
if ($config->GetValue('appearance','show_hints'))
|
||||
printf('<small><img src="images/light.png" /><span class="hint">%s</span></small>',_('Hint: Copying between different servers only works if there are no schema violations'));
|
||||
|
||||
echo '</center></body></html>';
|
||||
?>
|
||||
|
Reference in New Issue
Block a user