Added all the changes which done before for php5.3 in pmos9b

This commit is contained in:
abraar
2010-12-03 15:43:29 +00:00
parent 0525681d79
commit 5715059f24
11 changed files with 35 additions and 30 deletions

View File

@@ -1704,6 +1704,7 @@ class G
*/ */
function SendTemporalMessage($msgID, $strType, $sType='LABEL', $time=null, $width=null, $customLabels= null) function SendTemporalMessage($msgID, $strType, $sType='LABEL', $time=null, $width=null, $customLabels= null)
{ {
echo"Inside Send Temporal Message";
if( isset($width) ){ if( isset($width) ){
$_SESSION['G_MESSAGE_WIDTH'] = $width; $_SESSION['G_MESSAGE_WIDTH'] = $width;
} }

View File

@@ -160,22 +160,20 @@ class RBAC
$pathData = $pathData . 'session' . PATH_SEP; $pathData = $pathData . 'session' . PATH_SEP;
$filePath = $pathData . $sid . '.rbac'; $filePath = $pathData . $sid . '.rbac';
if ( file_exists ( $filePath ) && filesize($filePath) > 0 ) { if ( file_exists ( $filePath ) && filesize($filePath) > 0 ) {
$this->aUserInfo = unserialize( file_get_contents ( $filePath ) ); $this->aUserInfo = unserialize( file_get_contents ( $filePath ) );
return; return;
} }
} }
$this->sSystem = $sSystem; $this->sSystem = $sSystem;
$fieldsSystem = $this->systemObj->loadByCode($sSystem); $fieldsSystem = $this->systemObj->loadByCode($sSystem);
$fieldsRoles = $this->usersRolesObj->getRolesBySystem ($fieldsSystem['SYS_UID'], $sUser ); $fieldsRoles = $this->usersRolesObj->getRolesBySystem ($fieldsSystem['SYS_UID'], $sUser );
$fieldsPermissions = $this->usersRolesObj->getAllPermissions ($fieldsRoles['ROL_UID'], $sUser ); $fieldsPermissions = $this->usersRolesObj->getAllPermissions ($fieldsRoles['ROL_UID'], $sUser );
$this->aUserInfo[ $sSystem ]['SYS_UID'] = $fieldsSystem['SYS_UID']; $this->aUserInfo[ $sSystem ]['SYS_UID'] = $fieldsSystem['SYS_UID'];
$this->aUserInfo[ $sSystem ]['ROLE'] = $fieldsRoles; $this->aUserInfo[ $sSystem ]['ROLE'] = $fieldsRoles;
$this->aUserInfo[ $sSystem ]['PERMISSIONS'] = $fieldsPermissions; $this->aUserInfo[ $sSystem ]['PERMISSIONS'] = $fieldsPermissions;
if ( $pathData != null && $sid != null ) { if ( $pathData != null && $sid != null ) {
G::mk_dir ( $pathData ); G::mk_dir ( $pathData );
file_put_contents( $filePath, serialize ( $this->aUserInfo ) ); file_put_contents( $filePath, serialize ( $this->aUserInfo ) );
} }
} }

View File

@@ -307,7 +307,7 @@ class DB
return $tmp; return $tmp;
} }
@$obj =& new $classname; @$obj = new $classname;
foreach ($options as $option => $value) { foreach ($options as $option => $value) {
$test = $obj->setOption($option, $value); $test = $obj->setOption($option, $value);
@@ -381,7 +381,7 @@ class DB
return $tmp; return $tmp;
} }
@$obj =& new $classname; @$obj = new $classname;
foreach ($options as $option => $value) { foreach ($options as $option => $value) {
$test = $obj->setOption($option, $value); $test = $obj->setOption($option, $value);
@@ -887,7 +887,7 @@ class DB_result
if ($object_class == 'stdClass') { if ($object_class == 'stdClass') {
$arr = (object) $arr; $arr = (object) $arr;
} else { } else {
$arr = &new $object_class($arr); $arr = new $object_class($arr);
} }
} }
return $arr; return $arr;

View File

@@ -190,7 +190,7 @@ class PMPluginRegistry {
if ( $sNamespace == $namespace ) { if ( $sNamespace == $namespace ) {
$this->registerFolder($sNamespace, $sNamespace, $detail->sPluginFolder ); //register the default directory, later we can have more $this->registerFolder($sNamespace, $sNamespace, $detail->sPluginFolder ); //register the default directory, later we can have more
$this->_aPluginDetails[$sNamespace]->enabled = true; $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; $this->_aPlugins[$detail->sNamespace] =& $oPlugin;
if (method_exists($oPlugin, 'enable')) { if (method_exists($oPlugin, 'enable')) {
$oPlugin->enable(); $oPlugin->enable();
@@ -209,7 +209,7 @@ class PMPluginRegistry {
foreach ( $this->_aPluginDetails as $namespace=>$detail ) { foreach ( $this->_aPluginDetails as $namespace=>$detail ) {
if ( $sNamespace == $namespace ) { if ( $sNamespace == $namespace ) {
unset ($this->_aPluginDetails[$sNamespace]); 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; $this->_aPlugins[$detail->sNamespace] =& $oPlugin;
if (method_exists($oPlugin, 'disable')) { if (method_exists($oPlugin, 'disable')) {
$oPlugin->disable(); $oPlugin->disable();
@@ -298,7 +298,7 @@ class PMPluginRegistry {
try { try {
foreach ( $this->_aPluginDetails as $namespace=>$detail ) { foreach ( $this->_aPluginDetails as $namespace=>$detail ) {
if ( $sNamespace == $namespace ) { if ( $sNamespace == $namespace ) {
$oPlugin =& new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); $oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename );
$this->_aPlugins[$detail->sNamespace] =& $oPlugin; $this->_aPlugins[$detail->sNamespace] =& $oPlugin;
$oPlugin->install(); $oPlugin->install();
} }
@@ -769,7 +769,7 @@ class PMPluginRegistry {
$sFilename = PATH_PLUGINS . $aux[ count($aux) -1]; $sFilename = PATH_PLUGINS . $aux[ count($aux) -1];
if (! file_exists($sFilename) ) continue; if (! file_exists($sFilename) ) continue;
require_once( $sFilename); require_once( $sFilename);
$oPlugin =& new $detail->sClassName( $detail->sNamespace, $detail->sFilename ); $oPlugin = new $detail->sClassName( $detail->sNamespace, $detail->sFilename );
$this->_aPlugins[$detail->sNamespace] =& $oPlugin; $this->_aPlugins[$detail->sNamespace] =& $oPlugin;
$iPlugins++; $iPlugins++;

View File

@@ -140,6 +140,6 @@ class Configuration extends BaseConfiguration {
public function exists($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid) public function exists($CfgUid, $ObjUid, $ProUid, $UsrUid, $AppUid)
{ {
$oRow = ConfigurationPeer::retrieveByPK( $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 } // Configuration

View File

@@ -165,7 +165,7 @@ protected $depo_title = '';
$con = Propel::getConnection(DepartmentPeer::DATABASE_NAME); $con = Propel::getConnection(DepartmentPeer::DATABASE_NAME);
try { try {
$oDept = DepartmentPeer::retrieveByPk( $DepUid ); $oDept = DepartmentPeer::retrieveByPk( $DepUid );
if ( get_class ($oDept) == 'Department' ) { if (is_object ($oDept) && get_class ($oDept) == 'Department' ) {
$aFields = $oDept->toArray(BasePeer::TYPE_FIELDNAME); $aFields = $oDept->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME ); $this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
$aFields['DEPO_TITLE'] = $oDept->getDepTitle(); $aFields['DEPO_TITLE'] = $oDept->getDepTitle();

View File

@@ -214,7 +214,7 @@ class Process extends BaseProcess {
$con = Propel::getConnection(ProcessPeer::DATABASE_NAME); $con = Propel::getConnection(ProcessPeer::DATABASE_NAME);
try { try {
$oPro = ProcessPeer::retrieveByPk( $ProUid ); $oPro = ProcessPeer::retrieveByPk( $ProUid );
if ( get_class($oPro) == 'Process' ) { if (is_object($oPro) && get_class($oPro) == 'Process' ) {
return true; return true;
} }
else { else {

View File

@@ -15,10 +15,13 @@ require_once 'classes/model/om/BaseUsersProperties.php';
* @package classes.model * @package classes.model
*/ */
class UsersProperties extends BaseUsersProperties { class UsersProperties extends BaseUsersProperties {
function UserPropertyExists($sUserUID) { function UserPropertyExists($sUserUID) {
try { try {
$oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID); $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; return true;
} }
else { else {

View File

@@ -72,7 +72,7 @@ var installer=function()
var tr = this.table.insertRow(-1); var tr = this.table.insertRow(-1);
$(tr).append( $(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}) this.phpVersion = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
); );

View File

@@ -66,7 +66,7 @@ if($action==="check")
) )
)); ));
$data=null; $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)=='') if(trim($dataClient->mysqlH)=='' || trim($dataClient->mysqlU)=='')
{ {
$con = array('connection'=>false,'grant'=>false,'message'=>'Please complete the input fields (Hostname/Username)'); $con = array('connection'=>false,'grant'=>false,'message'=>'Please complete the input fields (Hostname/Username)');

View File

@@ -31,6 +31,7 @@
try { try {
$frm = $_POST['form']; $frm = $_POST['form'];
$usr = ''; $usr = '';
$pwd = ''; $pwd = '';
@@ -74,7 +75,7 @@ try {
case -5: case -5:
G::SendTemporalMessage ('ID_AUTHENTICATION_SOURCE_INVALID', "warning"); G::SendTemporalMessage ('ID_AUTHENTICATION_SOURCE_INVALID', "warning");
break; break;
} }
$$sPwd= $pwd; $$sPwd= $pwd;
//to avoid empty string in user field. This will avoid a weird message "this row doesn't exist" //to avoid empty string in user field. This will avoid a weird message "this row doesn't exist"
@@ -141,7 +142,7 @@ try {
// Assign the uid of user to userloggedobj // Assign the uid of user to userloggedobj
$RBAC->loadUserRolePermission($RBAC->sSystem, $uid); $RBAC->loadUserRolePermission($RBAC->sSystem, $uid);
$res = $RBAC->userCanAccess('PM_LOGIN'); $res = $RBAC->userCanAccess('PM_LOGIN');
if ($res != 1 ) { if ($res != 1 ) {
if ($res == -2) if ($res == -2)
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error"); G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error");
else else
@@ -195,7 +196,7 @@ try {
$c = file_get_contents(PATH_DATA_SITE . PATH_SEP . '.server_info'); $c = file_get_contents(PATH_DATA_SITE . PATH_SEP . '.server_info');
if(md5($c) != md5($cput)){ if(md5($c) != md5($cput)){
file_put_contents(PATH_DATA_SITE . PATH_SEP . '.server_info', $cput); file_put_contents(PATH_DATA_SITE . PATH_SEP . '.server_info', $cput);
} }
} }
/* Check password using policy - Start */ /* Check password using policy - Start */
@@ -203,8 +204,9 @@ try {
$oUserProperty = new UsersProperties(); $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']); $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); define('NO_DISPLAY_USERNAME', 1);
} }
$aFields = array(); $aFields = array();
@@ -236,9 +238,9 @@ try {
G::RenderPage('publish'); G::RenderPage('publish');
die; die;
} }
/* Check password using policy - End */ /* Check password using policy - End */
if ( isset($_POST['form']['URL']) && $_POST['form']['URL'] != '') { if ( isset($_POST['form']['URL']) && $_POST['form']['URL'] != '') {
$sLocation = $_POST['form']['URL']; $sLocation = $_POST['form']['URL'];
} }
else { else {
$sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang); $sLocation = $oUserProperty->redirectTo($_SESSION['USER_LOGGED'], $lang);
@@ -251,6 +253,7 @@ try {
$oHeadPublisher->assign('uriReq', $sLocation); $oHeadPublisher->assign('uriReq', $sLocation);
G::RenderPage('publish', 'extJs'); G::RenderPage('publish', 'extJs');
//G::header('Location: ' . $sLocation); //G::header('Location: ' . $sLocation);
die; die;
} }