}
 }
 //check again to see if the URL is empty
 if (trim($url) == '') {
     redirect("edit.php?upd=edit-err&type=" . urlencode(i18n_r('CANNOT_SAVE_EMPTY')));
 }
 // was the slug changed on an existing page?
 if (isset($_POST['existing-url'])) {
     if ($_POST['post-id'] != $_POST['existing-url']) {
         // dont change the index page's slug
         if ($_POST['existing-url'] == 'index') {
             $url = $_POST['existing-url'];
             redirect("edit.php?id=" . urlencode($_POST['existing-url']) . "&upd=edit-index&type=edit");
         } else {
             exec_action('changedata-updateslug');
             updateSlugs($_POST['existing-url']);
             $file = GSDATAPAGESPATH . $url . ".xml";
             $existing = GSDATAPAGESPATH . $_POST['existing-url'] . ".xml";
             $bakfile = GSBACKUPSPATH . "pages/" . $_POST['existing-url'] . ".bak.xml";
             copy($existing, $bakfile);
             unlink($existing);
         }
     }
 }
 $file = GSDATAPAGESPATH . $url . ".xml";
 // format and clean the responses
 if (isset($_POST['post-title'])) {
     $title = safe_slash_html($_POST['post-title']);
 }
 if (isset($_POST['post-metak'])) {
     $metak = safe_slash_html($_POST['post-metak']);
Пример #2
0
include 'inc/common.php';
login_cookie_check();
// check for csrf
if (!defined('GSNOCSRF') || GSNOCSRF == FALSE) {
    $nonce = $_GET['nonce'];
    if (!check_nonce($nonce, "delete", "deletefile.php")) {
        die("CSRF detected!");
    }
}
// are we deleting pages?
if (isset($_GET['id'])) {
    $id = $_GET['id'];
    if ($id == 'index') {
        redirect('pages.php?upd=edit-error&type=' . urlencode(i18n_r('HOMEPAGE_DELETE_ERROR')));
    } else {
        updateSlugs($id);
        $status = delete_file($id);
        generate_sitemap();
        exec_action('page-delete');
        redirect("pages.php?upd=edit-" . $status . "&id=" . $id . "&type=delete");
    }
}
// are we deleting archives?
if (isset($_GET['zip'])) {
    $zip = $_GET['zip'];
    $status = delete_zip($zip);
    redirect("archive.php?upd=del-" . $status . "&id=" . $zip);
}
// are we deleting uploads?
if (isset($_GET['file'])) {
    $path = isset($_GET['path']) ? $_GET['path'] : "";
Пример #3
0
        if (!check_nonce($nonce, "delete", "backup-edit.php")) {
            die("CSRF detected!");
        }
    }
    delete_bak($id);
    redirect("backups.php?upd=bak-success&id=" . $id);
} elseif ($p == 'restore') {
    // check for csrf
    if (!defined('GSNOCSRF') || GSNOCSRF == FALSE) {
        $nonce = $_GET['nonce'];
        if (!check_nonce($nonce, "restore", "backup-edit.php")) {
            die("CSRF detected!");
        }
    }
    if (isset($_GET['new'])) {
        updateSlugs($_GET['new'], $id);
        restore_bak($id);
        $existing = GSDATAPAGESPATH . $_GET['new'] . ".xml";
        $bakfile = GSBACKUPSPATH . "pages/" . $_GET['new'] . ".bak.xml";
        copy($existing, $bakfile);
        unlink($existing);
        redirect("edit.php?id=" . $id . "&old=" . $_GET['new'] . "&upd=edit-success&type=restore");
    } else {
        restore_bak($id);
        redirect("edit.php?id=" . $id . "&upd=edit-success&type=restore");
    }
}
get_template('header', cl($SITENAME) . ' » ' . i18n_r('BAK_MANAGEMENT') . ' » ' . i18n_r('VIEWPAGE_TITLE'));
?>
	
<?php 
Пример #4
0
     }
 }
 //check again to see if the URL is empty
 if (trim($url) == '') {
     $url = 'temp';
 }
 // was the slug changed on an existing page?
 if (isset($existingurl)) {
     if ($_POST['post-id'] != $existingurl) {
         // dont change the index page's slug
         if ($existingurl == 'index') {
             $url = $existingurl;
             redirect("edit.php?id=" . urlencode($existingurl) . "&upd=edit-index&type=edit");
         } else {
             exec_action('changedata-updateslug');
             updateSlugs($existingurl);
             $file = GSDATAPAGESPATH . $url . ".xml";
             $existing = GSDATAPAGESPATH . $existingurl . ".xml";
             $bakfile = GSBACKUPSPATH . "pages/" . $existingurl . ".bak.xml";
             copy($existing, $bakfile);
             unlink($existing);
         }
     }
 }
 $file = GSDATAPAGESPATH . $url . ".xml";
 // format and clean the responses
 if (isset($_POST['post-title'])) {
     $title = var_out(xss_clean($_POST['post-title']));
 }
 if (isset($_POST['post-metak'])) {
     $metak = safe_slash_html(strip_tags($_POST['post-metak']));