diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 498e81059..5859d99b0 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -1704,6 +1704,7 @@ class G */ function SendTemporalMessage($msgID, $strType, $sType='LABEL', $time=null, $width=null, $customLabels= null) { + echo"Inside Send Temporal Message"; if( isset($width) ){ $_SESSION['G_MESSAGE_WIDTH'] = $width; } diff --git a/gulliver/system/class.rbac.php b/gulliver/system/class.rbac.php index 280f9a7ac..5a1effec2 100644 --- a/gulliver/system/class.rbac.php +++ b/gulliver/system/class.rbac.php @@ -158,24 +158,22 @@ class RBAC //if we provide a path data and session we will cache the session Info for this user if ( $pathData != null && $sid != null ) { $pathData = $pathData . 'session' . PATH_SEP; - $filePath = $pathData . $sid . '.rbac'; + $filePath = $pathData . $sid . '.rbac'; if ( file_exists ( $filePath ) && filesize($filePath) > 0 ) { - $this->aUserInfo = unserialize( file_get_contents ( $filePath ) ); + $this->aUserInfo = unserialize( file_get_contents ( $filePath ) ); return; } } - $this->sSystem = $sSystem; $fieldsSystem = $this->systemObj->loadByCode($sSystem); $fieldsRoles = $this->usersRolesObj->getRolesBySystem ($fieldsSystem['SYS_UID'], $sUser ); $fieldsPermissions = $this->usersRolesObj->getAllPermissions ($fieldsRoles['ROL_UID'], $sUser ); - $this->aUserInfo[ $sSystem ]['SYS_UID'] = $fieldsSystem['SYS_UID']; $this->aUserInfo[ $sSystem ]['ROLE'] = $fieldsRoles; $this->aUserInfo[ $sSystem ]['PERMISSIONS'] = $fieldsPermissions; - + if ( $pathData != null && $sid != null ) { - G::mk_dir ( $pathData ); + G::mk_dir ( $pathData ); file_put_contents( $filePath, serialize ( $this->aUserInfo ) ); } } diff --git a/gulliver/thirdparty/pear/DB.php b/gulliver/thirdparty/pear/DB.php index 1ff4dc228..8af3f65a5 100644 --- a/gulliver/thirdparty/pear/DB.php +++ b/gulliver/thirdparty/pear/DB.php @@ -307,7 +307,7 @@ class DB return $tmp; } - @$obj =& new $classname; + @$obj = new $classname; foreach ($options as $option => $value) { $test = $obj->setOption($option, $value); @@ -381,7 +381,7 @@ class DB return $tmp; } - @$obj =& new $classname; + @$obj = new $classname; foreach ($options as $option => $value) { $test = $obj->setOption($option, $value); @@ -887,7 +887,7 @@ class DB_result if ($object_class == 'stdClass') { $arr = (object) $arr; } else { - $arr = &new $object_class($arr); + $arr = new $object_class($arr); } } return $arr; diff --git a/workflow/engine/classes/class.pluginRegistry.php b/workflow/engine/classes/class.pluginRegistry.php index 7853f63c8..63336e685 100644 --- a/workflow/engine/classes/class.pluginRegistry.php +++ b/workflow/engine/classes/class.pluginRegistry.php @@ -190,7 +190,7 @@ class PMPluginRegistry { if ( $sNamespace == $namespace ) { $this->registerFolder($sNamespace, $sNamespace, $detail->sPluginFolder ); //register the default directory, later we can have more $this->_aPluginDetails[$sNamespace]->enabled = true; - $oPlugin =& new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); + $oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); $this->_aPlugins[$detail->sNamespace] =& $oPlugin; if (method_exists($oPlugin, 'enable')) { $oPlugin->enable(); @@ -209,7 +209,7 @@ class PMPluginRegistry { foreach ( $this->_aPluginDetails as $namespace=>$detail ) { if ( $sNamespace == $namespace ) { unset ($this->_aPluginDetails[$sNamespace]); - $oPlugin =& new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); + $oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); $this->_aPlugins[$detail->sNamespace] =& $oPlugin; if (method_exists($oPlugin, 'disable')) { $oPlugin->disable(); @@ -298,7 +298,7 @@ class PMPluginRegistry { try { foreach ( $this->_aPluginDetails as $namespace=>$detail ) { if ( $sNamespace == $namespace ) { - $oPlugin =& new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); + $oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); $this->_aPlugins[$detail->sNamespace] =& $oPlugin; $oPlugin->install(); } @@ -769,7 +769,7 @@ class PMPluginRegistry { $sFilename = PATH_PLUGINS . $aux[ count($aux) -1]; if (! file_exists($sFilename) ) continue; require_once( $sFilename); - $oPlugin =& new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); + $oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); $this->_aPlugins[$detail->sNamespace] =& $oPlugin; $iPlugins++; diff --git a/workflow/engine/classes/model/Configuration.php b/workflow/engine/classes/model/Configuration.php index bd00b35b2..258266048 100644 --- a/workflow/engine/classes/model/Configuration.php +++ b/workflow/engine/classes/model/Configuration.php @@ -140,6 +140,6 @@ class Configuration extends BaseConfiguration { public function exists($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid) { $oRow = ConfigurationPeer::retrieveByPK( $CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid ); - return ( get_class ($oRow) == 'Configuration' ); + return ( get_class ($oRow) == 'Configuration' && $oRow != ''); } } // Configuration diff --git a/workflow/engine/classes/model/Department.php b/workflow/engine/classes/model/Department.php index f202e3112..978f0c380 100644 --- a/workflow/engine/classes/model/Department.php +++ b/workflow/engine/classes/model/Department.php @@ -165,7 +165,7 @@ protected $depo_title = ''; $con = Propel::getConnection(DepartmentPeer::DATABASE_NAME); try { $oDept = DepartmentPeer::retrieveByPk( $DepUid ); - if ( get_class ($oDept) == 'Department' ) { + if (is_object ($oDept) && get_class ($oDept) == 'Department' ) { $aFields = $oDept->toArray(BasePeer::TYPE_FIELDNAME); $this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME ); $aFields['DEPO_TITLE'] = $oDept->getDepTitle(); diff --git a/workflow/engine/classes/model/Process.php b/workflow/engine/classes/model/Process.php index 1008c8893..2863134ae 100644 --- a/workflow/engine/classes/model/Process.php +++ b/workflow/engine/classes/model/Process.php @@ -214,7 +214,7 @@ class Process extends BaseProcess { $con = Propel::getConnection(ProcessPeer::DATABASE_NAME); try { $oPro = ProcessPeer::retrieveByPk( $ProUid ); - if ( get_class($oPro) == 'Process' ) { + if (is_object($oPro) && get_class($oPro) == 'Process' ) { return true; } else { diff --git a/workflow/engine/classes/model/UsersProperties.php b/workflow/engine/classes/model/UsersProperties.php index 56ee10d96..e95f417ef 100644 --- a/workflow/engine/classes/model/UsersProperties.php +++ b/workflow/engine/classes/model/UsersProperties.php @@ -15,10 +15,13 @@ require_once 'classes/model/om/BaseUsersProperties.php'; * @package classes.model */ class UsersProperties extends BaseUsersProperties { - function UserPropertyExists($sUserUID) { + function UserPropertyExists($sUserUID) { try { $oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID); - if (get_class($oUserProperty) == 'UsersProperties') { + var_dump($oUserProperty); + var_dump($sUserUID); + if (get_class($oUserProperty) == 'UsersProperties' && $oUserProperty != '') { + echo"inside"; return true; } else { diff --git a/workflow/engine/methods/install/install.js b/workflow/engine/methods/install/install.js index dda271d52..73a1ea5ed 100644 --- a/workflow/engine/methods/install/install.js +++ b/workflow/engine/methods/install/install.js @@ -72,7 +72,7 @@ var installer=function() var tr = this.table.insertRow(-1); $(tr).append( - new DOM('td',{innerHTML:"PHP Version >= 5.1.x and PHP Version < 5.3.0",className:"inst_td0",colSpan:2}), + new DOM('td',{innerHTML:"PHP Version < 5.3.0",className:"inst_td0",colSpan:2}), this.phpVersion = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2}) ); diff --git a/workflow/engine/methods/install/installServer.php b/workflow/engine/methods/install/installServer.php index ff1c5b45b..d194be16b 100644 --- a/workflow/engine/methods/install/installServer.php +++ b/workflow/engine/methods/install/installServer.php @@ -66,7 +66,7 @@ if($action==="check") ) )); $data=null; - $data->phpVersion =(version_compare(PHP_VERSION,"5.1.0",">=") && version_compare(PHP_VERSION,"5.3.0","<") )?true:false; + $data->phpVersion =(version_compare(PHP_VERSION,"5.1.0",">="))?true:false; if(trim($dataClient->mysqlH)=='' || trim($dataClient->mysqlU)=='') { $con = array('connection'=>false,'grant'=>false,'message'=>'Please complete the input fields (Hostname/Username)'); diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index 782ca9487..b15e2c048 100644 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -31,6 +31,7 @@ try { + $frm = $_POST['form']; $usr = ''; $pwd = ''; @@ -74,7 +75,7 @@ try { case -5: G::SendTemporalMessage ('ID_AUTHENTICATION_SOURCE_INVALID', "warning"); break; - } + } $$sPwd= $pwd; //to avoid empty string in user field. This will avoid a weird message "this row doesn't exist" @@ -137,11 +138,11 @@ try { G::LoadClass('serverConfiguration'); $oServerConf =& serverConf::getSingleton(); $oServerConf->sucessfulLogin(); - + // Assign the uid of user to userloggedobj $RBAC->loadUserRolePermission($RBAC->sSystem, $uid); $res = $RBAC->userCanAccess('PM_LOGIN'); - if ($res != 1 ) { + if ($res != 1 ) { if ($res == -2) G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error"); else @@ -195,18 +196,19 @@ try { $c = file_get_contents(PATH_DATA_SITE . PATH_SEP . '.server_info'); if(md5($c) != md5($cput)){ file_put_contents(PATH_DATA_SITE . PATH_SEP . '.server_info', $cput); - } + } } /* Check password using policy - Start */ require_once 'classes/model/UsersProperties.php'; $oUserProperty = new UsersProperties(); - $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($_SESSION['USER_LOGGED'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($currentPwd))))); + $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($_SESSION['USER_LOGGED'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($currentPwd))))); $aErrors = $oUserProperty->validatePassword($_POST['form']['USR_PASSWORD'], $aUserProperty['USR_LAST_UPDATE_DATE'], $aUserProperty['USR_LOGGED_NEXT_TIME']); - if (!empty($aErrors)) { - if (!defined('NO_DISPLAY_USERNAME')) { + + if (!empty($aErrors)) { + if (!defined('NO_DISPLAY_USERNAME')) { define('NO_DISPLAY_USERNAME', 1); - } + } $aFields = array(); $aFields['DESCRIPTION'] = ''; $aFields['DESCRIPTION'] .= G::LoadTranslation('ID_POLICY_ALERT').':

'; @@ -236,9 +238,9 @@ try { G::RenderPage('publish'); die; } - /* Check password using policy - End */ + /* Check password using policy - End */ if ( isset($_POST['form']['URL']) && $_POST['form']['URL'] != '') { - $sLocation = $_POST['form']['URL']; + $sLocation = $_POST['form']['URL']; } else { $sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang); @@ -251,6 +253,7 @@ try { $oHeadPublisher->assign('uriReq', $sLocation); G::RenderPage('publish', 'extJs'); //G::header('Location: ' . $sLocation); + die; }