phpldapadmin/htdocs/ldif_import_form.php

55 lines
2.2 KiB
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 10:40:03 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/ldif_import_form.php,v 1.21 2005/12/10 10:34:54 wurley Exp $
2009-06-30 09:22:30 +00:00
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.
*
* Variables expected as GET vars:
* - server_id
2009-06-30 09:29:51 +00:00
*
* @package phpLDAPadmin
*/
/**
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 10:26:08 +00:00
pla_error(_('Your PHP.INI does not have file_uploads = ON. Please enable file uploads in PHP.'));
if ($ldapserver->isReadOnly())
pla_error(_('You cannot perform updates while server is in read-only mode'));
if (! $ldapserver->haveAuthInfo())
pla_error(_('Not enough information to login to server. Please check your configuration.'));
include './header.php';
echo '<body>';
printf('<h3 class="title">%s</h3>',_('Import LDIF File'));
printf('<h3 class="subtitle">%s: <b>%s</b></h3>',_('Server'),htmlspecialchars($ldapserver->name));
echo '<br /><br />';
echo _('Select an LDIF file');
echo '<br /><br />';
echo '<form action="ldif_import.php" method="post" class="new_value" enctype="multipart/form-data">';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
echo '<input type="file" name="ldif_file" /> <br />';
printf('<div style="margin-top: 5px;"><input type="checkbox" name="continuous_mode" value="1" /><span style="font-size: 90%%;">%s</span></div>',_("Don't stop on errors"));
printf('<div style="margin-top:10px;"><input type="submit" value="%s" /></div>',_('Proceed >>'));
printf('<br /><small><b>%s %s</b></small><br />',_('Maximum file size'),ini_get('upload_max_filesize'));
echo '</form>';
echo '<br /><br />';
echo _('Paste your LDIF here');
echo '<form action="ldif_import.php" method="post" class="new_value" enctype="multipart/form-data">';
echo '<textarea name="ldif" rows="10" cols="60"></textarea>';
printf('<input type="hidden" name="server_id" value="%s" />',$ldapserver->server_id);
printf('<div style="margin-top: 5px;"><input type="checkbox" name="continuous_mode" value="1" /><span style="font-size: 90%%;">%s</span></div>',_("Don't stop on errors"));
printf('<div style="margin-top:10px;"><input type="submit" value="%s" /></div>',_('Proceed >>'));
echo '</form>';
echo '</body></html>';
2009-06-30 09:22:30 +00:00
?>