From f9b7c0ecaca6cbbbfdc774707b1ef547493704d3 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Fri, 4 May 2012 12:01:42 -0400 Subject: [PATCH] BUG 8962 "The Events not being executed on 'cron.php'" SOLVED - Problem in "Resending emails" - Not being properly authenticating with the mail server - Solved the problem with authentication with the mail server - The problem with the file "processmaker/workflow/engine/bin/plugins/ldapadvancedbck.php" could not replicate, because this file does not belong to any plugin of the enterprise-plugin, it is noted that the cron.php runs all the files that are on "processmaker/workflow/engine/bin/plugins" and uses the class "...ClassCron" for each file, executing the corresponding method --- workflow/engine/classes/class.spool.php | 41 +++++++++++++--------- workflow/engine/controllers/adminProxy.php | 4 +++ 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/workflow/engine/classes/class.spool.php b/workflow/engine/classes/class.spool.php index 7bcc34485..53c1aee74 100755 --- a/workflow/engine/classes/class.spool.php +++ b/workflow/engine/classes/class.spool.php @@ -498,26 +498,35 @@ class spoolRun { * @return none or exception */ function resendEmails() { + require_once ("classes/model/Configuration.php"); - require_once 'classes/model/Configuration.php'; $oConfiguration = new Configuration(); - $aConfiguration = $oConfiguration->load('Emails', '', '', '', ''); - $aConfiguration = unserialize($aConfiguration['CFG_VALUE']); - $passwd = $aConfiguration['MESS_PASSWORD']; - $passwdDec = G::decrypt($passwd,'EMAILENCRYPT'); - if (strpos( $passwdDec, 'hash:' ) !== false) { - list($hash, $pass) = explode(":", $passwdDec); - $this->config['MESS_PASSWORD'] = $pass; + + $aConfiguration = $oConfiguration->load("Emails", "", "", "", ""); + + $aConfiguration = unserialize($aConfiguration["CFG_VALUE"]); + $passwd = $aConfiguration["MESS_PASSWORD"]; + $passwdDec = G::decrypt($passwd,"EMAILENCRYPT"); + + if (strpos($passwdDec, "hash:") !== false) { + list($hash, $pass) = explode(":", $passwdDec); + $aConfiguration["MESS_PASSWORD"] = $pass; } - if( $aConfiguration['MESS_ENABLED'] == '1' ) { - $this->setConfig(array ( - 'MESS_ENGINE' => $aConfiguration['MESS_ENGINE'], - 'MESS_SERVER' => $aConfiguration['MESS_SERVER'], - 'MESS_PORT' => $aConfiguration['MESS_PORT'], - 'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'], - 'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'] + + if ($aConfiguration["MESS_ENABLED"] == "1") { + $this->setConfig(array( + "MESS_ENGINE" => $aConfiguration["MESS_ENGINE"], + "MESS_SERVER" => $aConfiguration["MESS_SERVER"], + "MESS_PORT" => $aConfiguration["MESS_PORT"], + "MESS_ACCOUNT" => $aConfiguration["MESS_ACCOUNT"], + "MESS_PASSWORD" => $aConfiguration["MESS_PASSWORD"], + "SMTPAuth" => $aConfiguration["MESS_RAUTH"], + "SMTPSecure" => $aConfiguration["SMTPSecure"] )); - require_once 'classes/model/AppMessage.php'; + + /////// + require_once ("classes/model/AppMessage.php"); + $oCriteria = new Criteria('workflow'); $oCriteria->add(AppMessagePeer::APP_MSG_STATUS, 'sent', Criteria::NOT_EQUAL); $oDataset = AppMessagePeer::doSelectRS($oCriteria); diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index 50161ed9b..e933aaa2b 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -485,6 +485,10 @@ class adminProxy extends HttpProxyController $_POST['SMTPAuth'] = false; } + if (strtolower($_POST["UseSecureCon"]) != "no") { + $_POST["SMTPSecure"] = $_POST["UseSecureCon"]; + } + if ($_POST['UseSecureCon'] == 'ssl') { $_POST['MESS_SERVER'] = 'ssl://'.$_POST['MESS_SERVER']; }