From c5f64246f47b70585c8c599c7d20013d53cb25ec Mon Sep 17 00:00:00 2001 From: Brayan Pereyra Date: Tue, 7 Apr 2015 16:53:08 -0400 Subject: [PATCH 01/13] PM-2107 Deshabilitar el autocompletado del login --- gulliver/system/class.xmlform.php | 43 +++++++++++-------- .../engine/xmlform/login/forgotPassword.xml | 4 +- workflow/engine/xmlform/login/login.html | 13 +++--- workflow/engine/xmlform/login/login.xml | 22 +++++----- .../engine/xmlform/login/sysLoginNoWS.xml | 18 ++++++-- 5 files changed, 59 insertions(+), 41 deletions(-) diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 73b519c94..5f2c36a66 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -1109,6 +1109,7 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText public $replaceTags = 0; public $renderMode = ''; public $comma_separator = '.'; + public $autocomplete = "on"; /** * Function render @@ -1121,6 +1122,13 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText */ public function render ($value = null, $owner = null) { + if ($this->autocomplete === '1') { + $this->autocomplete = "on"; + } else { + if ($this->autocomplete === '0') { + $this->autocomplete = "off"; + } + } if ($this->renderMode == '') { $this->renderMode = $this->mode; } @@ -1168,6 +1176,7 @@ class XmlForm_Field_Text extends XmlForm_Field_SimpleText $html .= 'id="form[' . $this->name . ']" '; $html .= 'name="form[' . $this->name . ']" '; $html .= 'type="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" '; + $html .= 'autocomplete="' . $this->autocomplete . '" '; $html .= 'value="' . $this->htmlentities( $value, ENT_QUOTES, 'utf-8' ) . '" '; $html .= 'style="' . $this->htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" '; $html .= 'onkeypress="' . $this->htmlentities( $onkeypress, ENT_COMPAT, 'utf-8' ) . '" '; @@ -4827,23 +4836,23 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText /* //Year - %Y year with the century - %y year without the century (range 00 to 99) - //Month - %m month, range 01 to 12 - %B full month name - %b abbreviated month name - //Day - %d the day of the month (range 01 to 31) - %e the day of the month (range 1 to 31) - //Hour - %H hour, range 00 to 23 (24h format) - %I hour, range 01 to 12 (12h format) - %k hour, range 0 to 23 (24h format) - %l hour, range 1 to 12 (12h format) - //Min - %M minute, range 00 to 59 - //Sec + %Y year with the century + %y year without the century (range 00 to 99) + //Month + %m month, range 01 to 12 + %B full month name + %b abbreviated month name + //Day + %d the day of the month (range 01 to 31) + %e the day of the month (range 1 to 31) + //Hour + %H hour, range 00 to 23 (24h format) + %I hour, range 01 to 12 (12h format) + %k hour, range 0 to 23 (24h format) + %l hour, range 1 to 12 (12h format) + //Min + %M minute, range 00 to 59 + //Sec %S seconds, range 00 to 59 */ function date_create_from_format( $dformat, $dvalue, $withHours = false ) diff --git a/workflow/engine/xmlform/login/forgotPassword.xml b/workflow/engine/xmlform/login/forgotPassword.xml index f33c100fa..015f67cc1 100755 --- a/workflow/engine/xmlform/login/forgotPassword.xml +++ b/workflow/engine/xmlform/login/forgotPassword.xml @@ -3,10 +3,10 @@ <en><![CDATA[I forgot my password]]></en> - + - + diff --git a/workflow/engine/xmlform/login/login.html b/workflow/engine/xmlform/login/login.html index c0b57c92c..fe97cc24a 100755 --- a/workflow/engine/xmlform/login/login.html +++ b/workflow/engine/xmlform/login/login.html @@ -6,6 +6,7 @@ +
{$form.USR_PASSWORD}
@@ -15,8 +16,8 @@ - - + + @@ -37,12 +38,10 @@
{$form.TITLE}{$form.USR_USERNAME}
{$USR_PASSWORD}{$form.USR_PASSWORD}{$USR_PASSWORD_MASK}{$form.USR_PASSWORD_MASK}
{$USER_LANG}
- - - - + \ No newline at end of file diff --git a/workflow/engine/xmlform/login/login.xml b/workflow/engine/xmlform/login/login.xml index fe24f8e73..54fb684f2 100755 --- a/workflow/engine/xmlform/login/login.xml +++ b/workflow/engine/xmlform/login/login.xml @@ -3,19 +3,22 @@ <en><![CDATA[Login]]></en> - + - + + + + SELECT LANG_ID, LANG_NAME FROM langOptions - + @@ -84,14 +87,11 @@ var dynaformOnload = function() { }; leimnud.event.add(document.getElementById('form[BSUBMIT]'), 'click', function() { - setNestedProperty(this, Array('disabled'), 'true'); - setNestedProperty(this, Array('value'), @@LOGIN_VERIFY_MSG); - - var client = getBrowserClient(); - - if (client.browser != "firefox") { - document.login.submit(); - } + document.getElementById('form[USR_PASSWORD]').value = document.getElementById('form[USR_PASSWORD_MASK]').value; + document.getElementById('form[USR_PASSWORD_MASK]').value = ''; + document.getElementById('form[USR_PASSWORD_MASK]').setAttribute('type', 'text'); + document.login.submit(); + //return true; }.extend(document.getElementById('form[BSUBMIT]'))); ]]> diff --git a/workflow/engine/xmlform/login/sysLoginNoWS.xml b/workflow/engine/xmlform/login/sysLoginNoWS.xml index 7e24eebde..8e854da06 100755 --- a/workflow/engine/xmlform/login/sysLoginNoWS.xml +++ b/workflow/engine/xmlform/login/sysLoginNoWS.xml @@ -3,20 +3,23 @@ <en><![CDATA[Login]]></en> - + - + - + + + + SELECT LANG_ID, LANG_NAME FROM langOptions - + Date: Tue, 7 Apr 2015 17:16:45 -0400 Subject: [PATCH 02/13] I solved the issue PM-1942 added label by yesno field --- gulliver/system/class.form.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gulliver/system/class.form.php b/gulliver/system/class.form.php index d45e04ee0..f37a8dd33 100755 --- a/gulliver/system/class.form.php +++ b/gulliver/system/class.form.php @@ -478,6 +478,14 @@ class Form extends XmlForm } } break; + case 'yesno': + $values[$k] = $newValues[$k]; + if($newValues[$k] == 1){ + $values[$k . "_label"] = 'Yes'; + } else { + $values[$k . "_label"] = 'No'; + } + break; case "link": $values[$k] = $newValues[$k]; $values[$k . "_label"] = $newValues[$k . "_label"]; From 7ce9ffd6a234a9b4d9671fff55a0cdbf7f7621e7 Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Wed, 8 Apr 2015 09:04:19 -0400 Subject: [PATCH 03/13] I corrected the label by yesno field --- gulliver/system/class.form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulliver/system/class.form.php b/gulliver/system/class.form.php index f37a8dd33..cf8faf2b2 100755 --- a/gulliver/system/class.form.php +++ b/gulliver/system/class.form.php @@ -481,9 +481,9 @@ class Form extends XmlForm case 'yesno': $values[$k] = $newValues[$k]; if($newValues[$k] == 1){ - $values[$k . "_label"] = 'Yes'; + $values[$k . "_label"] = G::LoadTranslation('ID_FIELD_DYNAFORM_YES_LABEL'); } else { - $values[$k . "_label"] = 'No'; + $values[$k . "_label"] = G::LoadTranslation('ID_FIELD_DYNAFORM_NO_LABEL'); } break; case "link": From 4531071f8c192ed31b77b9eb576b8a8a7016776e Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Wed, 8 Apr 2015 10:53:46 -0400 Subject: [PATCH 04/13] I correted ID --- gulliver/system/class.form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulliver/system/class.form.php b/gulliver/system/class.form.php index cf8faf2b2..63e3fd5bf 100755 --- a/gulliver/system/class.form.php +++ b/gulliver/system/class.form.php @@ -481,9 +481,9 @@ class Form extends XmlForm case 'yesno': $values[$k] = $newValues[$k]; if($newValues[$k] == 1){ - $values[$k . "_label"] = G::LoadTranslation('ID_FIELD_DYNAFORM_YES_LABEL'); + $values[$k . "_label"] = G::LoadTranslation('ID_YES_VALUE'); } else { - $values[$k . "_label"] = G::LoadTranslation('ID_FIELD_DYNAFORM_NO_LABEL'); + $values[$k . "_label"] = G::LoadTranslation('ID_NO_VALUE'); } break; case "link": From 7214ee704b6190cc07206178ee22770b15b80131 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Wed, 8 Apr 2015 11:36:38 -0400 Subject: [PATCH 05/13] PM-2108 "The usr_cnf_pass parameter should..." SOLVED > Code Issue: The usr_cnf_pass parameter should be optional in the endpoint POST /api/1.0/{workspace}/user > Solution: El parametro "usr_cnf_pass" en POST y PUT no es requerido. --- .../src/ProcessMaker/BusinessModel/User.php | 25 ++++++------------- .../src/ProcessMaker/Services/Api/User.php | 3 --- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/User.php b/workflow/engine/src/ProcessMaker/BusinessModel/User.php index bc9607d6f..1a8e0fc51 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/User.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/User.php @@ -24,7 +24,6 @@ class User "USR_STATUS" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array("ACTIVE", "INACTIVE", "VACATION"), "fieldNameAux" => "usrStatus"), "USR_ROLE" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "usrRole"), "USR_NEW_PASS" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "usrNewPass"), - "USR_CNF_PASS" => array("type" => "string", "required" => true, "empty" => false, "defaultValues" => array(), "fieldNameAux" => "usrCnfPass"), "USR_UX" => array("type" => "string", "required" => false, "empty" => false, "defaultValues" => array("NORMAL", "SIMPLIFIED", "SWITCHABLE", "SINGLE"), "fieldNameAux" => "usrUx"), "DEP_UID" => array("type" => "string", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "depUid"), "USR_BIRTHDAY" => array("type" => "date", "required" => false, "empty" => true, "defaultValues" => array(), "fieldNameAux" => "usrBirthday"), @@ -216,14 +215,6 @@ class User if (isset($arrayData["USR_NEW_PASS"])) { $this->throwExceptionIfPasswordIsInvalid($arrayData["USR_NEW_PASS"], $this->arrayFieldNameForException["usrNewPass"]); - - if (!isset($arrayData["USR_CNF_PASS"])) { - throw new \Exception(\G::LoadTranslation("ID_UNDEFINED_VALUE_IS_REQUIRED", array($this->arrayFieldNameForException["usrCnfPass"]))); - } - - if ($arrayData["USR_NEW_PASS"] != $arrayData["USR_CNF_PASS"]) { - throw new \Exception($this->arrayFieldNameForException["usrNewPass"] . ", " . $this->arrayFieldNameForException["usrCnfPass"] . ": " . \G::LoadTranslation("ID_NEW_PASS_SAME_OLD_PASS")); - } } if (isset($arrayData["USR_REPLACED_BY"]) && $arrayData["USR_REPLACED_BY"] != "") { @@ -609,13 +600,13 @@ class User $userProperty = new \UsersProperties(); $aUserProperty = $userProperty->loadOrCreateIfNotExists($userUid, array("USR_PASSWORD_HISTORY" => serialize(array(\Bootstrap::hashPassword($arrayData["USR_PASSWORD"]))))); - //$memKey = "rbacSession" . session_id(); - //$memcache = & \PMmemcached::getSingleton(defined("SYS_SYS")? SYS_SYS : ""); - // - //if (($rbac->aUserInfo = $memcache->get($memKey)) == false) { - // $rbac->loadUserRolePermission("PROCESSMAKER", $userUidLogged); - // $memcache->set($memKey, $rbac->aUserInfo, \PMmemcached::EIGHT_HOURS); - //} + $memKey = "rbacSession" . session_id(); + $memcache = & \PMmemcached::getSingleton(defined("SYS_SYS")? SYS_SYS : ""); + + if (($rbac->aUserInfo = $memcache->get($memKey)) == false) { + $rbac->loadUserRolePermission("PROCESSMAKER", $userUidLogged); + $memcache->set($memKey, $rbac->aUserInfo, \PMmemcached::EIGHT_HOURS); + } if ($rbac->aUserInfo["PROCESSMAKER"]["ROLE"]["ROL_CODE"] == "PROCESSMAKER_ADMIN") { $aUserProperty["USR_LAST_UPDATE_DATE"] = date("Y-m-d H:i:s"); @@ -651,7 +642,7 @@ class User $sDescription = $sDescription . " - " . G::LoadTranslation("PASSWORD_HISTORY") . ": " . PPP_PASSWORD_HISTORY . "\n"; $sDescription = $sDescription . "\n" . G::LoadTranslation("ID_PLEASE_CHANGE_PASSWORD_POLICY") . ""; - throw new \Exception($this->arrayFieldNameForException["usrNewPass"] . ", " . $this->arrayFieldNameForException["usrCnfPass"] . ": " . $sDescription); + throw new \Exception($this->arrayFieldNameForException["usrNewPass"] . ": " . $sDescription); } if (count($aHistory) >= PPP_PASSWORD_HISTORY) { diff --git a/workflow/engine/src/ProcessMaker/Services/Api/User.php b/workflow/engine/src/ProcessMaker/Services/Api/User.php index 28d578bf3..6a2fb83c4 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/User.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/User.php @@ -75,8 +75,6 @@ class User extends Api $userLoggedUid = $this->getUserId(); $user = new \ProcessMaker\BusinessModel\User(); $arrayData = $user->update($usr_uid, $request_data, $userLoggedUid); - $response = $arrayData; - return $response; } catch (\Exception $e) { throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); } @@ -113,4 +111,3 @@ class User extends Api } } } - From 4f395793cb522756fc4445d016cc432a28cb2b58 Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Wed, 8 Apr 2015 15:47:39 -0400 Subject: [PATCH 06/13] I correct High - Code Injection(7 flaws) (8 April Report) --- workflow/public_html/bootstrap.php | 13 +++++++++++-- workflow/public_html/sysGeneric.php | 15 +++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/workflow/public_html/bootstrap.php b/workflow/public_html/bootstrap.php index 8c44ad0bb..cb9447084 100755 --- a/workflow/public_html/bootstrap.php +++ b/workflow/public_html/bootstrap.php @@ -266,6 +266,10 @@ G::LoadSystem('headPublisher'); $oHeadPublisher =& headPublisher::getSingleton(); + //Load filter class + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + // Installer, redirect to install if we don't have a valid shared data folder if ( !defined('PATH_DATA') || !file_exists(PATH_DATA)) { @@ -331,12 +335,15 @@ else { //when we are in global pages, outside any valid workspace if (SYS_TARGET==='newSite') { $phpFile = G::ExpandPath('methods') . SYS_COLLECTION . "/" . SYS_TARGET.'.php'; + $phpFile = $filter->validateInput($phpFile,'path'); require_once($phpFile); die(); } else { if(SYS_TARGET=="dbInfo"){ //Show dbInfo when no SYS_SYS - require_once( PATH_METHODS . "login/dbInfo.php" ); + $pathFile = PATH_METHODS . "login/dbInfo.php"; + $pathFile = $filter->validateInput($pathFile,'path'); + require_once($pathFile); } else{ @@ -352,7 +359,9 @@ } } else { // classic sysLogin interface - require_once( PATH_METHODS . "login/sysLogin.php" ) ; + $pathFile = PATH_METHODS . "login/sysLogin.php"; + $pathFile = $filter->validateInput($pathFile,'path'); + require_once($pathFile) ; die(); } } diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 56cf5734a..908fd1988 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -564,6 +564,7 @@ if (defined( 'SYS_TEMP' ) && SYS_TEMP != '') { } else { //when we are in global pages, outside any valid workspace if (SYS_TARGET === 'newSite') { $phpFile = G::ExpandPath( 'methods' ) . SYS_COLLECTION . "/" . SYS_TARGET . '.php'; + $phpFile = $filter->validateInput($phpFile,'path'); //NewRelic Snippet - By JHL transactionLog($phpFile); require_once ($phpFile); @@ -725,6 +726,10 @@ $bWE = false; $isControllerCall = false; $isPluginController = false; +//Load filter class +G::LoadSystem('inputfilter'); +$filter = new InputFilter(); + if (substr( SYS_COLLECTION, 0, 8 ) === 'gulliver') { $phpFile = PATH_GULLIVER_HOME . 'methods/' . substr( SYS_COLLECTION, 8 ) . SYS_TARGET . '.php'; } else { @@ -786,14 +791,16 @@ if (substr( SYS_COLLECTION, 0, 8 ) === 'gulliver') { $pluginControllerPath = PATH_PLUGINS . $pluginName . PATH_SEP . 'controllers' . PATH_SEP; - if (is_file($pluginControllerPath. $controllerClass . '.php')) { - require_once $pluginControllerPath. $controllerClass . '.php'; + $pathFile = $pluginControllerPath. $controllerClass . '.php'; + $pathFile = $filter->validateInput($pathFile,'path'); + if (is_file($pathFile)) { + require_once $pathFile; } elseif (is_file($pluginControllerPath. ucfirst($controllerClass) . '.php')) { $controllerClass = ucfirst($controllerClass); - require_once $pluginControllerPath. $controllerClass . '.php'; + require_once $pathFile; } elseif (is_file($pluginControllerPath. ucfirst($controllerClass) . 'Controller.php')) { $controllerClass = ucfirst($controllerClass) . 'Controller'; - require_once $pluginControllerPath. $controllerClass . '.php'; + require_once $pathFile; } //if the method exists From 14d32cc29e47a4e84b98a3492befe7e9a2507ea1 Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Wed, 8 Apr 2015 15:50:55 -0400 Subject: [PATCH 07/13] I correct High - Code Injection(7 flaws) (8 April Report) --- workflow/public_html/sysGeneric.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 908fd1988..e93105a23 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -373,6 +373,10 @@ $virtualURITable['/skins/(*)'] = PATH_HTML . 'skins/'; //ugly $virtualURITable['/images/(*)'] = PATH_HTML . 'images/'; //ugly $virtualURITable['/[a-zA-Z][a-zA-Z0-9]{0,}/'] = 'errorFile'; +//Load filter class +G::LoadSystem('inputfilter'); +$filter = new InputFilter(); + // Verify if we need to redirect or stream the file, if G:VirtualURI returns true means we are going to redirect the page if (Bootstrap::virtualURI( $_SERVER['REQUEST_URI'], $virtualURITable, $realPath )) { // review if the file requested belongs to public_html plugin @@ -726,10 +730,6 @@ $bWE = false; $isControllerCall = false; $isPluginController = false; -//Load filter class -G::LoadSystem('inputfilter'); -$filter = new InputFilter(); - if (substr( SYS_COLLECTION, 0, 8 ) === 'gulliver') { $phpFile = PATH_GULLIVER_HOME . 'methods/' . substr( SYS_COLLECTION, 8 ) . SYS_TARGET . '.php'; } else { From 3b624e4a020d85adf8a625834514ad24dff178e5 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Wed, 8 Apr 2015 16:13:24 -0400 Subject: [PATCH 08/13] PM-2109 "REST endpoint PUT /cases/{app_uid}/unpause..." SOLVED > Code Issue: REST endpoint PUT /cases/{app_uid}/unpause can be called on a case which isn't paused > Solution: Se agrega validacion cuando un caso NO esta pausado se mostrara un mensaje. --- workflow/engine/src/ProcessMaker/BusinessModel/Cases.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 7509ff9f3..d5d610404 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -811,6 +811,12 @@ class Cases } Validator::isInteger($del_index, '$del_index'); + $oDelay = new \AppDelay(); + + if (!$oDelay->isPaused($app_uid, $del_index)) { + throw (new \Exception(\G::LoadTranslation("ID_CASE_NOT_PAUSED", array($app_uid)))); + } + $case = new \Cases(); $case->unpauseCase( $app_uid, $del_index, $usr_uid ); } From a67169c5fedc8cbdfc7a8a83481ed4a7538dc51c Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Wed, 8 Apr 2015 17:35:40 -0400 Subject: [PATCH 09/13] I solved Cryptographic Issues in Thirdparty --- gulliver/thirdparty/creole/Creole.php | 11 ++++++- gulliver/thirdparty/geshi/geshi.php | 11 ++++++- .../html2ps_pdf/box.checkbutton.php | 11 ++++++- .../html2ps_pdf/box.radiobutton.php | 11 ++++++- .../html2ps_pdf/css.cache.class.php | 11 ++++++- .../thirdparty/html2ps_pdf/image.class.php | 11 ++++++- gulliver/thirdparty/pear/Log/console.php | 11 ++++++- gulliver/thirdparty/pear/Log/daemon.php | 11 ++++++- gulliver/thirdparty/pear/Log/display.php | 11 ++++++- gulliver/thirdparty/pear/Log/error_log.php | 11 ++++++- gulliver/thirdparty/pear/Log/file.php | 11 ++++++- gulliver/thirdparty/pear/Log/firebug.php | 11 ++++++- gulliver/thirdparty/pear/Log/mail.php | 11 ++++++- gulliver/thirdparty/pear/Log/mcal.php | 11 ++++++- gulliver/thirdparty/pear/Log/mdb2.php | 11 ++++++- gulliver/thirdparty/pear/Log/null.php | 11 ++++++- gulliver/thirdparty/pear/Net/DIME.php | 22 +++++++++++-- .../pear/Net/UserAgent/Detect/APC.php | 11 ++++++- gulliver/thirdparty/pear/PEAR/Installer.php | 22 +++++++++++-- gulliver/thirdparty/pear/class.wsdlcache.php | 26 ++++++++++++--- .../thirdparty/phpmailer/class.phpmailer.php | 33 +++++++++++++++++-- gulliver/thirdparty/propel/om/BaseObject.php | 13 ++++++-- gulliver/thirdparty/propel/util/Criteria.php | 17 +++++++--- gulliver/thirdparty/tcpdf/2dbarcodes.php | 11 ++++++- 24 files changed, 296 insertions(+), 35 deletions(-) diff --git a/gulliver/thirdparty/creole/Creole.php b/gulliver/thirdparty/creole/Creole.php index 175878527..7d6185ce1 100755 --- a/gulliver/thirdparty/creole/Creole.php +++ b/gulliver/thirdparty/creole/Creole.php @@ -189,10 +189,19 @@ class Creole { trigger_error("The Creole::NO_ASSOC_LOWER flag has been deprecated, and is now the default behavior. Use Creole::COMPAT_ASSOC_LOWER to lowercase resulset keys.", E_USER_WARNING); } + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // sort $dsninfo by keys so the serialized result is always the same // for identical connection parameters, no matter what their order is ksort($dsninfo); - $connectionMapKey = crc32(serialize($dsninfo + array('compat_flags' => ($flags & Creole::COMPAT_ALL)))); + $connectionMapKey = G::encryptCrc32(serialize($dsninfo + array('compat_flags' => ($flags & Creole::COMPAT_ALL)))); // see if we already have a connection with these parameters cached if(isset(self::$connectionMap[$connectionMapKey]) && $dsninfo['phptype'] !== 'dbarray') diff --git a/gulliver/thirdparty/geshi/geshi.php b/gulliver/thirdparty/geshi/geshi.php index 31d2da49f..a97b012ec 100755 --- a/gulliver/thirdparty/geshi/geshi.php +++ b/gulliver/thirdparty/geshi/geshi.php @@ -3738,10 +3738,19 @@ class GeSHi { /** NOTE: memorypeak #1 */ $parsed_code = preg_replace('#]+>(\s*)#', '\\1', $parsed_code); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // If we are using IDs for line numbers, there needs to be an overall // ID set to prevent collisions. if ($this->add_ids && !$this->overall_id) { - $this->overall_id = 'geshi-' . substr(md5(microtime()), 0, 4); + $this->overall_id = 'geshi-' . substr(G::encryptOld(microtime()), 0, 4); } // Get code into lines diff --git a/gulliver/thirdparty/html2ps_pdf/box.checkbutton.php b/gulliver/thirdparty/html2ps_pdf/box.checkbutton.php index f38028a91..4e358d4d3 100755 --- a/gulliver/thirdparty/html2ps_pdf/box.checkbutton.php +++ b/gulliver/thirdparty/html2ps_pdf/box.checkbutton.php @@ -57,11 +57,20 @@ class CheckBox extends GenericFormattedBox { * @see CheckBox::CheckBox() */ function &create(&$root, &$pipeline) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $value = $root->get_attribute('value'); if (trim($value) == "") { error_log("Checkbox with empty 'value' attribute"); - $value = sprintf("___Value%s",md5(time().rand())); + $value = sprintf("___Value%s",G::encryptOld(time().rand())); }; $box =& new CheckBox($root->has_attribute('checked'), diff --git a/gulliver/thirdparty/html2ps_pdf/box.radiobutton.php b/gulliver/thirdparty/html2ps_pdf/box.radiobutton.php index 026a39d26..6e8cccdf8 100755 --- a/gulliver/thirdparty/html2ps_pdf/box.radiobutton.php +++ b/gulliver/thirdparty/html2ps_pdf/box.radiobutton.php @@ -19,12 +19,21 @@ class RadioBox extends SimpleInlineBox { var $_value; function &create(&$root, &$pipeline) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $checked = $root->has_attribute('checked'); $value = $root->get_attribute('value'); if (trim($value) == "") { error_log("Radiobutton with empty 'value' attribute"); - $value = sprintf("___Value%s",md5(time().rand())); + $value = sprintf("___Value%s",G::encryptOld(time().rand())); }; $css_state = $pipeline->getCurrentCSSState(); diff --git a/gulliver/thirdparty/html2ps_pdf/css.cache.class.php b/gulliver/thirdparty/html2ps_pdf/css.cache.class.php index 7152b3869..d9fe80a1d 100755 --- a/gulliver/thirdparty/html2ps_pdf/css.cache.class.php +++ b/gulliver/thirdparty/html2ps_pdf/css.cache.class.php @@ -15,7 +15,16 @@ class CSSCache { } function _getCacheFilename($url) { - return CACHE_DIR.md5($url).'.css.compiled'; + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return CACHE_DIR.G::encryptOld($url).'.css.compiled'; } function _isCached($url) { diff --git a/gulliver/thirdparty/html2ps_pdf/image.class.php b/gulliver/thirdparty/html2ps_pdf/image.class.php index 91949db79..78e8b572c 100755 --- a/gulliver/thirdparty/html2ps_pdf/image.class.php +++ b/gulliver/thirdparty/html2ps_pdf/image.class.php @@ -80,7 +80,16 @@ class Image { // allowed file name length (especially after escaping specialy symbols) // thus, we generate long almost random 32-character name using the md5 hash function // - return CACHE_DIR.md5(time() + $url + rand()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return CACHE_DIR.G::encryptOld(time() + $url + rand()); } // Checks if cache directory is available diff --git a/gulliver/thirdparty/pear/Log/console.php b/gulliver/thirdparty/pear/Log/console.php index 0c1f9b685..a52c15a57 100755 --- a/gulliver/thirdparty/pear/Log/console.php +++ b/gulliver/thirdparty/pear/Log/console.php @@ -67,7 +67,16 @@ class Log_console extends Log function Log_console($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/daemon.php b/gulliver/thirdparty/pear/Log/daemon.php index 9873f2a40..07ca7a832 100755 --- a/gulliver/thirdparty/pear/Log/daemon.php +++ b/gulliver/thirdparty/pear/Log/daemon.php @@ -74,7 +74,16 @@ class Log_daemon extends Log $name = LOG_SYSLOG; } - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_name = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/display.php b/gulliver/thirdparty/pear/Log/display.php index da8291a27..fb3667e09 100755 --- a/gulliver/thirdparty/pear/Log/display.php +++ b/gulliver/thirdparty/pear/Log/display.php @@ -54,7 +54,16 @@ class Log_display extends Log function Log_display($name = '', $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/error_log.php b/gulliver/thirdparty/pear/Log/error_log.php index 117e96c48..412f4cac9 100755 --- a/gulliver/thirdparty/pear/Log/error_log.php +++ b/gulliver/thirdparty/pear/Log/error_log.php @@ -52,7 +52,16 @@ class Log_error_log extends Log function Log_error_log($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_type = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/file.php b/gulliver/thirdparty/pear/Log/file.php index d0d03eeeb..fa352bcb0 100755 --- a/gulliver/thirdparty/pear/Log/file.php +++ b/gulliver/thirdparty/pear/Log/file.php @@ -98,7 +98,16 @@ class Log_file extends Log function Log_file($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_filename = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/firebug.php b/gulliver/thirdparty/pear/Log/firebug.php index 9f013f684..1dea4a7f5 100755 --- a/gulliver/thirdparty/pear/Log/firebug.php +++ b/gulliver/thirdparty/pear/Log/firebug.php @@ -81,7 +81,16 @@ class Log_firebug extends Log function Log_firebug($name = '', $ident = 'PHP', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); if (isset($conf['buffering'])) { diff --git a/gulliver/thirdparty/pear/Log/mail.php b/gulliver/thirdparty/pear/Log/mail.php index d4eea6c67..51538ae52 100755 --- a/gulliver/thirdparty/pear/Log/mail.php +++ b/gulliver/thirdparty/pear/Log/mail.php @@ -103,7 +103,16 @@ class Log_mail extends Log function Log_mail($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_recipients = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/mcal.php b/gulliver/thirdparty/pear/Log/mcal.php index ab88d457e..f2832cf48 100755 --- a/gulliver/thirdparty/pear/Log/mcal.php +++ b/gulliver/thirdparty/pear/Log/mcal.php @@ -74,7 +74,16 @@ class Log_mcal extends Log function Log_mcal($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_name = $name; $this->_ident = $ident; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/mdb2.php b/gulliver/thirdparty/pear/Log/mdb2.php index cc06787a3..34d35676b 100755 --- a/gulliver/thirdparty/pear/Log/mdb2.php +++ b/gulliver/thirdparty/pear/Log/mdb2.php @@ -115,7 +115,16 @@ class Log_mdb2 extends Log function Log_mdb2($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_table = $name; $this->_mask = Log::UPTO($level); diff --git a/gulliver/thirdparty/pear/Log/null.php b/gulliver/thirdparty/pear/Log/null.php index 58cb9b43f..20a510566 100755 --- a/gulliver/thirdparty/pear/Log/null.php +++ b/gulliver/thirdparty/pear/Log/null.php @@ -30,7 +30,16 @@ class Log_null extends Log function Log_null($name, $ident = '', $conf = array(), $level = PEAR_LOG_DEBUG) { - $this->_id = md5(microtime()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $this->_id = G::encryptOld(microtime()); $this->_ident = $ident; $this->_mask = Log::UPTO($level); } diff --git a/gulliver/thirdparty/pear/Net/DIME.php b/gulliver/thirdparty/pear/Net/DIME.php index 6c54208ea..1eaf321b8 100755 --- a/gulliver/thirdparty/pear/Net/DIME.php +++ b/gulliver/thirdparty/pear/Net/DIME.php @@ -167,7 +167,16 @@ class Net_DIME_Record extends PEAR function generateID() { - $id = md5(time()); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $id = G::encryptOld(time()); $this->setID($id); return $id; } @@ -373,6 +382,15 @@ class Net_DIME_Message extends PEAR function startChunk(&$data, $typestr='', $id=NULL, $type=NET_DIME_TYPE_UNKNOWN) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $this->me = 0; $this->cf = 1; $this->type = $type; @@ -380,7 +398,7 @@ class Net_DIME_Message extends PEAR if ($id) { $this->id = $id; } else { - $this->id = md5(time()); + $this->id = G::encryptOld(time()); } return $this->_makeRecord($data, $this->typestr, $this->id, $this->type); } diff --git a/gulliver/thirdparty/pear/Net/UserAgent/Detect/APC.php b/gulliver/thirdparty/pear/Net/UserAgent/Detect/APC.php index 467907217..7c8a23537 100755 --- a/gulliver/thirdparty/pear/Net/UserAgent/Detect/APC.php +++ b/gulliver/thirdparty/pear/Net/UserAgent/Detect/APC.php @@ -29,6 +29,15 @@ class Net_UserAgent_Detect_APC extends Net_UserAgent_Detect $restored = false; $ua_cache_timeout = apc_fetch('useragent:cache_timeout'); // don't cache after time period + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } if ($ua_cache_window > 0) { if (!$ua_cache_timeout) { // check apc uptime and disable after x mins @@ -49,7 +58,7 @@ class Net_UserAgent_Detect_APC extends Net_UserAgent_Detect if ($in_detect !== null) { $key_flags = implode('-', $in_detect); } - $this->key = 'useragent:'.md5($in_userAgent.$key_flags); + $this->key = 'useragent:'.G::encryptOld($in_userAgent.$key_flags); } if ($data = apc_fetch($this->key)) { diff --git a/gulliver/thirdparty/pear/PEAR/Installer.php b/gulliver/thirdparty/pear/PEAR/Installer.php index 6ef191c98..9c8e15c95 100755 --- a/gulliver/thirdparty/pear/PEAR/Installer.php +++ b/gulliver/thirdparty/pear/PEAR/Installer.php @@ -232,8 +232,17 @@ class PEAR_Installer extends PEAR_Common $fp = fopen($orig_file, "r"); $contents = fread($fp, filesize($orig_file)); fclose($fp); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } if (isset($atts['md5sum'])) { - $md5sum = md5($contents); + $md5sum = G::encryptOld($contents); } $subst_from = $subst_to = array(); foreach ($atts['replacements'] as $a) { @@ -863,11 +872,20 @@ class PEAR_Installer extends PEAR_Common if (!function_exists("md5_file")) { function md5_file($filename) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $fp = fopen($filename, "r"); if (!$fp) return null; $contents = fread($fp, filesize($filename)); fclose($fp); - return md5($contents); + return G::encryptOld($contents); } } diff --git a/gulliver/thirdparty/pear/class.wsdlcache.php b/gulliver/thirdparty/pear/class.wsdlcache.php index 4258ea112..048a8a4f3 100755 --- a/gulliver/thirdparty/pear/class.wsdlcache.php +++ b/gulliver/thirdparty/pear/class.wsdlcache.php @@ -53,7 +53,16 @@ class wsdlcache { * @access private */ function createFilename($wsdl) { - return $this->cache_dir.'/wsdlcache-' . md5($wsdl); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + return $this->cache_dir.'/wsdlcache-' . G::encryptOld($wsdl); } /** @@ -112,15 +121,24 @@ class wsdlcache { * @access private */ function obtainMutex($filename, $mode) { - if (isset($this->fplock[md5($filename)])) { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + if (isset($this->fplock[G::encryptOld($filename)])) { $this->debug("Lock for $filename already exists"); return false; } $this->fplock[md5($filename)] = fopen($filename.".lock", "w"); if ($mode == "r") { - return flock($this->fplock[md5($filename)], LOCK_SH); + return flock($this->fplock[G::encryptOld($filename)], LOCK_SH); } else { - return flock($this->fplock[md5($filename)], LOCK_EX); + return flock($this->fplock[G::encryptOld($filename)], LOCK_EX); } } diff --git a/gulliver/thirdparty/phpmailer/class.phpmailer.php b/gulliver/thirdparty/phpmailer/class.phpmailer.php index 1002df591..830cd592d 100755 --- a/gulliver/thirdparty/phpmailer/class.phpmailer.php +++ b/gulliver/thirdparty/phpmailer/class.phpmailer.php @@ -1360,8 +1360,17 @@ class PHPMailer { public function CreateHeader() { $result = ''; + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // Set the boundaries - $uniq_id = md5(uniqid(time())); + $uniq_id = G::encryptOld(uniqid(time())); $this->boundary[1] = 'b1_' . $uniq_id; $this->boundary[2] = 'b2_' . $uniq_id; $this->boundary[3] = 'b3_' . $uniq_id; @@ -1777,6 +1786,15 @@ class PHPMailer { $mime = array(); $cidUniq = array(); $incl = array(); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // Add all attachments foreach ($this->attachment as $attachment) { @@ -1792,7 +1810,7 @@ class PHPMailer { $path = $attachment[0]; } - $inclhash = md5(serialize($attachment)); + $inclhash = G::encryptOld(serialize($attachment)); if (in_array($inclhash, $incl)) { continue; } $incl[] = $inclhash; $filename = $attachment[1]; @@ -2486,6 +2504,15 @@ class PHPMailer { */ public function MsgHTML($message, $basedir = '') { preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } if(isset($images[2])) { foreach($images[2] as $i => $url) { // do not change urls for absolute images (thanks to corvuscorax) @@ -2495,7 +2522,7 @@ class PHPMailer { if ($directory == '.') { $directory = ''; } - $cid = 'cid:' . md5($url); + $cid = 'cid:' . G::encryptOld($url); $ext = pathinfo($filename, PATHINFO_EXTENSION); $mimeType = self::_mime_types($ext); if ( strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; } diff --git a/gulliver/thirdparty/propel/om/BaseObject.php b/gulliver/thirdparty/propel/om/BaseObject.php index 8ef9942e7..df12154c0 100755 --- a/gulliver/thirdparty/propel/om/BaseObject.php +++ b/gulliver/thirdparty/propel/om/BaseObject.php @@ -165,11 +165,20 @@ abstract class BaseObject { */ public function hashCode() { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } $ok = $this->getPrimaryKey(); if ($ok === null) { - return crc32(serialize($this)); + return G::encryptCrc32(serialize($this)); } - return crc32(serialize($ok)); // serialize because it could be an array ("ComboKey") + return G::encryptCrc32(serialize($ok)); // serialize because it could be an array ("ComboKey") } /** diff --git a/gulliver/thirdparty/propel/util/Criteria.php b/gulliver/thirdparty/propel/util/Criteria.php index 802122207..f22653e4e 100755 --- a/gulliver/thirdparty/propel/util/Criteria.php +++ b/gulliver/thirdparty/propel/util/Criteria.php @@ -1669,14 +1669,23 @@ class Criterion { */ public function hashCode() { - $h = crc32(serialize($this->value)) ^ crc32($this->comparison); + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + $h = G::encryptCrc3(serialize($this->value)) ^ G::encryptCrc3($this->comparison); if ($this->table !== null) { - $h ^= crc32($this->table); + $h ^= G::encryptCrc3($this->table); } if ($this->column !== null) { - $h ^= crc32($this->column); + $h ^= G::encryptCrc3($this->column); } foreach ( $this->clauses as $clause ) { @@ -1687,7 +1696,7 @@ class Criterion { $sb = ''; $params = array(); $clause->appendPsTo($sb,$params); - $h ^= crc32(serialize(array($sb,$params))); + $h ^= G::encryptCrc3(serialize(array($sb,$params))); unset ( $sb, $params ); } diff --git a/gulliver/thirdparty/tcpdf/2dbarcodes.php b/gulliver/thirdparty/tcpdf/2dbarcodes.php index 6490dfa7e..b4cc36744 100644 --- a/gulliver/thirdparty/tcpdf/2dbarcodes.php +++ b/gulliver/thirdparty/tcpdf/2dbarcodes.php @@ -85,6 +85,15 @@ class TCPDF2DBarcode { * @public */ public function getBarcodeSVG($w=3, $h=3, $color='black') { + if(!class_exists('G')){ + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } // send headers $code = $this->getBarcodeSVGcode($w, $h, $color); header('Content-Type: application/svg+xml'); @@ -92,7 +101,7 @@ class TCPDF2DBarcode { header('Pragma: public'); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); + header('Content-Disposition: inline; filename="'.G::encryptOld($code).'.svg";'); //header('Content-Length: '.strlen($code)); echo $code; } From e5bc620c023003759eb631fb4b644144f5c246c9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Thu, 9 Apr 2015 11:14:19 -0400 Subject: [PATCH 10/13] PM-2116 "REST endpoints GET /cases/{app_uid}..." SOLVED > Code Issue: REST endpoints GET /cases/{app_uid} and /cases/{app_uid}/current-task needs to return due date and when started in current_task > Solution: Se completa los campos para obtener la informacion requerida. --- workflow/engine/src/ProcessMaker/BusinessModel/Cases.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 7509ff9f3..8b9e867de 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -551,6 +551,8 @@ class Cases $del = \DBAdapter::getStringDelimiter(); $oCriteria->addSelectColumn( \AppDelegationPeer::DEL_INDEX ); $oCriteria->addSelectColumn( \AppDelegationPeer::TAS_UID ); + $oCriteria->addSelectColumn(\AppDelegationPeer::DEL_INIT_DATE); + $oCriteria->addSelectColumn(\AppDelegationPeer::DEL_TASK_DUE_DATE); $oCriteria->addAsColumn( 'TAS_TITLE', 'C1.CON_VALUE' ); $oCriteria->addAlias( "C1", 'CONTENT' ); $tasTitleConds = array (); @@ -568,7 +570,9 @@ class Cases while ($aRow = $oDataset->getRow()) { $result = array ('tas_uid' => $aRow['TAS_UID'], 'tas_title' => $aRow['TAS_TITLE'], - 'del_index' => $aRow['DEL_INDEX']); + 'del_index' => $aRow['DEL_INDEX'], + "del_init_date" => $aRow["DEL_INIT_DATE"] . "", + "del_task_due_date" => $aRow["DEL_TASK_DUE_DATE"]); $oDataset->next(); } //Return @@ -2206,4 +2210,3 @@ class Cases } } } - From f3a5b57d1ee24aa84420359cf57123aa9c2525a4 Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Thu, 9 Apr 2015 11:43:24 -0400 Subject: [PATCH 11/13] I corrected --- gulliver/thirdparty/propel/util/Criteria.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gulliver/thirdparty/propel/util/Criteria.php b/gulliver/thirdparty/propel/util/Criteria.php index f22653e4e..bef1199b8 100755 --- a/gulliver/thirdparty/propel/util/Criteria.php +++ b/gulliver/thirdparty/propel/util/Criteria.php @@ -1678,14 +1678,14 @@ class Criterion { $pathTrunk = implode( '/', $docuroot ) . '/'; require_once($pathTrunk.'gulliver/system/class.g.php'); } - $h = G::encryptCrc3(serialize($this->value)) ^ G::encryptCrc3($this->comparison); + $h = G::encryptCrc32(serialize($this->value)) ^ G::encryptCrc32($this->comparison); if ($this->table !== null) { - $h ^= G::encryptCrc3($this->table); + $h ^= G::encryptCrc32($this->table); } if ($this->column !== null) { - $h ^= G::encryptCrc3($this->column); + $h ^= G::encryptCrc32($this->column); } foreach ( $this->clauses as $clause ) { From 486b94ae00708c99661b2b5aa6201ce75178c37e Mon Sep 17 00:00:00 2001 From: "Paula V. Quispe" Date: Thu, 9 Apr 2015 12:41:34 -0400 Subject: [PATCH 12/13] I corrected --- gulliver/thirdparty/propel/util/Criteria.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulliver/thirdparty/propel/util/Criteria.php b/gulliver/thirdparty/propel/util/Criteria.php index bef1199b8..0eeb54262 100755 --- a/gulliver/thirdparty/propel/util/Criteria.php +++ b/gulliver/thirdparty/propel/util/Criteria.php @@ -1696,7 +1696,7 @@ class Criterion { $sb = ''; $params = array(); $clause->appendPsTo($sb,$params); - $h ^= G::encryptCrc3(serialize(array($sb,$params))); + $h ^= G::encryptCrc32(serialize(array($sb,$params))); unset ( $sb, $params ); } From 9790b048b881a5c30026bd896be4da26e8d55e19 Mon Sep 17 00:00:00 2001 From: Luis Fernando Saisa Lopez Date: Thu, 9 Apr 2015 16:10:00 -0400 Subject: [PATCH 13/13] PM-2116 "REST endpoints GET /cases/{app_uid}..." SOLVED --- workflow/engine/classes/class.wsBase.php | 5 ++++- workflow/engine/src/ProcessMaker/BusinessModel/Cases.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/workflow/engine/classes/class.wsBase.php b/workflow/engine/classes/class.wsBase.php index 3609135d0..adc70de71 100755 --- a/workflow/engine/classes/class.wsBase.php +++ b/workflow/engine/classes/class.wsBase.php @@ -1057,6 +1057,8 @@ class wsBase $oCriteria->addSelectColumn( AppDelegationPeer::DEL_THREAD ); $oCriteria->addSelectColumn( AppDelegationPeer::DEL_THREAD_STATUS ); $oCriteria->addSelectColumn( AppDelegationPeer::DEL_FINISH_DATE ); + $oCriteria->addSelectColumn(AppDelegationPeer::DEL_INIT_DATE); + $oCriteria->addSelectColumn(AppDelegationPeer::DEL_TASK_DUE_DATE); $oCriteria->add( AppDelegationPeer::APP_UID, $caseId ); $oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL ); @@ -1096,6 +1098,8 @@ class wsBase $currentUser->delIndex = $aAppDel['DEL_INDEX']; $currentUser->delThread = $aAppDel['DEL_THREAD']; $currentUser->delThreadStatus = $aAppDel['DEL_THREAD_STATUS']; + $currentUser->delInitDate = $aAppDel["DEL_INIT_DATE"]; + $currentUser->delTaskDueDate = $aAppDel["DEL_TASK_DUE_DATE"]; $aCurrentUsers[] = $currentUser; } @@ -3304,4 +3308,3 @@ class wsBase } } } - diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index 8b9e867de..8b3597913 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -481,6 +481,8 @@ class Cases $current_task['del_index'] = $current_task['delIndex']; $current_task['del_thread'] = $current_task['delThread']; $current_task['del_thread_status'] = $current_task['delThreadStatus']; + $current_task["del_init_date"] = $current_task["delInitDate"] . ""; + $current_task["del_task_due_date"] = $current_task["delTaskDueDate"]; unset($current_task['userId']); unset($current_task['userName']); unset($current_task['taskId']);