RELEASE 0.9.8

This commit is contained in:
Deon George
2009-06-30 20:26:08 +10:00
parent 1f7f96122f
commit fdee1bdbd1
242 changed files with 34529 additions and 34446 deletions

View File

@@ -1,12 +1,9 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.22 2005/09/25 16:11:44 wurley Exp $
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/export_form.php,v 1.22.4.6 2005/12/11 07:41:04 wurley Exp $
/**
* export_form.php
* --------------------
*
* Html form to choose an export format(ldif,...)
*
* @package phpLDAPadmin
*/
/**
@@ -15,136 +12,154 @@
require './common.php';
require LIBDIR.'export_functions.php';
$server_id = isset( $_GET['server_id'] ) ? $_GET['server_id']:NULL ;
$format = isset( $_GET['format'] ) ? $_GET['format'] : get_line_end_format();
$scope = isset( $_GET['scope'] ) ? $_GET['scope'] : 'base' ;
$exporter_id = isset( $_GET['exporter_id'] ) ? $_GET['exporter_id'] : 0 ;
$dn = isset( $_GET['dn'] ) ? $_GET['dn'] : null;
$filter = isset( $_GET['filter'] ) ? $_GET['filter'] : '(objectClass=*)';
$attributes = isset( $_GET['attributes'] ) ? $_GET['attributes'] : '*';
$sys_attr = isset( $_GET['sys_attr'] ) && $_GET['sys_attr'] == 'true' ? true : false;
$format = isset($_GET['format']) ? $_GET['format'] : get_line_end_format();
$scope = isset($_GET['scope']) ? $_GET['scope'] : 'base' ;
$exporter_id = isset($_GET['exporter_id']) ? $_GET['exporter_id'] : 0 ;
$dn = isset($_GET['dn']) ? $_GET['dn'] : null;
$filter = isset($_GET['filter']) ? $_GET['filter'] : '(objectClass=*)';
$attributes = isset($_GET['attributes']) ? $_GET['attributes'] : '*';
$sys_attr = isset($_GET['sys_attr']) && $_GET['sys_attr'] == 'true' ? true : false;
$available_formats = array(
'unix' => 'UNIX (Linux, BSD)',
'mac' => 'Macintosh',
$available_formats = array (
'unix' => 'UNIX (Linux, BSD)',
'mac' => 'Macintosh',
'win' => 'Windows'
);
$available_scopes = array(
'base' => $lang['scope_base'],
'one' => $lang['scope_one'],
'sub' => $lang['scope_sub']
$available_scopes = array (
'base' => _('Base (base dn only)'),
'one' => _('One (one level beneath base)'),
'sub' => _('Sub (entire subtree)')
);
include './header.php'; ?>
include './header.php';
<body>
<h3 class="title"><?php echo $lang['export']; ?></h3>
<br />
<center>
<form name="export_form" action="export.php" method="POST">
<table class="export_form">
<tr>
<td>
<fieldset>
<legend><?php echo $lang['export']; ?></legend>
<table>
<tr>
<td><?php echo $lang['server']; ?></td>
<td><?php print server_select_list(); ?></td>
</tr>
<tr>
<td style="white-space:nowrap"><?php echo $lang['base_dn']; ?></td>
<td><nobr><input type="text" name="dn" id="dn" style="width:230px" value="<?php echo htmlspecialchars( $dn ); ?>" /> <?php draw_chooser_link( 'export_form.dn' ); ?></nobr></td>
</tr>
<tr>
<td><span style="white-space: nowrap"><?php echo $lang['search_scope']; ?></span></td>
<td>
<?php foreach( $available_scopes as $id => $desc ) {
$id = htmlspecialchars( $id );
$desc = htmlspecialchars( $desc ); ?>
echo '<body>';
printf('<h3 class="title">%s</h3>',_('Export'));
echo '<br />';
echo '<center>';
echo '<form name="export_form" action="export.php" method="post">';
echo '<table class="export_form">';
echo '<tr>';
echo '<td>';
<input type="radio" name="scope" value="<?php echo $id; ?>" id="<?php echo $id; ?>"<?php if($id==$scope) echo ' checked="true"';?> /><label for="<?php echo $id; ?>"><?php echo $desc; ?></label><br />
echo '<fieldset>';
printf('<legend>%s</legend>',_('Export'));
<?php } ?>
</td>
</tr>
<tr>
<td><?php echo $lang['search_filter']; ?></td>
<td><input type="text" name="filter" style="width:300px" value="<?php echo htmlspecialchars($filter); ?>" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" name="sys_attr" id="sys_attr" <?php if( $sys_attr ) echo 'checked="true" '; ?>/> <label for="sys_attr"><?php echo $lang['include_system_attrs']; ?></label></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="checkbox" id="save_as_file" name="save_as_file" /><label for="save_as_file"><?php echo $lang['save_as_file']; ?></label></td>
</tr>
</table>
</fieldset>
</td>
</tr>
<tr>
<td>
<table style="width: 100%">
<tr><td style="width: 50%">
<fieldset style="height: 100px">
<legend><?php echo $lang['export_format']; ?></legend>
echo '<table>';
printf('<tr><td>%s</td><td>%s</td></tr>',_('Server'),server_select_list());
<?php foreach($exporters as $index => $exporter){?>
echo '<tr>';
printf('<td style="white-space:nowrap">%s</td>',_('Base DN'));
printf('<td><nobr><input type="text" name="dn" id="dn" style="width:230px" value="%s" />&nbsp;',htmlspecialchars($dn));
draw_chooser_link('export_form.dn');
echo '</nobr></td>';
echo '</tr>';
<input type="radio" name="exporter_id" value="<?php echo htmlspecialchars($index); ?>" id="<?php echo htmlspecialchars($index); ?>" <?php if($index==$exporter_id) echo ' checked="true"'; ?> />
<label for="<?php echo htmlspecialchars( $index ); ?>"><?php echo htmlspecialchars( $exporter['desc'] ); ?></label><br />
echo '<tr>';
printf('<td><span style="white-space: nowrap">%s</span></td>',_('Search Scope'));
<?php } ?>
echo '<td>';
</fieldset>
</td>
<td style="width: 50%">
<fieldset style="height: 100px">
<legend><?php echo $lang['line_ends']; ?></legend>
<?php foreach( $available_formats as $id => $desc ) {
$id = htmlspecialchars( $id );
$desc = htmlspecialchars( $desc );
?>
<input type="radio" name="format" value="<?php echo $id; ?>" id="<?php echo $id; ?>"<?php if($format==$id) echo ' checked="true"'; ?> /><label for="<?php echo $id; ?>"><?php echo $desc; ?></label><br />
foreach ($available_scopes as $id => $desc)
printf('<input type="radio" name="scope" value="%s" id="%s"%s /><label for="%s">%s</label><br />',
htmlspecialchars($id),htmlspecialchars($id),($id == $scope) ? 'checked="true"' : '',
htmlspecialchars($id),htmlspecialchars($desc));
<?php } ?>
</fieldset>
</td></tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<center>
<input type="submit" name="target" value="<?php echo $lang['proceed_gt']; ?>" />
</center>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
echo '</td>';
echo '</tr>';
<?php
printf('<tr><td>%s</td><td><input type="text" name="filter" style="width:300px" value="%s" /></td></tr>',
_('Search Filter'),htmlspecialchars($filter));
printf('<tr><td>%s</td><td><input type="text" name="attributes" style="width:300px" value="%s" /></td></tr>',
_('Show Attributtes'),htmlspecialchars($attributes));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" name="sys_attr" id="sys_attr" %s/> <label for="sys_attr">%s</label></td></tr>',
$sys_attr ? 'checked="true" ' : '',_('Include system attributes'));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="save_as_file" name="save_as_file" onclick="toggle_disable_field_saveas(this)" /> <label for="save_as_file">%s</label></td></tr>',
_('Save as file'));
printf('<tr><td>&nbsp;</td><td><input type="checkbox" id="compress" name="compress" disabled /> <label for="compress">%s</label></td></tr>',
_('Compress'));
echo '</table>';
echo '</fieldset>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td>';
echo '<table style="width: 100%">';
echo '<tr><td style="width: 50%">';
echo '<fieldset style="height: 100px">';
printf('<legend>%s</legend>',_('Export format'));
foreach ($exporters as $index => $exporter) {
printf('<input type="radio" name="exporter_id" id="exporter_id_%s" value="%s"%s />',
htmlspecialchars($index),htmlspecialchars($index),($index==$exporter_id) ? ' checked="true"' : '');
printf('<label for="%s">%s</label><br />',
htmlspecialchars($index),htmlspecialchars($exporter['desc']));
}
echo '</fieldset>';
echo '</td>';
echo '<td style="width: 50%">';
echo '<fieldset style="height: 100px">';
printf('<legend>%s</legend>',_('Line ends'));
foreach ($available_formats as $id => $desc)
printf('<input type="radio" name="format" value="%s" id="%s"%s /><label for="%s">%s</label><br />',
htmlspecialchars($id),htmlspecialchars($id),($format==$id) ? ' checked="true"' : '',
htmlspecialchars($id),htmlspecialchars($desc));
echo '</fieldset>';
echo '</td></tr>';
echo '</table>';
echo '</td>';
echo '</tr>';
echo '<tr>';
echo '<td colspan="2">';
printf('<center><input type="submit" name="target" value="%s" /></center>',
htmlspecialchars(_('Proceed >>')));
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</form>';
echo '</center>';
/**
* Helper functoin for fetching the line end format.
* @return String 'win', 'unix', or 'mac' based on the user's browser..
*/
function get_line_end_format()
{
if( is_browser_os_windows() )
return 'win';
elseif( is_browser_os_unix() )
return 'unix';
elseif( is_browser_os_mac() )
return 'mac';
else
return 'unix';
function get_line_end_format() {
if (is_browser_os_windows())
return 'win';
elseif (is_browser_os_unix())
return 'unix';
elseif (is_browser_os_mac())
return 'mac';
else
return 'unix';
}
?>
<script type="text/javascript" language="javascript">
<!--
function toggle_disable_field_saveas(id) {
if (id.checked) {
id.form.compress.disabled = false;
} else {
id.form.compress.disabled = true;
id.form.compress.checked = false;
}
}
-->
</script>
</body>
</html>