Пример #1
0
    $text[] = "-- DO NOT REMOVE THE LINES ABOVE!";
    $text[] = "-- Otherwise this backup will be broken.";
    switch ($action) {
        case 'backup_content':
            header('Content-Disposition: attachment; filename="phpmyfaq-data.' . date("Y-m-d-H-i-s") . '.sql');
            foreach ($db->tableNames as $table) {
                $tablenames .= $table . ' ';
            }
            foreach ($db->tableNames as $table) {
                print implode("\r\n", $text);
                $text = build_insert("SELECT * FROM " . $table, $table);
            }
            break;
        case 'backup_logs':
            header('Content-Disposition: attachment; filename="phpmyfaq-logs.' . date("Y-m-d-H-i-s") . '.sql');
            foreach ($db->tableNames as $table) {
                if (SQLPREFIX . 'faqadminlog' == $table || SQLPREFIX . 'faqsessions' == $table) {
                    $tablenames .= $table . ' ';
                }
            }
            foreach ($db->tableNames as $table) {
                if (SQLPREFIX . 'faqadminlog' == $table || SQLPREFIX . 'faqsessions' == $table) {
                    print implode("\r\n", $text);
                    $text = build_insert("SELECT * FROM " . $table, $table);
                }
            }
            break;
    }
} else {
    print $PMF_LANG['err_NotAuth'];
}
Пример #2
0
    print implode("\r\n", $text);
    $text = build_insert("SELECT * FROM " . SQLPREFIX . "faquser", SQLPREFIX . "faquser");
    print implode("\r\n", $text);
    $text = build_insert("SELECT * FROM " . SQLPREFIX . "faqvisits", SQLPREFIX . "faqvisits");
    print implode("\r\n", $text);
    $text = build_insert("SELECT * FROM " . SQLPREFIX . "faqvoting", SQLPREFIX . "faqvoting");
    print implode("\r\n", $text);
    $text = build_insert("SELECT * FROM " . SQLPREFIX . "faqfragen", SQLPREFIX . "faqfragen");
    print implode("\r\n", $text);
} elseif (isset($_REQUEST["aktion"]) && $_REQUEST["aktion"] == "sicherdaten" && $auth && !$permission["backup"]) {
    print $PMF_LANG["err_NotAuth"];
}
if (isset($_REQUEST["aktion"]) && $_REQUEST["aktion"] == "sicherlog") {
    $text[] = "-- pmf1.6: " . SQLPREFIX . "faqadminlog " . SQLPREFIX . "faqsessions";
    $text[] = "-- DO NOT REMOVE THE FIRST LINE!";
    $text[] = "-- pmftableprefix: " . SQLPREFIX;
    $text[] = "-- DO NOT REMOVE THE LINES ABOVE!";
    $text[] = "-- Otherwise this backup will be broken.";
    print implode("\r\n", $text);
    $text = build_insert("SELECT * FROM " . SQLPREFIX . "faqadminlog", SQLPREFIX . "faqadminlog");
    print implode("\r\n", $text);
    $text = build_insert("SELECT * FROM " . SQLPREFIX . "faqsessions", SQLPREFIX . "faqsessions");
    print implode("\r\n", $text);
}
if (DEBUG == TRUE) {
    print "<p>" . $db->sqllog() . "</p>";
}
if (isset($_REQUEST["aktion"]) && $_REQUEST["aktion"] != "sicherdaten" && $_REQUEST["aktion"] != "sicherlog") {
    print "</body></html>";
}
$db->dbclose();