2009-06-30 09:22:30 +00:00
|
|
|
<?php
|
2009-07-01 06:09:17 +00:00
|
|
|
// $Header$
|
2009-06-30 09:22:30 +00:00
|
|
|
|
2009-06-30 09:29:51 +00:00
|
|
|
/**
|
2009-07-01 06:09:17 +00:00
|
|
|
* Performs the export of data from the LDAP server
|
|
|
|
*
|
2009-06-30 09:29:51 +00:00
|
|
|
* @package phpLDAPadmin
|
2009-07-01 06:09:17 +00:00
|
|
|
* @subpackage Page
|
2009-06-30 09:29:51 +00:00
|
|
|
*/
|
2009-07-01 06:09:17 +00:00
|
|
|
|
2009-06-30 09:29:51 +00:00
|
|
|
/**
|
|
|
|
*/
|
|
|
|
|
2009-06-30 10:46:00 +00:00
|
|
|
require './common.php';
|
2009-06-30 09:29:51 +00:00
|
|
|
require LIBDIR.'export_functions.php';
|
2009-06-30 09:22:30 +00:00
|
|
|
|
2009-06-30 11:46:44 +00:00
|
|
|
if (! $_SESSION[APPCONFIG]->isCommandAvailable('export'))
|
2009-07-01 06:09:17 +00:00
|
|
|
error(sprintf('%s: %s',_('This operation is not permitted by the configuration'),_('export')),'error','index.php');
|
2009-06-30 10:26:08 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
# Prevent script from bailing early for long search
|
2009-06-30 10:26:08 +00:00
|
|
|
@set_time_limit(0);
|
2009-06-30 09:29:51 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
$request = array();
|
|
|
|
$request['file'] = get_request('save_as_file') ? true : false;
|
|
|
|
$request['exporter'] = new Exporter($app['server']->getIndex(),get_request('exporter_id','REQUEST'));
|
|
|
|
$request['export'] = $request['exporter']->getTemplate();
|
|
|
|
$types = $request['export']->getType();
|
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
# send the header
|
2009-07-01 06:09:17 +00:00
|
|
|
if ($request['file']) {
|
2009-06-30 11:52:55 +00:00
|
|
|
$obStatus = ob_get_status();
|
|
|
|
if (isset($obStatus['type']) && $obStatus['type'] && $obStatus['status'])
|
|
|
|
ob_end_clean();
|
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
header('Content-type: application/download');
|
2009-07-01 06:09:17 +00:00
|
|
|
header(sprintf('Content-Disposition: inline; filename="%s.%s"','export',$types['extension'].($request['export']->isCompressed() ? '.gz' : '')));
|
|
|
|
$request['export']->export();
|
2009-06-30 10:46:00 +00:00
|
|
|
die();
|
2009-06-30 10:26:08 +00:00
|
|
|
|
2009-06-30 10:46:00 +00:00
|
|
|
} else {
|
|
|
|
print '<span style="font-size: 14px; font-family: courier;"><pre>';
|
2009-07-01 06:09:17 +00:00
|
|
|
$request['export']->export();
|
2009-06-30 10:46:00 +00:00
|
|
|
print '</pre></span>';
|
|
|
|
}
|
2009-06-30 09:22:30 +00:00
|
|
|
?>
|