Exemplo n.º 1
0
 public function handle($data)
 {
     $iuehdakvoje = "ipParts";
     ${"GLOBALS"}["unilynnueob"] = "environment";
     $ycodjgp = "redirect";
     ${"GLOBALS"}["lpnulgd"] = "response";
     ${"GLOBALS"}["mvxrxro"] = "ipParts";
     $wghwmdry = "ip";
     $lwrykskv = "ipParts";
     $ryudrroeulb = "adb";
     ${"GLOBALS"}["xlirlgfme"] = "ipParts";
     ${"GLOBALS"}["atmyvwso"] = "ipParts";
     ${"GLOBALS"}["hirbqakfku"] = "ipParts";
     ${"GLOBALS"}["hrwkpguwax"] = "ipParts";
     $zelgofezen = "executionMode";
     $ibhtcitid = "executionMode";
     ${$ryudrroeulb} = PearDatabase::getInstance();
     ${${"GLOBALS"}["rmrewmoru"]} = $_SERVER["REMOTE_ADDR"];
     ${${"GLOBALS"}["xlirlgfme"]} = explode(".", ${$wghwmdry});
     ${${"GLOBALS"}["ytoiwy"]} = "SELECT * FROM vtiger_wf_http_limits_ips WHERE `ip` LIKE '" . ${${"GLOBALS"}["otplryj"]}[0] . ".%' OR `ip` LIKE '" . ${${"GLOBALS"}["atmyvwso"]}[0] . "." . ${${"GLOBALS"}["otplryj"]}[1] . ".%' OR `ip` LIKE '" . ${${"GLOBALS"}["hrwkpguwax"]}[0] . "." . ${${"GLOBALS"}["hirbqakfku"]}[1] . "." . ${$iuehdakvoje}[2] . ".%' OR `ip` LIKE '" . ${${"GLOBALS"}["otplryj"]}[0] . "." . ${${"GLOBALS"}["mvxrxro"]}[1] . "." . ${${"GLOBALS"}["otplryj"]}[2] . "." . ${$lwrykskv}[3] . "%'";
     ${${"GLOBALS"}["zlijsv"]} = $adb->query(${${"GLOBALS"}["ytoiwy"]});
     if ($adb->num_rows(${${"GLOBALS"}["zlijsv"]}) == 0) {
         $mnyrtecg = "ip";
         die("ACCESS_DENIED for " . ${$mnyrtecg});
     } else {
         $ywpnubj = "accessCheckResult";
         $psnscwubwfj = "row";
         while (${$psnscwubwfj} = $adb->fetchByAssoc(${$ywpnubj})) {
             $ntiiyfpbov = "ip";
             $fsgwwvvoi = "row";
             if (${${"GLOBALS"}["bjowfug"]}["ip"] == ${$ntiiyfpbov}) {
                 $iiriyjh = "row";
                 $this->_addPermissionLimitID(${$iiriyjh}["limit_id"]);
             } elseif (preg_match("/\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b/", ${$fsgwwvvoi}["ip"])) {
                 continue;
             } elseif (\Workflow\IPCheck::ip_in_range(${${"GLOBALS"}["rmrewmoru"]}, ${${"GLOBALS"}["bjowfug"]}["ip"])) {
                 $this->_addPermissionLimitID(${${"GLOBALS"}["bjowfug"]}["limit_id"]);
             }
         }
     }
     if (count($this->_access) == 0) {
         $tbzoxrju = "ip";
         die("ACCESS_DENIED for " . ${$tbzoxrju});
     }
     ${${"GLOBALS"}["huhdmgofik"]} = intval($_REQUEST["record_id"]);
     $zvfkgvoegv = "record_id";
     ${$ibhtcitid} = "none";
     ${"GLOBALS"}["kybozx"] = "key";
     if (!empty(${$zvfkgvoegv})) {
         ${"GLOBALS"}["hrlijwlhcn"] = "context";
         ${${"GLOBALS"}["hrlijwlhcn"]} = \Workflow\VTEntity::getForId(${${"GLOBALS"}["huhdmgofik"]});
     } else {
         $xvhpmjj = "context";
         ${$xvhpmjj} = \Workflow\VTEntity::getDummy();
     }
     if (!empty($_REQUEST["workflow_trigger"])) {
         ${"GLOBALS"}["xctyelrs"] = "moduleName";
         ${"GLOBALS"}["yqkcoxdf"] = "result";
         ${${"GLOBALS"}["gfryhuwwv"]} = $_REQUEST["workflow_trigger"];
         ${${"GLOBALS"}["xctyelrs"]} = $_REQUEST["module"];
         ${${"GLOBALS"}["ktxrdqs"]} = getTabid(${${"GLOBALS"}["ftxydrclssf"]});
         if (empty(${${"GLOBALS"}["ktxrdqs"]})) {
             die("MODULE_NOT_FOUND");
         }
         $nbjyypn = "trigger";
         ${"GLOBALS"}["kguaplly"] = "sql";
         ${"GLOBALS"}["kigvfsullx"] = "sql";
         ${${"GLOBALS"}["kguaplly"]} = "SELECT id, `key` FROM vtiger_wf_trigger WHERE `key` = ? AND deleted = 0 AND custom = 1";
         ${"GLOBALS"}["osommxjcsyi"] = "result";
         ${${"GLOBALS"}["osommxjcsyi"]} = $adb->pquery(${${"GLOBALS"}["kigvfsullx"]}, array(${${"GLOBALS"}["gfryhuwwv"]}));
         if ($adb->num_rows(${${"GLOBALS"}["yqkcoxdf"]}) == 0) {
             die("TRIGGER_NOT_FOUND");
         } else {
             $lburvvv = "trigger";
             ${"GLOBALS"}["yicgxdyyt"] = "executionMode";
             ${"GLOBALS"}["qkwltubetoqt"] = "result";
             ${${"GLOBALS"}["yicgxdyyt"]} = "trigger";
             ${$lburvvv} = $adb->query_result(${${"GLOBALS"}["qkwltubetoqt"]}, 0, "key");
         }
         if (!in_array(${$nbjyypn}, $this->_access["trigger"])) {
             ${"GLOBALS"}["trjabrrpbx"] = "ip";
             die("ACCESS_DENIED for " . ${${"GLOBALS"}["trjabrrpbx"]});
         }
     }
     if (!empty($_REQUEST["workflow_id"])) {
         $xmhjbyf = "result";
         ${"GLOBALS"}["olldewfcyyph"] = "workflow_id";
         ${"GLOBALS"}["xbvnzv"] = "record_id";
         ${"GLOBALS"}["ajdhuvevtz"] = "sql";
         ${${"GLOBALS"}["uauipqs"]} = intval($_REQUEST["workflow_id"]);
         ${${"GLOBALS"}["ajdhuvevtz"]} = "SELECT id, title FROM  vtiger_wf_settings WHERE id = ? AND active = 1";
         $ymdspopx = "values";
         ${${"GLOBALS"}["qfzfncwih"]} = array(${${"GLOBALS"}["olldewfcyyph"]});
         if (!empty(${${"GLOBALS"}["xbvnzv"]})) {
             ${"GLOBALS"}["dvocdfmhiudc"] = "values";
             ${${"GLOBALS"}["ytoiwy"]} .= " AND module_name = ?";
             ${${"GLOBALS"}["dvocdfmhiudc"]}[] = $context->getModuleName();
         }
         ${${"GLOBALS"}["ylgtydnyihg"]} = $adb->pquery(${${"GLOBALS"}["ytoiwy"]}, ${$ymdspopx}, true);
         if ($adb->num_rows(${$xmhjbyf}) == 0) {
             die("WORKFLOW_NOT_FOUND");
         } else {
             ${"GLOBALS"}["eqjbaqoa"] = "workflow_id";
             ${${"GLOBALS"}["gfuwwgd"]} = "id";
             ${${"GLOBALS"}["eqjbaqoa"]} = $adb->query_result(${${"GLOBALS"}["ylgtydnyihg"]}, 0, "id");
         }
         if (!in_array(${${"GLOBALS"}["uauipqs"]}, $this->_access["id"])) {
             ${"GLOBALS"}["xettocrqrd"] = "ip";
             die("ACCESS_DENIED for " . ${${"GLOBALS"}["xettocrqrd"]});
         }
     }
     if (${$zelgofezen} == "none") {
         die("You must specify workflow_trigger or workflow_id");
     }
     $uzssajc = "user";
     unset($_REQUEST["id"]);
     unset($_REQUEST["record_id"]);
     unset($_REQUEST["workflow_trigger"]);
     ${"GLOBALS"}["emwrrxerow"] = "environment";
     unset($_REQUEST["workflow_id"]);
     unset($_REQUEST["module"]);
     ${${"GLOBALS"}["unilynnueob"]} = array();
     foreach ($_REQUEST as ${${"GLOBALS"}["kybozx"]} => ${${"GLOBALS"}["dqqzxcrvdif"]}) {
         ${"GLOBALS"}["bqlddraey"] = "environment";
         ${${"GLOBALS"}["bqlddraey"]}[${${"GLOBALS"}["trlypsbsmpu"]}] = $this->strip_tags_deep(${${"GLOBALS"}["dqqzxcrvdif"]});
     }
     $context->loadEnvironment(${${"GLOBALS"}["emwrrxerow"]});
     if (!empty($_FILES)) {
         ${"GLOBALS"}["akrrrvsfekjk"] = "filekey";
         foreach ($_FILES as ${${"GLOBALS"}["akrrrvsfekjk"]} => ${${"GLOBALS"}["jsgnxbqw"]}) {
             ${"GLOBALS"}["srxobtcs"] = "file";
             $prnnmlzg = "file";
             $context->addTempFile(${$prnnmlzg}["tmp_name"], ${${"GLOBALS"}["behmwxmdhewk"]}, ${${"GLOBALS"}["srxobtcs"]}["name"]);
         }
     }
     ${${"GLOBALS"}["inzmevwvq"]} = Users::getActiveAdminUser();
     \Workflow\VTEntity::setUser(${$uzssajc});
     ob_start();
     if (${${"GLOBALS"}["gfuwwgd"]} == "id") {
         ${"GLOBALS"}["xbhpjnuesvy"] = "workflow_id";
         ${"GLOBALS"}["xdizreur"] = "context";
         ${${"GLOBALS"}["uxfgwct"]} = new \Workflow\Main(${${"GLOBALS"}["xbhpjnuesvy"]}, false, ${${"GLOBALS"}["inzmevwvq"]});
         $objWorkflow->setContext(${${"GLOBALS"}["xdizreur"]});
         $objWorkflow->start();
         $rugpwzh = "redirect";
         ${$rugpwzh} = $objWorkflow->getSuccessRedirection();
     }
     if (${${"GLOBALS"}["gfuwwgd"]} == "trigger") {
         ${"GLOBALS"}["buepdhri"] = "wfManager";
         $dkllbyi = "trigger";
         $vmbyvjusnw = "moduleName";
         $elubssx = "workflows";
         ${${"GLOBALS"}["buepdhri"]} = new \Workflow\Manager();
         ${"GLOBALS"}["ztxpyfldus"] = "workflows";
         ${${"GLOBALS"}["dfkeynth"]} = $wfManager->GetWorkflows(${$vmbyvjusnw}, ${$dkllbyi});
         if (is_array(${$elubssx}) && count(${${"GLOBALS"}["ztxpyfldus"]}) > 0) {
             ${"GLOBALS"}["fdpphxg"] = "workflows";
             $jdseehx = "wf";
             foreach (${${"GLOBALS"}["fdpphxg"]} as ${$jdseehx}) {
                 $hviqvlaxyaqh = "tmpRedirect";
                 ${"GLOBALS"}["mgliozkdag"] = "context";
                 if (!$context->isAvailable()) {
                     break;
                 }
                 $wf->setContext(${${"GLOBALS"}["mgliozkdag"]});
                 $wf->start();
                 ${${"GLOBALS"}["ajehahie"]} = $wf->getSuccessRedirection();
                 if (!empty(${$hviqvlaxyaqh})) {
                     ${"GLOBALS"}["baxyrwouy"] = "redirect";
                     ${${"GLOBALS"}["baxyrwouy"]} = ${${"GLOBALS"}["ajehahie"]};
                 }
             }
         }
     }
     ${${"GLOBALS"}["yeqmruvbnw"]} = ob_get_clean();
     echo json_encode(array("result" => "ok", "response" => ${${"GLOBALS"}["lpnulgd"]}, "redirect" => ${$ycodjgp}));
 }
Exemplo n.º 2
0
${$hxpvmkideqoh} = "SELECT * FROM vtiger_wf_settings WHERE id = ? AND active = 1";
$ijlmxw = "result";
${"GLOBALS"}["kuenpowwyksg"] = "result";
${"GLOBALS"}["qcnqxqyecgy"] = "row";
${${"GLOBALS"}["kuenpowwyksg"]} = $adb->pquery(${${"GLOBALS"}["hocuqb"]}, array(intval($_POST["workflow"])));
while (${${"GLOBALS"}["qcnqxqyecgy"]} = $adb->fetch_array(${${"GLOBALS"}["qlkvslbxxki"]})) {
    ${"GLOBALS"}["viljauoxjm"] = "user";
    if (${${"GLOBALS"}["nzrzpvuahr"]}["execution_user"] == "0") {
        ${${"GLOBALS"}["nzrzpvuahr"]}["execution_user"] = $current_user->id;
    }
    ${"GLOBALS"}["uhixyxgidqr"] = "row";
    $nrhyxmzurk = "user";
    ${${"GLOBALS"}["viljauoxjm"]} = new Users();
    ${"GLOBALS"}["eaiddcmebmb"] = "row";
    $user->retrieveCurrentUserInfoFromFile(${${"GLOBALS"}["uhixyxgidqr"]}["execution_user"]);
    \Workflow\VTEntity::setUser(${$nrhyxmzurk});
    ${${"GLOBALS"}["vcbzbbezhw"]} = new Workflow_Main(${${"GLOBALS"}["eaiddcmebmb"]}["id"], false, ${${"GLOBALS"}["vpcmorlu"]});
    $objWorkflow->setExecutionTrigger("WF2_MANUELL");
    if (${${"GLOBALS"}["bjxrkxjwht"]} == false && $objWorkflow->isRunning($_POST["crmid"])) {
        continue;
    }
    ${${"GLOBALS"}["suwlvvxno"]} = \Workflow\VTEntity::getForId(intval($_POST["crmid"]), $_POST["return_module"]);
    if (!empty(${${"GLOBALS"}["nzrzpvuahr"]}["startfields"]) && !isset($_POST["startfields"])) {
        ${"GLOBALS"}["djwuofnr"] = "row";
        $ciuknauota = "startfields";
        ${${"GLOBALS"}["ekwrlphqm"]} = unserialize(${${"GLOBALS"}["djwuofnr"]}["startfields"]);
        $oaeirdgf = "value";
        foreach (${${"GLOBALS"}["ekwrlphqm"]} as ${${"GLOBALS"}["ohibiiqriqt"]} => ${$oaeirdgf}) {
            $xvdqmpgby = "startfields";
            $irouxk = "key";
            $eawxjdnsn = "context";
Exemplo n.º 3
0
 public function getConnectedObjects($connection)
 {
     global $adb, $current_user;
     $kryexcyqv = "connection";
     require_once "modules/Workflow2/lib/Workflow/VTEntity.php";
     $zhzrdig = "returns";
     $gsutapau = "returns";
     $qqmbegh = "result";
     ${"GLOBALS"}["qxpxrsw"] = "result";
     require_once "modules/Workflow2/VTEntityMap.php";
     $dxtphjevl = "sql";
     if (VTEntity::getUser(${${"GLOBALS"}["bqcqwqztsmvp"]}) === false) {
         $tnfwjcgygnp = "current_user";
         VTEntity::setUser(${$tnfwjcgygnp});
     }
     ${$dxtphjevl} = "SELECT *\n            FROM vtiger_wfp_connections\n                LEFT JOIN vtiger_wfp_objects ON(vtiger_wfp_objects.id = vtiger_wfp_connections.source_id)\n            WHERE deleted = 0 AND destination_id = ? AND destination_key = ?";
     ${${"GLOBALS"}["qxpxrsw"]} = \Workflow\VtUtils::pquery(${${"GLOBALS"}["ulkocil"]}, array($this->getBlockId(), strtolower(${$kryexcyqv})));
     ${$zhzrdig} = array();
     while (${${"GLOBALS"}["lbujtjnghu"]} = $adb->fetch_array(${$qqmbegh})) {
         ${"GLOBALS"}["ixlpntqeg"] = "row";
         if (!empty(${${"GLOBALS"}["ixlpntqeg"]}["crmid"])) {
             ${"GLOBALS"}["igbdjvjxfgk"] = "row";
             ${${"GLOBALS"}["lkabymgowvb"]}[] = VTEntity::getForId(${${"GLOBALS"}["igbdjvjxfgk"]}["crmid"], ${${"GLOBALS"}["lbujtjnghu"]}["module_name"]);
         }
     }
     return new VTEntityMap(${$gsutapau});
 }
Exemplo n.º 4
0
 public function process(Vtiger_Request $request)
 {
     ${"GLOBALS"}["chcevbjm"] = "params";
     ${"GLOBALS"}["uddkkmgoo"] = "current_user";
     $hcnexc = "sql";
     $qdewlwhevj = "allow_parallel";
     ${${"GLOBALS"}["hjcnqydfk"]} = PearDatabase::getInstance();
     $ldobmlfv = "result";
     ${${"GLOBALS"}["chcevbjm"]} = $request->getAll();
     $ythfmxwru = "result";
     ${"GLOBALS"}["ziyqhnwbkgh"] = "startfields";
     $etbpjhd = "redirection";
     ${${"GLOBALS"}["uddkkmgoo"]} = ${${"GLOBALS"}["swhytdpbqad"]} = Users_Record_Model::getCurrentUserModel();
     $poabnfyvn = "row";
     $islvxox = "workflow";
     ${$qdewlwhevj} = $request->get("allow_parallel", "0");
     ${$islvxox} = (int) $request->get("workflow");
     $jjvyqosqc = "sql";
     ${"GLOBALS"}["nonmmspn"] = "result";
     ${${"GLOBALS"}["ziyqhnwbkgh"]} = $request->get("startfields");
     ${$jjvyqosqc} = "SELECT * FROM vtiger_wf_settings WHERE id = ? AND active = 1";
     ${$ythfmxwru} = $adb->pquery(${$hcnexc}, array(${${"GLOBALS"}["wsetygx"]}));
     while (${$poabnfyvn} = $adb->fetch_array(${${"GLOBALS"}["nonmmspn"]})) {
         ${"GLOBALS"}["wrpbkirg"] = "user";
         $yropymdmfby = "row";
         if (${${"GLOBALS"}["irzvvvuoub"]}["execution_user"] == "0") {
             $iivpozwkudif = "row";
             ${$iivpozwkudif}["execution_user"] = $current_user->id;
         }
         ${"GLOBALS"}["xybqugqfbv"] = "user";
         $xfxryhn = "allow_parallel";
         ${${"GLOBALS"}["xybqugqfbv"]} = new Users();
         $user->retrieveCurrentUserInfoFromFile(${${"GLOBALS"}["irzvvvuoub"]}["execution_user"]);
         $jvljtkcm = "objWorkflow";
         VTEntity::setUser(${${"GLOBALS"}["wxiabddsqh"]});
         ${$jvljtkcm} = new \Workflow\Main(${${"GLOBALS"}["irzvvvuoub"]}["id"], false, ${${"GLOBALS"}["wrpbkirg"]});
         $rlxpjpocoqi = "context";
         ${"GLOBALS"}["jkbdqfqrchl"] = "context";
         $objWorkflow->setExecutionTrigger("WF2_MANUELL");
         if (${$xfxryhn} == false && $objWorkflow->isRunning($_POST["crmid"])) {
             continue;
         }
         ${${"GLOBALS"}["jkbdqfqrchl"]} = VTEntity::getForId(intval($_POST["crmid"]));
         if (!empty(${$yropymdmfby}["startfields"]) && empty(${${"GLOBALS"}["xhdqpuushyxe"]})) {
             $jjwfklwbe = "startfields";
             ${"GLOBALS"}["ncpssfj"] = "value";
             ${"GLOBALS"}["bvznkhwudjv"] = "row";
             ${"GLOBALS"}["bvoise"] = "startfields";
             ${$jjwfklwbe} = unserialize(html_entity_decode(${${"GLOBALS"}["bvznkhwudjv"]}["startfields"]));
             foreach (${${"GLOBALS"}["bvoise"]} as ${${"GLOBALS"}["ebkwuuwbj"]} => ${${"GLOBALS"}["ncpssfj"]}) {
                 $vbsuvtx = "value";
                 $umnyphuhq = "key";
                 $wvynkcpns = "value";
                 ${$wvynkcpns}["default"] = trim(VTTemplate::parse(${${"GLOBALS"}["xrfekkrnsds"]}["default"], ${${"GLOBALS"}["yelmdvtnoz"]}));
                 ${${"GLOBALS"}["xhdqpuushyxe"]}[${$umnyphuhq}] = ${$vbsuvtx};
             }
             die(json_encode(array("result" => "startfields", "workflow" => intval($_POST["workflow"]), "fields" => ${${"GLOBALS"}["xhdqpuushyxe"]})));
         }
         if (isset($_POST["startfields"]) && count($_POST["startfields"]) > 0) {
             ${${"GLOBALS"}["nrjakqkxfrj"]} = $_POST["startfields"];
             ${"GLOBALS"}["skiglfir"] = "values";
             ${${"GLOBALS"}["xhdqpuushyxe"]} = array();
             foreach (${${"GLOBALS"}["nrjakqkxfrj"]} as ${${"GLOBALS"}["skiglfir"]}) {
                 $gmmmtwly = "values";
                 ${${"GLOBALS"}["xhdqpuushyxe"]}[${${"GLOBALS"}["xpbanljqm"]}["name"]] = trim(${$gmmmtwly}["value"]);
             }
             $context->setEnvironment("value", ${${"GLOBALS"}["xhdqpuushyxe"]});
         }
         $objWorkflow->setContext(${$rlxpjpocoqi});
         $objWorkflow->start();
         $context->save();
     }
     Workflow2::${${"GLOBALS"}["txnvdyiguy"]} = false;
     ${${"GLOBALS"}["owreihb"]} = array("result" => "ok");
     ${${"GLOBALS"}["mjzlhjsgfwf"]} = $objWorkflow->getSuccessRedirection();
     if (${$etbpjhd} !== false) {
         $sveupbcjtzb = "redirection";
         ${"GLOBALS"}["uzjapaopix"] = "result";
         ${${"GLOBALS"}["uzjapaopix"]}["redirection"] = ${$sveupbcjtzb};
         ${${"GLOBALS"}["owreihb"]}["redirection_target"] = $objWorkflow->getSuccessRedirectionTarget();
     }
     die(json_encode(${$ldobmlfv}));
 }
Exemplo n.º 5
0
 public function process(Vtiger_Request $request)
 {
     $xhqrbyal = "cu_model";
     $awzoousbijac = "result";
     Workflow2::${${"GLOBALS"}["fiflovy"]} = true;
     if (!empty($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) == "xmlhttprequest") {
         Workflow2::${${"GLOBALS"}["sxluqscobil"]} = true;
     }
     $aldkggvnocb = "params";
     ${"GLOBALS"}["qiswqpb"] = "continueExecId";
     ${${"GLOBALS"}["mlokrunke"]} = PearDatabase::getInstance();
     ${"GLOBALS"}["batkhioplbv"] = "allow_parallel";
     $dduumoti = "result";
     ${"GLOBALS"}["aughjdxffu"] = "continueExecId";
     ${$aldkggvnocb} = $request->getAll();
     ${${"GLOBALS"}["fyvmsq"]} = ${$xhqrbyal} = Users_Record_Model::getCurrentUserModel();
     ${"GLOBALS"}["vsxpiyis"] = "requestValues";
     ${${"GLOBALS"}["batkhioplbv"]} = $request->get("allowParallel", "false") === "1";
     ${${"GLOBALS"}["eeennsbvlt"]} = (int) $request->get("workflowID");
     ${${"GLOBALS"}["vsxpiyis"]} = $request->get("requestValues");
     ${${"GLOBALS"}["nztqmvnrgzi"]} = $request->get("requestValuesKey");
     ${${"GLOBALS"}["pajxdehcky"]} = $request->get("continueExecId");
     $hfvpdtq = "sql";
     ${${"GLOBALS"}["qwgmpolil"]} = $request->get("continueBlockId");
     if (strpos(${${"GLOBALS"}["aughjdxffu"]}, "##") !== false) {
         ${"GLOBALS"}["mkuklgbjodtb"] = "continueExecId";
         ${"GLOBALS"}["vpmdfnx"] = "parts";
         $cnibibbpik = "continueExecId";
         ${${"GLOBALS"}["ukdeacyi"]} = explode("##", ${${"GLOBALS"}["mkuklgbjodtb"]});
         ${$cnibibbpik} = ${${"GLOBALS"}["vpmdfnx"]}[0];
         ${${"GLOBALS"}["qwgmpolil"]} = ${${"GLOBALS"}["ukdeacyi"]}[1];
     }
     if (!empty(${${"GLOBALS"}["qiswqpb"]})) {
         $ohjszugmnxs = "requestValuesKey";
         if (${$ohjszugmnxs} == "authPermission") {
             ${"GLOBALS"}["ycnxjrdysji"] = "requestValues";
             ${"GLOBALS"}["zwrvvswpwb"] = "continueExecId";
             $pujwrhxk = "requestValues";
             ${${"GLOBALS"}["qerhyklwh"]} = $this->handleSetPermissions(${${"GLOBALS"}["zwrvvswpwb"]}, ${${"GLOBALS"}["qwgmpolil"]}, ${${"GLOBALS"}["ycnxjrdysji"]});
             if (${${"GLOBALS"}["qerhyklwh"]} === false) {
                 $this->handleReturn();
             }
             ${${"GLOBALS"}["nztqmvnrgzi"]} = "";
             ${$pujwrhxk} = "";
         }
         ${${"GLOBALS"}["sszaqio"]} = \Workflow\Queue::getQueueEntryByExecId(${${"GLOBALS"}["pajxdehcky"]}, ${${"GLOBALS"}["qwgmpolil"]});
         if (${${"GLOBALS"}["sszaqio"]} !== false) {
             $sdfjrtmbv = "workflow";
             \Workflow\Queue::stopEntry(${$sdfjrtmbv});
             ${"GLOBALS"}["vwpxff"] = "requestValuesKey";
             $this->_objWorkflow = ${${"GLOBALS"}["sszaqio"]}["task"]->getWorkflow();
             if (!empty(${${"GLOBALS"}["vwpxff"]})) {
                 $cmiqvsy = "env";
                 ${"GLOBALS"}["qoskdafhutd"] = "workflow";
                 ${"GLOBALS"}["dqxzmxov"] = "env";
                 ${"GLOBALS"}["yfgrwwgyxjh"] = "env";
                 ${${"GLOBALS"}["dqxzmxov"]} = ${${"GLOBALS"}["sszaqio"]}["context"]->getEnvironment("_reqValues");
                 ${"GLOBALS"}["entqbm"] = "requestValues";
                 $cdrbilhs = "workflow";
                 ${$cmiqvsy}[${${"GLOBALS"}["nztqmvnrgzi"]}] = true;
                 ${$cdrbilhs}["context"]->setEnvironment("_reqValues", ${${"GLOBALS"}["rwsybopbofy"]});
                 ${"GLOBALS"}["humlvehh"] = "requestValues";
                 ${${"GLOBALS"}["yfgrwwgyxjh"]} = ${${"GLOBALS"}["sszaqio"]}["context"]->getEnvironment("value");
                 if (!is_array(${${"GLOBALS"}["rwsybopbofy"]})) {
                     ${"GLOBALS"}["kkxlfvg"] = "env";
                     ${${"GLOBALS"}["kkxlfvg"]} = array();
                 }
                 $kvkqyovgu = "env";
                 ${${"GLOBALS"}["wdevzzyv"]} = ${${"GLOBALS"}["ksqrqhcnhk"]}["_fieldtype"];
                 ${"GLOBALS"}["dyfarxu"] = "requestValues";
                 unset(${${"GLOBALS"}["humlvehh"]}["_fieldtype"]);
                 foreach (${${"GLOBALS"}["entqbm"]} as ${${"GLOBALS"}["fxeookd"]} => ${${"GLOBALS"}["bjudgmb"]}) {
                     ${"GLOBALS"}["cwdeawsawnz"] = "fieldTypes";
                     ${"GLOBALS"}["bnsjdgky"] = "requestValues";
                     $kkuxpn = "index";
                     if (!empty(${${"GLOBALS"}["cwdeawsawnz"]}[${${"GLOBALS"}["fxeookd"]}])) {
                         $ulquytqvf = "type";
                         ${"GLOBALS"}["pjngmgj"] = "fieldTypes";
                         $iwcpla = "index";
                         ${"GLOBALS"}["tnxyhf"] = "workflow";
                         ${$ulquytqvf} = \Workflow\Fieldtype::getType(${${"GLOBALS"}["wdevzzyv"]}[${$iwcpla}]);
                         $bygtvss = "index";
                         ${${"GLOBALS"}["bjudgmb"]} = $type->getValue(trim(${${"GLOBALS"}["bjudgmb"]}), ${$bygtvss}, ${${"GLOBALS"}["pjngmgj"]}[${${"GLOBALS"}["fxeookd"]}], ${${"GLOBALS"}["tnxyhf"]}["context"]);
                     }
                     ${${"GLOBALS"}["bnsjdgky"]}[${$kkuxpn}] = trim(${${"GLOBALS"}["bjudgmb"]});
                 }
                 ${$kvkqyovgu} = array_merge(${${"GLOBALS"}["rwsybopbofy"]}, ${${"GLOBALS"}["dyfarxu"]});
                 ${${"GLOBALS"}["qoskdafhutd"]}["context"]->setEnvironment("value", ${${"GLOBALS"}["rwsybopbofy"]});
             }
             try {
                 $fpunbpanmn = "workflow";
                 \Workflow\Queue::runEntry(${$fpunbpanmn});
             } catch (\Exception $exp) {
                 $pqrukkuo = "exp";
                 $this->handleReturn(${$pqrukkuo});
             }
             $this->handleReturn();
             exit;
         }
     }
     ${${"GLOBALS"}["jdijirbbp"]} = "SELECT * FROM vtiger_wf_settings WHERE id = ? AND active = 1";
     ${$dduumoti} = \Workflow\VtUtils::pquery(${$hfvpdtq}, array(${${"GLOBALS"}["eeennsbvlt"]}));
     while (${${"GLOBALS"}["rmniutpwd"]} = $adb->fetch_array(${$awzoousbijac})) {
         ${"GLOBALS"}["ifzwgcvh"] = "user";
         $exbcmtusi = "user";
         if (${${"GLOBALS"}["rmniutpwd"]}["execution_user"] == "0") {
             ${${"GLOBALS"}["rmniutpwd"]}["execution_user"] = $current_user->id;
         }
         ${${"GLOBALS"}["dmcfeolmh"]} = new Users();
         ${"GLOBALS"}["brdhenkjcoeb"] = "context";
         $user->retrieveCurrentUserInfoFromFile(${${"GLOBALS"}["rmniutpwd"]}["execution_user"]);
         ${"GLOBALS"}["eisghylycg"] = "context";
         VTEntity::setUser(${${"GLOBALS"}["ifzwgcvh"]});
         $this->_objWorkflow = new \Workflow\Main(${${"GLOBALS"}["rmniutpwd"]}["id"], false, ${$exbcmtusi});
         $this->_objWorkflow->setExecutionTrigger("WF2_MANUELL");
         if (${${"GLOBALS"}["frhjlwprw"]} == false && $this->_objWorkflow->isRunning($_POST["crmid"])) {
             continue;
         }
         ${${"GLOBALS"}["brdhenkjcoeb"]} = VTEntity::getForId(intval($_POST["crmid"]));
         $this->_objWorkflow->setContext(${${"GLOBALS"}["eisghylycg"]});
         try {
             $this->_objWorkflow->start();
         } catch (\Exception $exp) {
             ${"GLOBALS"}["gikexcyv"] = "exp";
             $this->handleReturn(${${"GLOBALS"}["gikexcyv"]});
         }
         $context->save();
     }
     $this->handleReturn();
 }
Exemplo n.º 6
0
 public static function runEntry($task)
 {
     ${"GLOBALS"}["ctcvcxix"] = "task";
     ${"GLOBALS"}["twqvrmmodsw"] = "sql";
     $prajunbl = "task";
     $acpzqexyj = "task";
     $mbvelou = "task";
     ${"GLOBALS"}["vxedjoslrc"] = "task";
     global $current_user, $adb;
     ${${"GLOBALS"}["vxedjoslrc"]}["task"]->setContinued(true);
     \Workflow\EntityDelta::unserializeDelta(${${"GLOBALS"}["ctcvcxix"]}["delta"]);
     ${"GLOBALS"}["seyqafmvuu"] = "task";
     ${${"GLOBALS"}["xiewdtxiim"]} = ${$acpzqexyj}["task"]->getWorkflow();
     ${${"GLOBALS"}["pbwcpwycwiz"]} = ${${"GLOBALS"}["mhkvecnv"]}["user"];
     ${"GLOBALS"}["iiakuaugsn"] = "task";
     \Workflow\VTEntity::setUser(${${"GLOBALS"}["mhkvecnv"]}["user"]);
     $_SERVER["runningWorkflow" . ${${"GLOBALS"}["mhkvecnv"]}["id"]] = true;
     $wfMain->handleTasks(${${"GLOBALS"}["iiakuaugsn"]}["task"], ${$mbvelou}["task"]->getBlockId());
     ${"GLOBALS"}["mxmobyxw"] = "task";
     ${${"GLOBALS"}["fjvutiy"]} = "DELETE FROM vtiger_wf_queue WHERE id = " . ${${"GLOBALS"}["seyqafmvuu"]}["queue_id"] . "";
     \Workflow\VtUtils::query(${${"GLOBALS"}["fjvutiy"]});
     ${${"GLOBALS"}["twqvrmmodsw"]} = "DELETE FROM vtiger_wf_userqueue WHERE queue_id = " . ${${"GLOBALS"}["mxmobyxw"]}["queue_id"] . "";
     \Workflow\VtUtils::query(${${"GLOBALS"}["fjvutiy"]});
     $_SERVER["runningWorkflow" . ${$prajunbl}["id"]] = false;
     return array("result" => "ok", "redirect_to" => $wfMain->getSuccessRedirection(), "redirect_to_target" => $wfMain->getSuccessRedirectionTarget());
 }
Exemplo n.º 7
0
 ${"GLOBALS"}["bfoyuyip"] = "task";
 $rwlxhqfdu = "current_user";
 ${"GLOBALS"}["qmkfkak"] = "sql";
 $mrnsyuf = "task";
 ${"GLOBALS"}["gzwenlpbces"] = "task";
 ${"GLOBALS"}["qpxefub"] = "task";
 ${"GLOBALS"}["meugpehyrti"] = "sql";
 $eqwykqys = "task";
 ${$eqwykqys}["task"]->setContinued(true);
 $cguolnxdbosn = "task";
 \Workflow\EntityDelta::unserializeDelta(${${"GLOBALS"}["glortx"]}["delta"]);
 ${"GLOBALS"}["tkiyeergxvw"] = "wfMain";
 ${${"GLOBALS"}["tkiyeergxvw"]} = new \Workflow\Main(${${"GLOBALS"}["bfoyuyip"]}["id"], ${${"GLOBALS"}["qultpew"]}["context"], ${${"GLOBALS"}["gzwenlpbces"]}["user"]);
 $wfMain->setExecutionTrigger("WF2_MANUELL");
 ${$rwlxhqfdu} = ${${"GLOBALS"}["qultpew"]}["user"];
 \Workflow\VTEntity::setUser(${${"GLOBALS"}["qpxefub"]}["user"]);
 ${"GLOBALS"}["xekfzyupsc"] = "sql";
 $_SERVER["runningWorkflow" . ${$mrnsyuf}["id"]] = true;
 ${"GLOBALS"}["cnpunorkudj"] = "result";
 try {
     $xphjewohtig = "task";
     $wfMain->handleTasks(${$xphjewohtig}["task"], ${${"GLOBALS"}["qultpew"]}["task"]->getBlockId());
 } catch (\exception $exp) {
     ${"GLOBALS"}["vcteevpx"] = "exp";
     Workflow2::error_handler(${${"GLOBALS"}["vcteevpx"]});
 }
 ${${"GLOBALS"}["xekfzyupsc"]} = "DELETE FROM vtiger_wf_queue WHERE id = " . ${${"GLOBALS"}["qultpew"]}["queue_id"] . "";
 $adb->query(${${"GLOBALS"}["meugpehyrti"]});
 $_SERVER["runningWorkflow" . ${$cguolnxdbosn}["id"]] = false;
 ${${"GLOBALS"}["syfaqkuep"]} = "SELECT id FROM vtiger_wf_queue WHERE execID = '" . $wfMain->getLastExecID() . "'";
 ${"GLOBALS"}["dwueotishfr"] = "result";
Exemplo n.º 8
0
 public function start()
 {
     global $adb, $current_user;
     Workflow2::log($this->_context->getWsId(), $this->_workflowID, 0, "Exec WF");
     ${"GLOBALS"}["bkqjdft"] = "sql";
     ${${"GLOBALS"}["lpkalvdeh"]} = $this->getSettings();
     if (${${"GLOBALS"}["lpkalvdeh"]}["once_per_record"] == "1" && !$this->_context->isDummy()) {
         $inxxzeyok = "dataKey";
         ${"GLOBALS"}["bivgbqxtk"] = "result";
         $qmpoys = "sql";
         ${$inxxzeyok} = "__internal_oncePerRecord_" . $this->getId();
         ${$qmpoys} = "SELECT dataid FROM vtiger_wf_entityddata WHERE crmid = ? AND `key` = ?";
         ${${"GLOBALS"}["bivgbqxtk"]} = $adb->pquery(${${"GLOBALS"}["dutcyticanf"]}, array($this->_context->getId(), ${${"GLOBALS"}["dosuzoyzgm"]}));
         if ($adb->num_rows(${${"GLOBALS"}["jegtsurybn"]}) > 0) {
             return false;
         } else {
             ${"GLOBALS"}["qlpvaphhfspn"] = "sql";
             $icdpopmw = "sql";
             ${$icdpopmw} = "INSERT INTO vtiger_wf_entityddata SET `crmid` = ?, `key` = ?, `value` = ?";
             $adb->pquery(${${"GLOBALS"}["qlpvaphhfspn"]}, array($this->_context->getId(), ${${"GLOBALS"}["dosuzoyzgm"]}, array(serialize(1))), true);
         }
     }
     ${"GLOBALS"}["wbsbbykpc"] = "current_user";
     ${${"GLOBALS"}["wbsbbykpc"]} = $this->getUser();
     $jbjrvuk = "current_user";
     VTEntity::setUser(${$jbjrvuk});
     $skdddiceo = "row";
     $sugjsbwz = "row";
     ${${"GLOBALS"}["dutcyticanf"]} = "SELECT id FROM vtiger_wfp_blocks WHERE workflow_id = " . $this->_workflowID . " AND type='start' LIMIT 1";
     ${${"GLOBALS"}["jegtsurybn"]} = \Workflow\VtUtils::query(${${"GLOBALS"}["bkqjdft"]});
     $xrzjxx = "start";
     ${$sugjsbwz} = $adb->fetch_array(${${"GLOBALS"}["jegtsurybn"]});
     $vrjfwkerv = "start";
     ${$xrzjxx} = \Workflow\Manager::getTaskHandler("start", ${$skdddiceo}["id"], $this);
     $start->setExecId($this->_execID);
     $_SERVER["runningWorkflow" . $this->_workflowID] = true;
     $this->pushExecutionStack(${$vrjfwkerv});
     $this->handleExecutionStack();
     unset($_SERVER["runningWorkflow" . $this->_workflowID]);
     Workflow2::log($this->_context->getWsId(), $this->_workflowID, 0, "Finish WF");
 }
Exemplo n.º 9
0
 public function runById($workflow_id)
 {
     if ($this->_user === false) {
         return "User not found (use: setUser(userid) )";
     }
     \Workflow\VTEntity::setUser($this->_user);
     ${"GLOBALS"}["pgbemxco"] = "file";
     if (!empty($this->_record)) {
         ${"GLOBALS"}["cxlsmwiu"] = "context";
         ${${"GLOBALS"}["cxlsmwiu"]} = \Workflow\VTEntity::getForId($this->_record);
     } else {
         ${${"GLOBALS"}["fcedtroq"]} = \Workflow\VTEntity::getDummy();
     }
     foreach ($this->_files as ${${"GLOBALS"}["pgbemxco"]}) {
         $zjwumoom = "file";
         $dbrvtgaitzld = "file";
         $context->addTempFile(${$zjwumoom}["filepath"], ${${"GLOBALS"}["eidtufqjty"]}["filestoreid"], ${$dbrvtgaitzld}["filename"]);
     }
     ${"GLOBALS"}["wrtluk"] = "obj";
     ${"GLOBALS"}["eeazfhu"] = "workflow_id";
     ${${"GLOBALS"}["wrtluk"]} = new \Workflow\Main(${${"GLOBALS"}["eeazfhu"]}, false, $context->getUser());
     $obj->setExecutionTrigger("WF2_MANUELL");
     $obj->isSubWorkflow(true);
     $obj->setContext(${${"GLOBALS"}["fcedtroq"]});
     $obj->start();
 }