Exemplo n.º 1
0
    session_start();
}
if (!check_session_user() || !check_admin_user()) {
    header('Location: index.php?error=Invalid User');
} else {
    $op = "";
    if (isset($_POST['op'])) {
        $op = $_POST['op'];
    } elseif (isset($_GET['op'])) {
        $op = $_GET['op'];
    }
    if (strlen($op) > 0) {
        if ($op == "delete") {
            if (isset($_GET['id'])) {
                $id = $_GET['id'];
                $err = delete_recipe($id);
                if (strlen($err) > 0) {
                    header('Location: error.php?msg=' . urlencode($err));
                } else {
                    header('Location: recipe_list.php');
                }
            } else {
                header('Location: error.php?msg=No id');
            }
        } elseif ($op == "add") {
            $name = $_POST['name'];
            $version = $_POST['version'];
            $module = $_POST['module'];
            $recipe = $_POST['recipe'];
            $galaxy_module = $_POST['galaxy_module'];
            $desc = $_POST['description'];
Exemplo n.º 2
0
     if ($learn_flags) {
         foreach ($learn_flags as $key => $value) {
             $body->set($key, $value);
         }
     }
     break;
 case 2:
     //Update recipe
     check_authorization();
     update_recipe();
     header("Location: index.php?editor=tradeskill&ts={$ts}&rec={$rec}");
     exit;
 case 3:
     //Delete recipe
     check_authorization();
     delete_recipe();
     header("Location: index.php?editor=tradeskill&ts={$ts}");
     exit;
 case 4:
     //Delete component
     check_authorization();
     delete_component();
     header("Location: index.php?editor=tradeskill&ts={$ts}&rec={$rec}");
     exit;
 case 5:
     // Edit component
     check_authorization();
     $javascript = new Template("templates/tradeskill/js.tmpl.php");
     $body = new Template("templates/tradeskill/component.edit.tmpl.php");
     $body->set("tradeskills", $tradeskills);
     $body->set("ts", $ts);