phpldapadmin/htdocs/import_form.php

49 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 09:29:51 +00:00
/**
2009-06-30 08:07:14 +00:00
* Displays a form to allow the user to upload and import
* an LDIF file.
*
2009-06-30 09:29:51 +00:00
* @package phpLDAPadmin
* @subpackage Page
2009-06-30 09:29:51 +00:00
*/
2009-06-30 09:29:51 +00:00
/**
2009-06-30 08:07:14 +00:00
*/
2009-06-30 09:22:30 +00:00
require './common.php';
2009-06-30 08:07:14 +00:00
2009-06-30 09:40:37 +00:00
if (! ini_get('file_uploads'))
2009-06-30 11:52:55 +00:00
error(_('Your PHP.INI does not have file_uploads = ON. Please enable file uploads in PHP.'),'error','index.php');
2009-06-30 10:26:08 +00:00
$request['page'] = new PageRender($app['server']->getIndex(),get_request('template','REQUEST',false,'none'));
$request['page']->drawTitle(sprintf('<b>%s</b>',_('Import')));
$request['page']->drawSubTitle(sprintf('%s: <b>%s</b>',_('Server'),$app['server']->getName()));
2009-06-30 10:26:08 +00:00
2009-06-30 10:46:00 +00:00
echo '<form action="cmd.php" method="post" class="new_value" enctype="multipart/form-data">';
2010-02-24 15:03:10 +00:00
echo '<div>';
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
echo '<input type="hidden" name="cmd" value="import" />';
2010-02-24 15:03:10 +00:00
echo '</div>';
2009-06-30 11:51:50 +00:00
2010-02-24 15:03:10 +00:00
echo '<table class="forminput" border="0" style="margin-left: auto; margin-right: auto;">';
2009-06-30 11:51:50 +00:00
2010-02-24 15:03:10 +00:00
echo '<tr><td colspan="2">&nbsp;</td></tr>';
2009-06-30 11:51:50 +00:00
echo '<tr>';
printf('<td>%s</td>',_('Select an LDIF file'));
echo '<td>';
echo '<input type="file" name="ldif_file" />';
echo '</td></tr>';
printf('<tr><td>&nbsp;</td><td class="small"><b>%s %s</b></td></tr>',_('Maximum file size'),ini_get('upload_max_filesize'));
2010-02-24 15:03:10 +00:00
echo '<tr><td colspan="2">&nbsp;</td></tr>';
2009-06-30 11:51:50 +00:00
printf('<tr><td>%s</td></tr>',_('Or paste your LDIF here'));
2010-02-24 15:03:10 +00:00
echo '<tr><td colspan="2"><textarea name="ldif" rows="20" cols="100"></textarea></td></tr>';
echo '<tr><td colspan="2">&nbsp;</td></tr>';
2009-06-30 11:51:50 +00:00
printf('<tr><td>&nbsp;</td><td class="small"><input type="checkbox" name="continuous_mode" value="1" />%s</td></tr>',
_("Don't stop on errors"));
printf('<tr><td>&nbsp;</td><td><input type="submit" value="%s" /></td></tr>',_('Proceed >>'));
echo '</table>';
2009-06-30 10:26:08 +00:00
echo '</form>';
2009-06-30 09:22:30 +00:00
?>