isAdmin()) { UI::exitError(getMLText("admin_tools"),getMLText("access_denied")); } /* Check if the form data comes from a trusted request */ if(!checkFormKey('removeworkflowstate', 'GET')) { UI::exitError(getMLText("workflow_editor"), getMLText("invalid_request_token")); } if (!isset($_GET["workflowstateid"]) || !is_numeric($_GET["workflowstateid"]) || intval($_GET["workflowstateid"])<1) { UI::exitError(getMLText("workflow_editor"), getMLText("invalid_version")); } $workflowstate = $dms->getWorkflowState($_GET["workflowstateid"]); if (!is_object($workflowstate)) { UI::exitError(getMLText("workflow_editor"), getMLText("invalid_workflow_state")); } if($workflowstate->remove()) { $session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_workflow_state'))); } else { $session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('error_rm_workflow_state'))); } add_log_line("?workflowstateid=".$_GET["workflowstateid"]); header("Location:../out/out.WorkflowStatesMgr.php");