* Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!module_config::can_i('view', 'Settings') || !module_backup::can_i('view', 'Backups')) {
    redirect_browser(_BASE_HREF);
}
$module->page_title = 'Backups';
if (!extension_loaded('zip')) {
    ?>
	<p>Warning: Full backups will not work correctly because this hosting account does not have the <strong>ZIP</strong> PHP extension enabled. Please contact the hosting provider and ask them to enable the PHP ZipArchive class.</p>
	<?php 
}
if (isset($_REQUEST['backup_id']) && $_REQUEST['backup_id']) {
    $backup_id = (int) $_REQUEST['backup_id'];
    if ($backup_id > 0) {
        $backup = module_backup::get_backup($backup_id);
        if (!$backup || $backup['backup_id'] != $backup_id) {
            redirect_browser(_BASE_HREF);
        }
        if (!$backup['backup_file']) {
            // start the ajax backup magic.
            $backup_file_base = 'backup_' . date('Y-m-d') . '_' . md5(_UCM_SECRET . time()) . '';
            update_insert('backup_id', $backup_id, 'backup', array('backup_file' => $backup_file_base));
            set_message('Backup created');
            ?>

			<form action="" method="post">
				<input type="hidden" name="_process" value="save_backup">

				<script type="text/javascript">
					ucm.backup.file_list = [];