RELEASE 0.9.5
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phpldapadmin/phpldapadmin/copy_form.php,v 1.19 2004/08/15 17:39:20 uugdave Exp $
|
||||
|
||||
|
||||
/*
|
||||
* copy_form.php
|
||||
@@ -8,16 +10,13 @@
|
||||
* - server_id
|
||||
*/
|
||||
|
||||
require 'common.php';
|
||||
require './common.php';
|
||||
|
||||
$dn = $_GET['dn'] ;
|
||||
$encoded_dn = rawurlencode( $dn );
|
||||
$server_id = $_GET['server_id'];
|
||||
$rdn = pla_explode_dn( $dn );
|
||||
$container = $rdn[ 1 ];
|
||||
for( $i=2; $i<count($rdn)-1; $i++ )
|
||||
$container .= ',' . $rdn[$i];
|
||||
$rdn = $rdn[0];
|
||||
$rdn = get_rdn( $dn );
|
||||
$container = get_container( $dn );
|
||||
|
||||
check_server_id( $server_id ) or pla_error( $lang['bad_server_id_underline'] . htmlspecialchars( $server_id ) );
|
||||
have_auth_info( $server_id ) or pla_error( $lang['not_enough_login_info'] );
|
||||
@@ -26,22 +25,43 @@ $attrs = get_object_attrs( $server_id, $dn );
|
||||
$server_name = $servers[$server_id]['name'];
|
||||
|
||||
$select_server_html = "";
|
||||
foreach( $servers as $id => $server )
|
||||
{
|
||||
if (count($servers)>1){
|
||||
$select_server_html .= '<select name="dest_server_id">';
|
||||
foreach( $servers as $id => $server )
|
||||
if( $server['host'] )
|
||||
$select_server_html .= "<option value=\"$id\"". ($id==$server_id?" selected":"") .">" . htmlspecialchars($server['name']) . "</option>\n";
|
||||
$select_server_html .= '</select>';
|
||||
} else {
|
||||
$server = reset($servers);
|
||||
if( $server['host'] )
|
||||
{
|
||||
$select_server_html .= "<option value=\"$id\"". ($id==$server_id?" selected":"") .">" . $server['name'] . "</option>\n";
|
||||
}
|
||||
$select_server_html .= '<input type="hidden" name="dest_server_id" value="'.key($servers).'">' .
|
||||
'<b>' . $server['name'] . '</b>';
|
||||
}
|
||||
|
||||
$children = get_container_contents( $server_id, $dn );
|
||||
|
||||
include 'header.php'; ?>
|
||||
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 ) { ?>
|
||||
<script language="javascript">
|
||||
//<!--
|
||||
function toggle_disable_filter_field( recursive_checkbox )
|
||||
{
|
||||
if( recursive_checkbox.checked ) {
|
||||
recursive_checkbox.form.filter.disabled = false;
|
||||
} else {
|
||||
recursive_checkbox.form.filter.disabled = true;
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
<body>
|
||||
|
||||
<h3 class="title"><?php echo $lang['copyf_title_copy'] . $rdn; ?></h3>
|
||||
<h3 class="subtitle">Server: <b><?php echo $server_name; ?></b> <?php echo $lang['distinguished_name']?>: <b><?php echo $dn; ?></b></h3>
|
||||
<h3 class="subtitle"><?php echo $lang['server']; ?>: <b><?php echo $server_name; ?></b> <?php echo $lang['distinguished_name']?>: <b><?php echo $dn; ?></b></h3>
|
||||
|
||||
<center>
|
||||
<?php echo $lang['copyf_title_copy'] ?><b><?php echo htmlspecialchars( $rdn ); ?></b> <?php echo $lang['copyf_to_new_object']?>:<br />
|
||||
@@ -50,7 +70,7 @@ include 'header.php'; ?>
|
||||
<input type="hidden" name="old_dn" value="<?php echo $dn; ?>" />
|
||||
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
|
||||
|
||||
<table>
|
||||
<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>
|
||||
@@ -61,27 +81,39 @@ include 'header.php'; ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $lang['copyf_dest_server']?>:</td>
|
||||
<td><select name="dest_server_id"><?php echo $select_server_html; ?></select></td>
|
||||
<td><?php echo $select_server_html; ?></td>
|
||||
</tr>
|
||||
<?php if( show_hints() ) {?>
|
||||
<tr>
|
||||
<td colspan="2"><small><img src="images/light.png" /><?php echo $lang['copyf_note']?></small></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php if( is_array( $children ) && count( $children ) > 0 ) { ?>
|
||||
<tr>
|
||||
<td colspan="2"><input type="checkbox" name="recursive" />
|
||||
<?php echo $lang['copyf_recursive_copy']?></td>
|
||||
<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>
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" align="right"><input type="submit" value="Copy" /></td>
|
||||
<td colspan="2" align="right"><input type="submit" value="<?php echo $lang['copyf_title_copy']; ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<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>
|
||||
|
||||
<?php if( show_hints() ) {?>
|
||||
<small><img src="images/light.png" /><span class="hint"><?php echo $lang['copyf_note']?></span></small>
|
||||
<?php } ?>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user