mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
- better parameter checking
This commit is contained in:
parent
5fbfb6ec8a
commit
7fb4de9b37
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue
Block a user