phpldapadmin/copy_form.php

88 lines
2.4 KiB
PHP
Raw Normal View History

2009-06-30 08:09:20 +00:00
<?php
2009-06-30 08:05:37 +00:00
/*
* copy_form.php
* Copies a given object to create a new one.
*
* - dn (rawurlencoded)
* - server_id
*/
2009-06-30 08:07:14 +00:00
require 'common.php';
2009-06-30 08:05:37 +00:00
2009-06-30 08:09:20 +00:00
$dn = $_GET['dn'] ;
2009-06-30 08:05:37 +00:00
$encoded_dn = rawurlencode( $dn );
$server_id = $_GET['server_id'];
2009-06-30 08:07:14 +00:00
$rdn = pla_explode_dn( $dn );
2009-06-30 08:05:37 +00:00
$container = $rdn[ 1 ];
for( $i=2; $i<count($rdn)-1; $i++ )
$container .= ',' . $rdn[$i];
$rdn = $rdn[0];
2009-06-30 08:09:20 +00:00
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'] );
2009-06-30 08:05:37 +00:00
$attrs = get_object_attrs( $server_id, $dn );
$server_name = $servers[$server_id]['name'];
$select_server_html = "";
foreach( $servers as $id => $server )
{
if( $server['host'] )
{
$select_server_html .= "<option value=\"$id\"". ($id==$server_id?" selected":"") .">" . $server['name'] . "</option>\n";
}
}
$children = get_container_contents( $server_id, $dn );
2009-06-30 08:09:20 +00:00
include 'header.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>
<h3 class="subtitle">Server: <b><?php echo $server_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 />
<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 08:05:37 +00:00
<input type="hidden" name="server_id" value="<?php echo $server_id; ?>" />
<table>
<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 08:05:37 +00:00
<?php draw_chooser_link( 'copy_form.new_dn' ); ?></td>
</td>
</tr>
<tr>
2009-06-30 08:09:20 +00:00
<td><?php echo $lang['copyf_dest_server']?>:</td>
2009-06-30 08:05:37 +00:00
<td><select name="dest_server_id"><?php echo $select_server_html; ?></select></td>
</tr>
2009-06-30 08:09:20 +00:00
<?php if( show_hints() ) {?>
2009-06-30 08:05:37 +00:00
<tr>
2009-06-30 08:09:20 +00:00
<td colspan="2"><small><img src="images/light.png" /><?php echo $lang['copyf_note']?></small></td>
2009-06-30 08:05:37 +00:00
</tr>
2009-06-30 08:09:20 +00:00
<?php } ?>
2009-06-30 08:05:37 +00:00
<?php if( is_array( $children ) && count( $children ) > 0 ) { ?>
<tr>
<td colspan="2"><input type="checkbox" name="recursive" />
2009-06-30 08:09:20 +00:00
<?php echo $lang['copyf_recursive_copy']?></td>
2009-06-30 08:05:37 +00:00
</tr>
<?php } ?>
<tr>
<td colspan="2" align="right"><input type="submit" value="Copy" /></td>
</tr>
</table>
</form>
</center>
</body>
</html>