- better parameter checking

This commit is contained in:
steinm 2013-01-24 16:48:44 +00:00
parent 5fbfb6ec8a
commit 7fb4de9b37

View File

@ -43,15 +43,18 @@ if ($action == "addworkflow") {
UI::exitError(getMLText("admin_tools"),getMLText("invalid_request_token"));
}
$name = $_POST["name"];
$initstate = $_POST["initstate"];
$name = $_POST["name"];
if (is_object($dms->getWorkflowByName($name))) {
UI::exitError(getMLText("admin_tools"),getMLText("workflow_exists"));
}
$state = $dms->getWorkflowState($initstate);
if (!$state) {
if(isset($_POST["initstate"])) {
$initstate = $_POST["initstate"];
$state = $dms->getWorkflowState($initstate);
if (!$state) {
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
}
} else {
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
}
@ -63,7 +66,7 @@ if ($action == "addworkflow") {
add_log_line(".php&action=addworkflow&name=".$name);
}
// delete user ------------------------------------------------------------
// delete workflow --------------------------------------------------------
else if ($action == "removeworkflow") {
/* Check if the form data comes for a trusted request */