コード例 #1
0
ファイル: mapcfg.php プロジェクト: andregirol/uxpanel
            ghostMapDelete($_REQUEST['id'], $_POST['filename'], true);
            $message = "Map configuration file has been removed.";
        } else {
            if ($_POST['action'] == "add" && isset($_POST['filename'])) {
                $filename = $_POST['filename'];
                if (strpos($filename, ".") === false) {
                    $filename .= ".cfg";
                }
                ghostUpdateFile($_REQUEST['id'], $filename, "# New map configuration file", true);
                $message = "Map configuration file added.";
            } else {
                if ($_POST['action'] == "edit" && isset($_POST['filename']) && isset($_POST['content'])) {
                    $filename = $_POST['filename'];
                    if (strpos($filename, ".") === false) {
                        $filename .= ".cfg";
                    }
                    ghostUpdateFile($_REQUEST['id'], $filename, $_POST['content'], true);
                    $message = "Map configuration file edited.";
                }
            }
        }
        if (!isset($_SESSION['noredirect'])) {
            header("Location: mapcfg.php?id=" . $_REQUEST['id'] . "&message=" . urlencode($message));
            return;
        }
    }
    $list = ghostMapList($_REQUEST['id'], "mapcfgs");
    get_page("mapcfg", "ghost", array('service_id' => $_REQUEST['id'], 'list' => $list, 'message' => $message, 'edit' => $edit, 'content' => $content));
} else {
    header("Location: ../panel/");
}
コード例 #2
0
ファイル: map.php プロジェクト: andregirol/uxpanel
            } else {
                if ($_POST['action'] == "remove" && isset($_POST['filename'])) {
                    ghostMapDelete($_REQUEST['id'], $_POST['filename']);
                    $message = "Map deleted.";
                }
            }
        }
        if (!isset($_SESSION['noredirect'])) {
            header("Location: map.php?id=" . $_REQUEST['id'] . "&message=" . urlencode($message));
            return;
        }
    } else {
        if (isset($_GET['action'])) {
            if ($_GET['action'] == "download" && isset($_GET['filename'])) {
                ghostMapDownload($_REQUEST['id'], $_GET['filename']);
                return;
            } else {
                if ($_GET['action'] == "repodownload" && isset($_GET['filename'])) {
                    ghostMapDownload($_REQUEST['id'], $_GET['filename'], true);
                    return;
                }
            }
        }
    }
    # get the current repository and user files
    $repositoryMaps = ghostMapList($_REQUEST['id'], "repository");
    $userMaps = ghostMapList($_REQUEST['id'], "maps");
    get_page("map", "ghost", array('service_id' => $_REQUEST['id'], 'repositoryMaps' => $repositoryMaps, 'userMaps' => $userMaps, 'message' => $message));
} else {
    header("Location: ../panel/");
}