From 843c09238712308c3d64f6ab48a90e31ad16add3 Mon Sep 17 00:00:00 2001 From: "Marco A. Nina Mena" Date: Fri, 13 Nov 2015 11:46:18 -0400 Subject: [PATCH 1/3] =?UTF-8?q?GI-146=20ProcessMap=20no=20se=20despliega?= =?UTF-8?q?=20en=20la=20adecuaci=C3=B3n...=20SOLVED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add validation variables SYS_SYS, SYS_LANG, SYS_SKIN --- workflow/engine/controllers/designer.php | 6 ++++++ workflow/engine/templates/designer/index.html | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/workflow/engine/controllers/designer.php b/workflow/engine/controllers/designer.php index 73cafd8bc..4d9be6067 100644 --- a/workflow/engine/controllers/designer.php +++ b/workflow/engine/controllers/designer.php @@ -84,6 +84,12 @@ class Designer extends Controller $this->setVar('isDebugMode', $debug); $this->setVar("distribution", $distribution); + /*----------------------------------********---------------------------------*/ + $this->setVar("SYS_SYS", SYS_SYS); + $this->setVar("SYS_LANG", SYS_LANG); + $this->setVar("SYS_SKIN", SYS_SKIN); + /*----------------------------------********---------------------------------*/ + if ($debug) { if (! file_exists(PATH_HTML . "lib-dev/pmUI/build.cache")) { throw new RuntimeException("Development JS Files were are not generated!.\nPlease execute: \$>rake pmBuildDebug in pmUI project"); diff --git a/workflow/engine/templates/designer/index.html b/workflow/engine/templates/designer/index.html index c8b15ad30..852b9dbb3 100644 --- a/workflow/engine/templates/designer/index.html +++ b/workflow/engine/templates/designer/index.html @@ -25,6 +25,9 @@ var prj_readonly = "{$prj_readonly}"; var credentials = "{$credentials}"; var distribution = "{$distribution}"; + var SYS_SYS = "{$SYS_SYS}"; + var SYS_LANG = "{$SYS_LANG}"; + var SYS_SKIN = "{$SYS_SKIN}"; @@ -75,6 +78,9 @@ var prj_readonly = "{$prj_readonly}"; var credentials = "{$credentials}"; var distribution = "{$distribution}"; + var SYS_SYS = "{$SYS_SYS}"; + var SYS_LANG = "{$SYS_LANG}"; + var SYS_SKIN = "{$SYS_SKIN}"; From 537791595c6543a1edafbcfcf019d2943518b8da Mon Sep 17 00:00:00 2001 From: Dante Date: Thu, 12 Nov 2015 11:26:09 -0400 Subject: [PATCH 2/3] GI-140 Verificar si una cuenta de correo usa gmail como proveedor fix of code style Code Styling --- workflow/engine/classes/class.pmFunctions.php | 61 ++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 39749d52f..7a86b10dd 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -2902,4 +2902,63 @@ function PMFSaveCurrentData () } return $result; -} \ No newline at end of file +} + + +/** + * @method + * This function determines if the domain of the passed email addres is hosted in + * a gmail server. + * This function test just the domain, so there isn't any validation related to the + * email address existence or validity. + * @param string | $emailAddress | emailAddress that will be examined to determine if it is hosted in Gmail + * @return boolean | $result | true if the emailAddress domain is hosted in gmail, false otherwise + * */ +function isEmailAddressHostedInGmail($emailAddress) { + if (strpos($emailAddress,'@') == false) { + throw new Exception ('the passed email address is not valid'); + } + + $retval = FALSE; + //the accepted domains to accept and address as a gmail account are: + $gmailDomainsRegExp = "/gmail\.com|googlemail\.com/"; + + if (preg_match($gmailDomainsRegExp, $emailAddress) == 1) { + $retval = TRUE; + } + else + { + $domainName = preg_split('/@/', $emailAddress)[1]; + + foreach(getNamedServerMXRecord($domainName) as $emailServer) { + if (preg_match($gmailDomainsRegExp, $emailServer) == 1) { + $retval = TRUE; + } + } + } + return $retval; +} + + +/** + * @method + * Returns an array with the Mail Exchanger info of a Named Domain + * a gmail server. + * This function test just the domain, so there isn't any validation related to the + * email address existence or validity. + * @param string | $domainName | Domain Name e.g. processmaker.com + * @return array | $result | array + * */ +function getNamedServerMXRecord($domainName) { + + //in some windows distributions getmxxr does not exist, so if this happens, a wrapper function + //is created. + if (!function_exists('getmxrr')) { + function getmxrr($hostname, &$mxhosts, &$mxweight=false) { + return win_getmxrr($hostname, $mxhosts, $mxweight); + } + } + $mailExchangerHosts = array(); + getmxrr($domainName, $mailExchangerHosts); + return $mailExchangerHosts; +} From 3b10f3dcf49ce7eafb70c263f616f544da842cbc Mon Sep 17 00:00:00 2001 From: Dante Date: Tue, 17 Nov 2015 09:24:08 -0400 Subject: [PATCH 3/3] fix of code style 2 --- workflow/engine/classes/class.pmFunctions.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 7a86b10dd..43de46bd7 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -2925,9 +2925,7 @@ function isEmailAddressHostedInGmail($emailAddress) { if (preg_match($gmailDomainsRegExp, $emailAddress) == 1) { $retval = TRUE; - } - else - { + } else { $domainName = preg_split('/@/', $emailAddress)[1]; foreach(getNamedServerMXRecord($domainName) as $emailServer) { @@ -2958,6 +2956,7 @@ function getNamedServerMXRecord($domainName) { return win_getmxrr($hostname, $mxhosts, $mxweight); } } + $mailExchangerHosts = array(); getmxrr($domainName, $mailExchangerHosts); return $mailExchangerHosts;