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"];
|
$name = $_POST["name"];
|
||||||
$initstate = $_POST["initstate"];
|
|
||||||
|
|
||||||
if (is_object($dms->getWorkflowByName($name))) {
|
if (is_object($dms->getWorkflowByName($name))) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("workflow_exists"));
|
UI::exitError(getMLText("admin_tools"),getMLText("workflow_exists"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($_POST["initstate"])) {
|
||||||
|
$initstate = $_POST["initstate"];
|
||||||
$state = $dms->getWorkflowState($initstate);
|
$state = $dms->getWorkflowState($initstate);
|
||||||
if (!$state) {
|
if (!$state) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||||
|
}
|
||||||
|
|
||||||
$newWorkflow = $dms->addWorkflow($name, $state);
|
$newWorkflow = $dms->addWorkflow($name, $state);
|
||||||
if (!$newWorkflow) {
|
if (!$newWorkflow) {
|
||||||
|
@ -63,7 +66,7 @@ if ($action == "addworkflow") {
|
||||||
add_log_line(".php&action=addworkflow&name=".$name);
|
add_log_line(".php&action=addworkflow&name=".$name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete user ------------------------------------------------------------
|
// delete workflow --------------------------------------------------------
|
||||||
else if ($action == "removeworkflow") {
|
else if ($action == "removeworkflow") {
|
||||||
|
|
||||||
/* Check if the form data comes for a trusted request */
|
/* Check if the form data comes for a trusted request */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user