function command_controller() { require "Modules/command/command_model.php"; global $session, $route; $format = $route['format']; $action = $route['action']; $output['content'] = ""; $output['message'] = ""; if ($action == 'api' && $session['read']) { $output['content'] = view("command/command_api.php", array()); } elseif ($action == 'get' && $session['write']) { $output['content'] = command_get($session['userid']); } elseif ($action == 'insert' && $session['write']) { $cmd = preg_replace('/[^\\w\\s-]/', '', get('cmd')); command_insert($session['userid'], $cmd); } elseif ($action == '' && $session['write']) { $cmds = command_list($session['userid']); $output['content'] = view("command/command_view.php", array('cmds' => $cmds)); } return $output; }
<br> <input type="submit" name="restore" value="restore"> <br><br> </form> <?php } else { echo "<b>ewikictl</b>:<pre width=\"60\">"; $config["dest"] = $_REQUEST["incoming"]; $config["format"] = $_REQUEST["format"]; $config["force"] = $_REQUEST["force"]; $config["urlencode"] = $_REQUEST["urlencode"]; $config["insert"] = "1"; if ($_REQUEST["behaviour"] == "all") { $config["all"] = 1; $config["keep"] = !$_REQUEST["overwrite"]; } else { $config["all"] = 0; $config["keep"] = $_REQUEST["behaviour"] != "append"; } set_options_global(); command_insert(); echo "</pre>"; } ?> </body> </html>