- better parameter checking

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

View File

@ -44,16 +44,19 @@ if ($action == "addworkflow") {
}
$name = $_POST["name"];
$initstate = $_POST["initstate"];
if (is_object($dms->getWorkflowByName($name))) {
UI::exitError(getMLText("admin_tools"),getMLText("workflow_exists"));
}
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"));
}
$newWorkflow = $dms->addWorkflow($name, $state);
if (!$newWorkflow) {
@ -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 */