Ejemplo n.º 1
0
function export($type = 'all')
{
    $dataroot = elgg_get_config('dataroot');
    if (!is_dir($dataroot . 'elgg_copy/export')) {
        mkdir($dataroot . 'elgg_copy/export', 0755, true);
    }
    switch ($type) {
        case 'database':
            export_database();
            break;
        case 'dataroot':
            export_dataroot();
            break;
        case 'mod':
            export_mod();
            break;
        case 'settings':
            export_settings();
            break;
        default:
            export_database();
            export_dataroot();
            export_mod();
            export_settings();
            break;
    }
}
Ejemplo n.º 2
0
         $xml_array_g = array();
         # Lost global scope inside function, so must reinit
         parse_xml_file(CT_XML_BUGS_FILE, CT_DROP_HISTORY, "ID", CT_ASCENDING);
         $bug_table =& $xml_array_g;
         draw_page_top($page);
         save_bug_data($id, $bug_data, $attachment_data, $original_submit_time, $send_mail, $cc_list, $bug_table, $user_table);
         draw_page_bottom();
     }
     break;
     # DOWNLOAD/EXPORT DATA FILES.  IN: $export_options, browser data
 # DOWNLOAD/EXPORT DATA FILES.  IN: $export_options, browser data
 case "export":
     if ($just_posted) {
         $export_options = $_POST["export_options"];
         $user_agent = $_SERVER["HTTP_USER_AGENT"];
         export_database($export_options, $user_agent);
         exit;
     } else {
         draw_page_top($page);
         draw_export_options($current_session_g["project"]);
         draw_page_bottom();
     }
     break;
     # PRESENT TOOLS MENU.  IN: (none)
 # PRESENT TOOLS MENU.  IN: (none)
 case "tools":
     draw_page_top($page);
     draw_tools_page();
     draw_page_bottom();
     break;
     # PRESENT EXECUTIVE SUMMARY REPORT.  IN: (none)
Ejemplo n.º 3
0
        unlink(DIR_BACKUPS_PREFIX . $file);
    }
}
//
// Main
//
global $author_session;
// Restrict page to administrators
if ($author_session['status'] != 'admin') {
    lcm_page_start(_T('title_archives'), '', '', 'archives_export');
    echo '<p class="normal_text">' . _T('warning_forbidden_not_admin') . "</p>\n";
    lcm_page_end();
    exit;
}
switch ($_REQUEST['action']) {
    case 'export':
        // Automatic name (lcm-YYYYMMDD)
        export_database();
        break;
    case 'download':
        download_backup($_REQUEST['file']);
        break;
    case 'rem_file':
        foreach ($_REQUEST['rem_file'] as $key => $val) {
            delete_backup($val);
        }
        header('Location: export_db.php#listbk');
        break;
    default:
        show_export_form();
}