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)
{
echo"Inside Send Temporal Message";
if( isset($width) ){
$_SESSION['G_MESSAGE_WIDTH'] = $width;
}

View File

@@ -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 ) );
}
}

View File

@@ -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;

View File

@@ -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++;

View File

@@ -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

View File

@@ -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();

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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})
);

View File

@@ -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)');

View File

@@ -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'] = '<span style="font-weight:normal;">';
$aFields['DESCRIPTION'] .= G::LoadTranslation('ID_POLICY_ALERT').':<br /><br />';
@@ -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;
}