phpldapadmin/htdocs/copy_form.php

125 lines
3.9 KiB
PHP
Raw Normal View History

2009-06-30 08:09:20 +00:00
<?php
2009-06-30 09:40:37 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/copy_form.php,v 1.24 2005/07/22 05:47:43 wurley Exp $
2009-06-30 09:22:30 +00:00
2009-06-30 09:29:51 +00:00
/**
2009-06-30 08:05:37 +00:00
* Copies a given object to create a new one.
*
2009-06-30 09:29:51 +00:00
* Variables that come in via common.php
2009-06-30 08:05:37 +00:00
* - server_id
2009-06-30 09:29:51 +00:00
* Variables that come in via GET variables
* - dn (rawurlencoded)
*
* @package phpLDAPadmin
*/
/**
2009-06-30 08:05:37 +00:00
*/
2009-06-30 09:22:30 +00:00
require './common.php';
2009-06-30 08:05:37 +00:00
2009-06-30 09:29:51 +00:00
if ($ldapserver->isReadOnly())
pla_error($lang['no_updates_in_read_only_mode']);
if (! $ldapserver->haveAuthInfo())
pla_error($lang['not_enough_login_info']);
2009-06-30 08:09:20 +00:00
$dn = $_GET['dn'] ;
2009-06-30 09:29:51 +00:00
2009-06-30 08:05:37 +00:00
$encoded_dn = rawurlencode( $dn );
2009-06-30 09:22:30 +00:00
$rdn = get_rdn( $dn );
$container = get_container( $dn );
2009-06-30 08:05:37 +00:00
2009-06-30 09:29:51 +00:00
$attrs = get_object_attrs( $ldapserver, $dn );
$select_server_html = server_select_list($ldapserver->server_id,true,'dest_server_id');
$children = get_container_contents( $ldapserver, $dn );
2009-06-30 08:05:37 +00:00
2009-06-30 09:29:51 +00:00
include './header.php';
2009-06-30 09:22:30 +00:00
// Draw some javaScrpt to enable/disable the filter field if this may be a recursive copy
if( is_array( $children ) && count( $children ) > 0 ) { ?>
2009-06-30 09:29:51 +00:00
<script language="javascript">
//<!--
2009-06-30 09:22:30 +00:00
function toggle_disable_filter_field( recursive_checkbox )
{
if( recursive_checkbox.checked ) {
2009-06-30 09:29:51 +00:00
recursive_checkbox.form.remove.disabled = false;
2009-06-30 09:22:30 +00:00
recursive_checkbox.form.filter.disabled = false;
} else {
2009-06-30 09:29:51 +00:00
recursive_checkbox.form.remove.disabled = true;
recursive_checkbox.form.remove.checked = false;
2009-06-30 09:22:30 +00:00
recursive_checkbox.form.filter.disabled = true;
}
}
2009-06-30 09:29:51 +00:00
//-->
</script>
2009-06-30 09:22:30 +00:00
<?php } ?>
2009-06-30 08:05:37 +00:00
<body>
2009-06-30 08:09:20 +00:00
<h3 class="title"><?php echo $lang['copyf_title_copy'] . $rdn; ?></h3>
2009-06-30 09:29:51 +00:00
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $ldapserver->name; ?></b> &nbsp;&nbsp;&nbsp; <?php echo $lang['distinguished_name']?>: <b><?php echo $dn; ?></b></h3>
2009-06-30 08:05:37 +00:00
<center>
2009-06-30 08:09:20 +00:00
<?php echo $lang['copyf_title_copy'] ?><b><?php echo htmlspecialchars( $rdn ); ?></b> <?php echo $lang['copyf_to_new_object']?>:<br />
2009-06-30 08:05:37 +00:00
<br />
2009-06-30 09:29:51 +00:00
2009-06-30 08:05:37 +00:00
<form action="copy.php" method="post" name="copy_form">
2009-06-30 08:09:20 +00:00
<input type="hidden" name="old_dn" value="<?php echo $dn; ?>" />
2009-06-30 09:29:51 +00:00
<input type="hidden" name="server_id" value="<?php echo $ldapserver->server_id; ?>" />
2009-06-30 08:05:37 +00:00
2009-06-30 09:22:30 +00:00
<table style="border-spacing: 10px">
2009-06-30 08:05:37 +00:00
<tr>
2009-06-30 08:09:20 +00:00
<td><acronym title="<?php echo $lang['copyf_dest_dn_tooltip']; ?>"><?php echo $lang['copyf_dest_dn']?></acronym>:</td>
2009-06-30 08:05:37 +00:00
<td>
2009-06-30 08:09:20 +00:00
<input type="text" name="new_dn" size="45" value="<?php echo htmlspecialchars( $dn ); ?>" />
2009-06-30 09:29:51 +00:00
<?php draw_chooser_link( 'copy_form.new_dn', 'true', $rdn ); ?></td>
2009-06-30 08:05:37 +00:00
</td>
</tr>
<tr>
2009-06-30 08:09:20 +00:00
<td><?php echo $lang['copyf_dest_server']?>:</td>
2009-06-30 09:22:30 +00:00
<td><?php echo $select_server_html; ?></td>
2009-06-30 08:05:37 +00:00
</tr>
2009-06-30 08:09:20 +00:00
2009-06-30 08:05:37 +00:00
<?php if( is_array( $children ) && count( $children ) > 0 ) { ?>
<tr>
2009-06-30 09:22:30 +00:00
<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 />
2009-06-30 08:05:37 +00:00
</tr>
2009-06-30 09:29:51 +00:00
<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>
2009-06-30 08:05:37 +00:00
<?php } ?>
<tr>
2009-06-30 09:22:30 +00:00
<td colspan="2" align="right"><input type="submit" value="<?php echo $lang['copyf_title_copy']; ?>" /></td>
2009-06-30 08:05:37 +00:00
</tr>
</table>
</form>
2009-06-30 09:22:30 +00:00
<script language="javascript">
2009-06-30 09:29:51 +00:00
//<!--
/* If the user uses the back button, this way we draw the filter field properly. */
toggle_disable_filter_field( document.copy_form.recursive );
//-->
2009-06-30 09:22:30 +00:00
</script>
2009-06-30 09:29:51 +00:00
<?php if ($config->GetValue('appearance','show_hints')) {?>
2009-06-30 09:22:30 +00:00
<small><img src="images/light.png" /><span class="hint"><?php echo $lang['copyf_note']?></span></small>
<?php } ?>
2009-06-30 08:05:37 +00:00
</center>
</body>
</html>