diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 2f5a3e6ec..93458d03b 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -3443,11 +3443,12 @@ class XmlForm_Field_Hidden extends XmlForm_Field } } } + //$html .= 'value="' . $this->htmlentities( $value, ENT_QUOTES, 'utf-8' ) . '" '; if ($this->mode === 'edit') { - return 'NSFieldType() . ' name="form[' . $this->name . ']" type=\'hidden\' value=\'' . $value . '\'/>'; + return 'NSFieldType() . ' name="form[' . $this->name . ']" type=\'hidden\' value=\'' . $this->htmlentities( $value, ENT_QUOTES, 'utf-8' ) . '\'/>'; } elseif ($this->mode === 'view') { //a button? who wants a hidden field be showed like a button?? very strange. - return 'NSFieldType() . ' name="form[' . $this->name . ']" type=\'text\' value=\'' . $value . '\' style="display:none"/>'; + return 'NSFieldType() . ' name="form[' . $this->name . ']" type=\'text\' value=\'' . $this->htmlentities( $value, ENT_QUOTES, 'utf-8' ) . '\' style="display:none"/>'; } else { return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ); } diff --git a/workflow/engine/classes/model/OutputDocument.php b/workflow/engine/classes/model/OutputDocument.php index 34bec88bd..bfd361304 100755 --- a/workflow/engine/classes/model/OutputDocument.php +++ b/workflow/engine/classes/model/OutputDocument.php @@ -784,6 +784,8 @@ class OutputDocument extends BaseOutputDocument $sContent = str_ireplace("", "", $sContent); $sContent = str_replace($nrthtml, $nrt, $sContent); + + $sContent = str_replace("margin-left", "text-indent", $sContent); // define Save file $sOutput = 2; diff --git a/workflow/engine/controllers/admin.php b/workflow/engine/controllers/admin.php index 13c752552..9f53c8a18 100644 --- a/workflow/engine/controllers/admin.php +++ b/workflow/engine/controllers/admin.php @@ -15,8 +15,8 @@ class Admin extends Controller public function system () { - global $RBAC; - $RBAC->requirePermissions( 'PM_SETUP' ); + global $RBAC; + $RBAC->requirePermissions( 'PM_SETUP' ); require_once PATH_CONTROLLERS . 'main.php'; G::loadClass( 'system' ); $skinsList = System::getSkingList(); @@ -30,7 +30,7 @@ class Admin extends Controller $timeZonesList = array_keys( $timeZonesList ); $mainController = new Main(); $languagesList = $mainController->getLanguagesList(); - $languagesList[] = array ("", G::LoadTranslation("ID_USE_LANGUAGE_URL")); + $languagesList[] = array ("", G::LoadTranslation("ID_USE_LANGUAGE_URL")); $sysConf = System::getSystemConfiguration( PATH_CONFIG . 'env.ini' ); foreach ($skinsList['skins'] as $skin) { @@ -63,8 +63,8 @@ class Admin extends Controller public function uxList () { - global $RBAC; - $RBAC->requirePermissions( 'PM_SETUP' ); + global $RBAC; + $RBAC->requirePermissions( 'PM_SETUP' ); require_once PATH_CONTROLLERS . 'adminProxy.php'; $this->includeExtJS( 'admin/uxUsersList' ); G::LoadClass( 'configuration' ); @@ -204,5 +204,157 @@ class Admin extends Controller $this->setView('admin/maintenance'); $this->render('extJs'); } + + function getSystemInfo () + { + $this->setResponseType( 'json' ); + $infoList = $this->_getSystemInfo(); + $data = array (); + + foreach ($infoList as $row) { + $data[] = array ('label' => $row[0],'value' => $row[1],'section' => $row[2] + ); + } + return $data; + } + + private function _getSystemInfo () + { + G::LoadClass( "system" ); + + if (getenv( 'HTTP_CLIENT_IP' )) { + $ip = getenv( 'HTTP_CLIENT_IP' ); + } else { + if (getenv( 'HTTP_X_FORWARDED_FOR' )) { + $ip = getenv( 'HTTP_X_FORWARDED_FOR' ); + } else { + $ip = getenv( 'REMOTE_ADDR' ); + } + } + + $redhat = ''; + if (file_exists( '/etc/redhat-release' )) { + $fnewsize = filesize( '/etc/redhat-release' ); + $fp = fopen( '/etc/redhat-release', 'r' ); + $redhat = trim( fread( $fp, $fnewsize ) ); + fclose( $fp ); + } + + $redhat .= " (" . PHP_OS . ")"; + if (defined( "DB_HOST" )) { + G::LoadClass( 'net' ); + G::LoadClass( 'dbConnections' ); + $dbNetView = new NET( DB_HOST ); + $dbNetView->loginDbServer( DB_USER, DB_PASS ); + + $dbConns = new dbConnections( '' ); + $availdb = ''; + foreach ($dbConns->getDbServicesAvailables() as $key => $val) { + if ($availdb != '') { + $availdb .= ', '; + } + $availdb .= $val['name']; + } + + try { + $sMySQLVersion = $dbNetView->getDbServerVersion( DB_ADAPTER ); + } catch (Exception $oException) { + $sMySQLVersion = '?????'; + } + } + + + if (file_exists(PATH_HTML . "lib/versions")) { + $versions = json_decode(file_get_contents(PATH_HTML . "lib/versions"), true); + $pmuiVer = $versions["pmui_ver"]; + $mafeVer = $versions["mafe_ver"]; + $pmdynaformVer = $versions["pmdynaform_ver"]; + } else { + $pmuiVer = $mafeVer = $pmdynaformVer = "(unknown)"; + } + + $sysSection = G::loadTranslation('ID_SYSTEM_INFO' ); + $pmSection = G::LoadTranslation('ID_PROCESS_INFORMATION'); + + $properties = array (); + $ee = class_exists( 'pmLicenseManager' ) ? " - Enterprise Edition" : ''; + $systemName = 'ProcessMaker'; + if (defined('SYSTEM_NAME')) { + $systemName = SYSTEM_NAME; + } + $properties[] = array ($systemName. ' Ver.', System::getVersion() . $ee, $pmSection); + $properties[] = array("PMUI JS Lib. Ver.", $pmuiVer, $pmSection); + $properties[] = array("MAFE JS Lib. Ver.", $mafeVer, $pmSection); + $properties[] = array("PM Dynaform JS Lib. Ver.", $pmdynaformVer, $pmSection); + + if (file_exists(PATH_DATA. 'log/upgrades.log')) { + $properties[] = array (G::LoadTranslation('ID_UPGRADES_PATCHES'), '' . G::LoadTranslation( 'ID_UPGRADE_VIEW_LOG') . '' ,$pmSection); + } else { + $properties[] = array (G::LoadTranslation('ID_UPGRADES_PATCHES'), G::LoadTranslation( 'ID_UPGRADE_NEVER_UPGRADE') ,$pmSection); + } + + $properties[] = array (G::LoadTranslation('ID_OPERATING_SYSTEM') ,$redhat,$sysSection + ); + $properties[] = array (G::LoadTranslation('ID_TIME_ZONE') ,(defined( 'TIME_ZONE' )) ? TIME_ZONE : "Unknown",$sysSection + ); + $properties[] = array (G::LoadTranslation('ID_WEB_SERVER') ,getenv( 'SERVER_SOFTWARE' ),$sysSection + ); + $properties[] = array (G::LoadTranslation('ID_SERVER_NAME') ,getenv( 'SERVER_NAME' ),$pmSection + ); + $properties[] = array (G::LoadTranslation('ID_SERVER_IP') ,$this->lookup( $ip ),$sysSection + ); + $properties[] = array (G::LoadTranslation('ID_PHP_VERSION') ,phpversion(),$sysSection + ); + + if (defined( "DB_HOST" )) { + $properties[] = array (G::LoadTranslation('ID_DATABASE') ,$dbNetView->dbName( DB_ADAPTER ) . ' (Version ' . $sMySQLVersion . ')',$pmSection + ); + $properties[] = array (G::LoadTranslation('ID_DATABASE_SERVER') ,DB_HOST,$pmSection + ); + $properties[] = array (G::LoadTranslation('ID_DATABASE_NAME') ,DB_NAME,$pmSection + ); + $properties[] = array (G::LoadTranslation('ID_AVAILABLE_DB') ,$availdb,$sysSection + ); + } else { + $properties[] = array (G::LoadTranslation('ID_DATABASE') ,"Not defined",$pmSection + ); + $properties[] = array (G::LoadTranslation('ID_DATABASE_SERVER') ,"Not defined",$pmSection + ); + $properties[] = array (G::LoadTranslation('ID_DATABASE_NAME') ,"Not defined",$pmSection + ); + $properties[] = array (G::LoadTranslation('ID_AVAILABLE_DB') ,"Not defined",$sysSection + ); + } + + $properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,defined( "SYS_SYS" ) ? SYS_SYS : "Not defined",$pmSection + ); + + $properties[] = array ( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv( 'SERVER_PROTOCOL' ),$sysSection + ); + $properties[] = array ( G::LoadTranslation('ID_SERVER_PORT') ,getenv( 'SERVER_PORT' ),$sysSection + ); + //$sysSection[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection); + $properties[] = array ( G::LoadTranslation('ID_SERVER_NAME') , getenv( 'SERVER_ADDR' ),$sysSection + ); + $properties[] = array ( G::LoadTranslation('ID_USER_BROWSER') , getenv( 'HTTP_USER_AGENT' ),$sysSection + ); + + return $properties; + } + + private function lookup ($target) + { + global $ntarget; + $msg = $target . ' => '; + //if (eregi ('[a-zA-Z]', $target)) + if (preg_match( '[a-zA-Z]', $target )) { + //Made compatible to PHP 5.3 + $ntarget = gethostbyname( $target ); + } else { + $ntarget = gethostbyaddr( $target ); + } + $msg .= $ntarget; + return ($msg); + } } diff --git a/workflow/engine/methods/setup/processHeartBeatAjax.php b/workflow/engine/methods/setup/processHeartBeatAjax.php index 7241e656b..f5cf864ce 100644 --- a/workflow/engine/methods/setup/processHeartBeatAjax.php +++ b/workflow/engine/methods/setup/processHeartBeatAjax.php @@ -5,7 +5,7 @@ switch ($_GET['action']) { try { G::LoadClass( 'serverConfiguration' ); $oServerConf = & serverConf::getSingleton(); - + $response = new stdclass(); /*you can use SYS_TEMP or SYS_SYS ON HEAR_BEAT_CONF to save for each workspace*/ $oServerConf->unsetHeartbeatProperty( 'HB_BEAT_TYPE', 'HEART_BEAT_CONF' ); if (isset( $_POST['acceptHB'] )) { diff --git a/workflow/engine/methods/setup/systemInfo.php b/workflow/engine/methods/setup/systemInfo.php index 38657d8fa..20d704fa0 100644 --- a/workflow/engine/methods/setup/systemInfo.php +++ b/workflow/engine/methods/setup/systemInfo.php @@ -17,6 +17,7 @@ switch ($option) { break; case "processInfo": $oHeadPublisher = &headPublisher::getSingleton(); + $oHeadPublisher->assign('skin', $_SESSION['currentSkin']); $oHeadPublisher->addContent("setup/dbInfo"); //Adding a html file .html $oHeadPublisher->addExtJsScript("setup/dbInfo", false); //Adding a javascript file .js diff --git a/workflow/engine/templates/setup/dbInfo.js b/workflow/engine/templates/setup/dbInfo.js index 5c04e15fd..8b0c5cb6f 100644 --- a/workflow/engine/templates/setup/dbInfo.js +++ b/workflow/engine/templates/setup/dbInfo.js @@ -4,7 +4,7 @@ dbInfo.application = { init: function () { - var sumaryInfPanel = PMExt.createInfoPanel('../../uxmodern/main/getSystemInfo'); + var sumaryInfPanel = PMExt.createInfoPanel('../../'+skin+'/admin/getSystemInfo'); var panelInfo = new Ext.Panel({ id:'panelInfo', diff --git a/workflow/engine/templates/users/users.js b/workflow/engine/templates/users/users.js index e8834787c..e3efc75cf 100755 --- a/workflow/engine/templates/users/users.js +++ b/workflow/engine/templates/users/users.js @@ -406,7 +406,7 @@ Ext.onReady(function () { items : [ { id : 'USR_FIRSTNAME', - fieldLabel : _('ID_FIRSTNAME'), + fieldLabel : ' * ' + _('ID_FIRSTNAME'), xtype : 'textfield', width : 260, allowBlank : false @@ -420,7 +420,7 @@ Ext.onReady(function () { }, { id : 'USR_USERNAME', - fieldLabel : _('ID_USER_ID'), + fieldLabel : ' * ' + _('ID_USER_ID'), xtype : 'textfield', width : 260, allowBlank : false, @@ -459,7 +459,7 @@ Ext.onReady(function () { }, { id : 'USR_EMAIL', - fieldLabel : _('ID_EMAIL'), + fieldLabel : ' * ' + _('ID_EMAIL'), vtype : 'email', xtype : 'textfield', width : 260, diff --git a/workflow/engine/xmlform/dynaforms/dynaforms_WebEntry.xml b/workflow/engine/xmlform/dynaforms/dynaforms_WebEntry.xml index 5a5433b4a..e7380087e 100755 --- a/workflow/engine/xmlform/dynaforms/dynaforms_WebEntry.xml +++ b/workflow/engine/xmlform/dynaforms/dynaforms_WebEntry.xml @@ -80,6 +80,7 @@ leimnud.event.add(getField('WE_TYPE'), 'change', function() { showRowById('subtitle2'); } else { + getField('SEARCH').disabled = false; hideRowById("TEST"); showRowById("SEARCH"); @@ -87,7 +88,6 @@ leimnud.event.add(getField('WE_TYPE'), 'change', function() { hideRowById('WS_PASS'); hideRowById('WS_ROUNDROBIN'); hideRowById('subtitle2'); - }hideRowById('WS_ROUNDROBIN'); }.extend(getField('WE_TYPE'))); @@ -121,7 +121,7 @@ var webEntry_validate = function(PRO_UID, TASKS, DYNAFORM) { }.extend(this); oRPC.make(); - }else{ + }else{ var tasksName = getField('TASKS')[getField('TASKS').selectedIndex].innerHTML; var oRPC = new leimnud.module.rpc.xmlhttp({ @@ -144,8 +144,6 @@ var tasksName = getField('TASKS')[getField('TASKS').selectedIndex].innerHTML; } }.extend(this); oRPC.make(); - - } }