phpldapadmin/create_form.php

82 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
/*
* create_form.php
* The menu where the user chooses an RDN, Container, and Template for creating a new entry.
* After submitting this form, the user is taken to their chosen Template handler.
*
2009-06-30 08:09:20 +00:00
* Variables that come in as GET vars
2009-06-30 08:05:37 +00:00
* - server_id (optional)
* - container (rawurlencoded) (optional)
*/
2009-06-30 08:07:14 +00:00
require 'common.php';
2009-06-30 08:05:37 +00:00
$server_id = $_REQUEST['server_id'];
2009-06-30 08:07:14 +00:00
$step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : 1; // defaults to 1
$container = $_REQUEST['container'];
if( is_server_read_only( $server_id ) )
2009-06-30 08:09:20 +00:00
pla_error( $lang['no_updates_in_read_only_mode'] );
2009-06-30 08:05:37 +00:00
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
$server_name = $servers[$server_id]['name'];
2009-06-30 08:09:20 +00:00
// build the server drop-down html
2009-06-30 08:05:37 +00:00
$server_menu_html = '<select name="server_id">';
$js_dn_list = '';
2009-06-30 08:09:20 +00:00
foreach( $servers as $id => $server ) {
if( $server['host'] ) {
2009-06-30 08:05:37 +00:00
$server_menu_html .= '<option value="'.$id.'"' . ( $id==$server_id? ' selected' : '' ) . '>';
$server_menu_html .= $server['name'] . '</option>';
}
}
$server_menu_html .= '</select>';
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['createf_create_object']?></h3>
<h3 class="subtitle"><?php echo $lang['createf_choose_temp']?></h3>
<center><h3><?php echo $lang['createf_select_temp']?></h3></center>
2009-06-30 08:05:37 +00:00
<form action="creation_template.php" method="post">
<input type="hidden" name="container" value="<?php echo htmlspecialchars( $container ); ?>" />
<table class="create">
<tr>
<td class="heading">Server:</td>
<td><?php echo $server_menu_html; ?></td>
</tr>
<tr>
<td class="heading">Template:</td>
<td>
<table class="templates">
<?php foreach( $templates as $name => $template ) { ?>
<tr>
<td><input type="radio"
name="template"
value="<?php echo htmlspecialchars($name);?>"
id="<?php echo htmlspecialchars($name); ?>" /></td>
<td><label for="<?php echo htmlspecialchars($name);?>">
<img src="<?php echo $template['icon']; ?>" /></label></td>
<td><label for="<?php echo htmlspecialchars($name);?>">
<?php echo htmlspecialchars( $template['desc'] ); ?></label></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
<tr>
2009-06-30 08:09:20 +00:00
<td colspan="2"><center><input type="submit" name="submit" value="<?php echo $lang['createf_proceed']?> &gt;&gt;" /></center></td>
2009-06-30 08:05:37 +00:00
</tr>
</table>
</form>
</body>
</html>