*/ global $backup_version; global $r_gcfg; global $r_icfg; global $i__cfg; global $g__cfg; global $backup_version; // error messages $err = array( __('no error [0]', 'navt_domain'), __('Restore file is too large. [1]', 'navt_domain'), __('Restore file is too large. [2]', 'nat_domain'), __('Restore file was only partially uploaded.', 'navt_domain'), __('Please select a restore file.'), __('Unknown Error. [5]', 'navt_domain'), __('A temp directory is missing on your server.', 'navt_domain'), __('Cannot write to temporary directory on server.', 'navt_domain'), __('File upload failed. Restore could not be performed.', 'navt_domain') ); // restore result messages $res = array( __('Restore completed', 'navt_domain'), __('Incorrect file type. File must be an XML file.', 'navt_domain'), __('Restore file is empty.', 'navt_domain'), __('Restore failed, file is corrupt.', 'navt_domain'), __('Restore failed, file is incomplete.', 'navt_domain') ); if( isset( $_REQUEST['navt_action'] ) && $_REQUEST['navt_action'] == 'restore' ) { $error = $_FILES['restore_file']['error']; if( !empty($error) && $error != 0 ) { $_GET['message'] = $err[intval($error)]; } else { $restore_how = ((isset($_POST['restore_how']) ) ? $_POST['restore_how'] : RESTORE_IGNORE); $match_title = ((isset($_POST['match']['title']) ) ? 1: 0 ); $match_alias = ((isset($_POST['match']['alias']) ) ? 1: 0 ); $use_backup_alias = ((isset($_POST['match']['use_backup_alias'])) ? 1: 0); $publish_pages = ((isset($_POST['match']['publish_pages'])) ? 1: 0); $discard_dups = ((isset($_POST['discard_duplicates'])) ? 1: 0); $doin_the_deed = 1; } }// end if else { $doin_the_deed = 0; } if( $doin_the_deed ) { // read/parse the restore file $r_gcfg = $r_icfg = array(); $retcode = get_navt_backup_version(); if( $retcode == 0 ) { if( $backup_version > 9600 ) { $retcode = navt_restore_96(); } else { $retcode = navt_restore_95(); } } if( $retcode != 0 ) { // encountered an error of some kind while parsing the file $doin_the_deed = 0; $_GET['message'] = $res[$retcode]; } else { ?>
"; if( $update_groups ) { NAVT::update_option(GCONFIG, $g__cfg); do_action('dbnavt', NAVT_RESTORE, sprintf("restored group config\n"), $g__cfg); _e('New groups:', 'navt_domain'); printf(" %s ", $update_groups); } if( $update_items ) { NAVT::update_option(ICONFIG, $i__cfg); do_action('dbnavt', NAVT_RESTORE, sprintf("restored item config\n"), $i__cfg); _e('Updated items:', 'navt_domain'); printf(" %s", $update_items); } if( !$update_groups && !$update_items ) { _e('The configuration was not changed.', 'navt_domain'); } echo "
• ".__('Restore Complete', 'navt_domain')." •