diff --git a/workflow/engine/classes/class.Installer.php b/workflow/engine/classes/class.Installer.php index 4b231de11..63cd70404 100755 --- a/workflow/engine/classes/class.Installer.php +++ b/workflow/engine/classes/class.Installer.php @@ -196,8 +196,8 @@ class Installer @mkdir($path_site . "xmlForms", 0777, true); $db_text = "options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_NAME', '" . $wf . "' );\n" . "define ('DB_USER', '" . (($this->cc_status == 1) ? $wf : $this->options['database']['username']) . "' );\n" . "define ('DB_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_RBAC_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_RBAC_NAME', '" . $rb . "' );\n" . "define ('DB_RBAC_USER', '" . (($this->cc_status == 1) ? $rb : $this->options['database']['username']) . "' );\n" . "define ('DB_RBAC_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "define ('DB_REPORT_HOST', '" . $this->options['database']['hostname'] . ":" . $myPort . "' );\n" . "define ('DB_REPORT_NAME', '" . $rp . "' );\n" . "define ('DB_REPORT_USER', '" . (($this->cc_status == 1) ? $rp : $this->options['database']['username']) . "' );\n" . "define ('DB_REPORT_PASS', '" . (($this->cc_status == 1) ? $this->options['password'] : $this->options['database']['password']) . "' );\n" . "?>"; - if (defined('PARTNER_FLAG')) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : 'false') . ");\n"; + if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { + $dbText .= "define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $fp = @fopen($db_file, "w"); $this->log("Create: " . $db_file . " => " . ((!$fp) ? $fp : "OK") . "\n", $fp === false); diff --git a/workflow/engine/classes/model/Language.php b/workflow/engine/classes/model/Language.php index f6171b7df..c417fb63a 100755 --- a/workflow/engine/classes/model/Language.php +++ b/workflow/engine/classes/model/Language.php @@ -666,17 +666,29 @@ class Language extends BaseLanguage G::LoadSystem( 'i18n_po' ); G::LoadClass( "system" ); - //creating the .po file - $sPOFile = PATH_PLUGINS . $plugin . PATH_SEP . 'translations' . PATH_SEP . $plugin . '.' . $idLanguage . '.po'; - $poFile = new i18n_PO( $sPOFile ); - $poFile->buildInit(); - $language = new Language(); $locale = $language; $targetLang = $idLanguage; $baseLang = 'en'; + $aLabels = array (); + $aMsgids = array ('' => true + ); + include PATH_PLUGINS . $plugin . PATH_SEP . 'translations'. PATH_SEP . 'translations.php'; + $translatedText = array(); + + if (file_exists( PATH_LANGUAGECONT . $plugin . "." . $idLanguage)) { + //reading the .po file + include PATH_LANGUAGECONT . $plugin . "." . $idLanguage; + eval('$translatedText = $translation'.$plugin.';'); + } + + //creating the .po file + $sPOFile = PATH_PLUGINS . $plugin . PATH_SEP . 'translations' . PATH_SEP . $plugin . '.' . $idLanguage . '.po'; + $poFile = new i18n_PO( $sPOFile ); + $poFile->buildInit(); + //setting headers $poFile->addHeader( 'Project-Id-Version', $plugin ); $poFile->addHeader( 'POT-Creation-Date', '' ); @@ -690,14 +702,16 @@ class Language extends BaseLanguage $poFile->addHeader( 'X-Poedit-SourceCharset', 'utf-8' ); $poFile->addHeader( 'Content-Transfer-Encoding', '8bit' ); - $aLabels = array (); - $aMsgids = array ('' => true - ); - include PATH_PLUGINS . $plugin . PATH_SEP . 'translations'. PATH_SEP . 'translations.php'; foreach ($translations as $id => $translation) { $msgid = trim( $translation); $msgstr = trim( $translation ); + foreach ($translatedText as $key => $value) { + if ($id == $key) { + $msgstr = trim( $value ); + break; + } + } $poFile->addTranslatorComment( 'TRANSLATION' ); $poFile->addTranslatorComment( 'LABEL/' . $id ); $poFile->addReference( 'LABEL/'. $id ); diff --git a/workflow/engine/controllers/admin.php b/workflow/engine/controllers/admin.php index a43cc3f54..dc556b438 100644 --- a/workflow/engine/controllers/admin.php +++ b/workflow/engine/controllers/admin.php @@ -44,6 +44,11 @@ class Admin extends Controller // $c = new Configurations(); // $configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']); // $Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20; + if (isset($sysConf["session.gc_maxlifetime"])) { + $sysConf["session_gc_maxlifetime"] = $sysConf["session.gc_maxlifetime"]; + } else { + $sysConf["session_gc_maxlifetime"] = ini_get('session.gc_maxlifetime'); + } $this->setJSVar( 'skinsList', $skins ); $this->setJSVar( 'languagesList', $languagesList ); @@ -90,7 +95,8 @@ class Admin extends Controller $fields = $calendarObj->getCalendarInfoE( $CalendarUid ); $fields['OLD_NAME'] = $fields['CALENDAR_NAME']; } - if (! isset( $fields['CALENDAR_UID'] )) { //For a new Calendar + // For a new Calendar + if (! isset( $fields['CALENDAR_UID'] )) { $fields['CALENDAR_UID'] = $CalendarUid; $fields['OLD_NAME'] = ''; @@ -99,7 +105,8 @@ class Admin extends Controller $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_START'] = "09:00"; $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_END'] = "17:00"; } - if ((isset( $_GET['cp'] )) && ($_GET['cp'] == 1)) { // Copy Calendar + // Copy Calendar + if ((isset( $_GET['cp'] )) && ($_GET['cp'] == 1)) { $fields['CALENDAR_UID'] = G::GenerateUniqueID(); $fields['CALENDAR_NAME'] = G::LoadTranslation( "ID_COPY_OF" ) . " " . $fields['CALENDAR_NAME']; $fields['OLD_NAME'] = $fields['CALENDAR_NAME']; diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index faea555d4..470f60586 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -86,6 +86,13 @@ class adminProxy extends HttpProxyController $updatedConf['proxy_pass'] = G::encrypt($httpData->proxy_pass, 'proxy_pass'); } + $sessionGcMaxlifetime = ini_get('session.gc_maxlifetime'); + if (($httpData->max_life_time != "") && ($sessionGcMaxlifetime != $httpData->max_life_time)) { + if (!isset($sysConf['session.gc_maxlifetime']) || ($sysConf['session.gc_maxlifetime'] != $httpData->max_life_time)) { + $updatedConf['session.gc_maxlifetime'] = $httpData->max_life_time; + } + } + if ($updateRedirector) { if (!file_exists(PATH_HTML . 'index.html')) { throw new Exception('The index.html file is not writable on workflow/public_html directory.'); diff --git a/workflow/engine/controllers/dashboard.php b/workflow/engine/controllers/dashboard.php index 2a74544d3..f37f63ecc 100644 --- a/workflow/engine/controllers/dashboard.php +++ b/workflow/engine/controllers/dashboard.php @@ -28,7 +28,7 @@ class Dashboard extends Controller try { $dashletsExist = $this->getDashletsInstancesForCurrentUser(); $dashletsHide = array(); - $dashletColumns = 3; + $dashletColumns = 2; G::LoadClass( 'configuration' ); $oConfiguration = new Configurations(); @@ -447,4 +447,3 @@ class Dashboard extends Controller // Functions for the dasboards administration module - End } - diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index 99ae9543d..4be895ec5 100644 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -680,8 +680,8 @@ class Installer extends Controller $dbText .= sprintf( " define ('DB_REPORT_NAME', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass ); - if (defined('PARTNER_FLAG')) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : 'false') . ");\n"; + if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { + $dbText .= "define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($db_file) )); @@ -947,8 +947,8 @@ class Installer extends Controller $dbText .= sprintf( " define ('DB_REPORT_NAME', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_USER', '%s' );\n", $rp ); $dbText .= sprintf( " define ('DB_REPORT_PASS', '%s' );\n", $rpPass ); - if (defined('PARTNER_FLAG')) { - $dbText .= "define ('PARTNER_FLAG', " . (PARTNER_FLAG ? 'true' : 'false') . ");\n"; + if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) { + $dbText .= "define ('PARTNER_FLAG', " . ((defined('PARTNER_FLAG')) ? PARTNER_FLAG : ((isset($_REQUEST['PARTNER_FLAG'])) ? $_REQUEST['PARTNER_FLAG']:'false')) . ");\n"; } $this->installLog( G::LoadTranslation('ID_CREATING', SYS_LANG, Array($db_file) )); diff --git a/workflow/engine/methods/outputdocs/outputdocs_Edit.php b/workflow/engine/methods/outputdocs/outputdocs_Edit.php index d4d405373..9fbf55fb1 100755 --- a/workflow/engine/methods/outputdocs/outputdocs_Edit.php +++ b/workflow/engine/methods/outputdocs/outputdocs_Edit.php @@ -61,13 +61,30 @@ try { switch ($type) { case 'HTML': - //$G_PUBLISH->AddContent('xmlform', 'xmlform', 'outputdocs/outputdocs_Edit', '', $aFields , '../outputdocs/outputdocs_Save'); - $oHeadPublisher = & headPublisher::getSingleton(); - $oHeadPublisher->assign( 'OUT_DOC_UID', $_GET['OUT_DOC_UID'] ); - $translations = G::getTranslations( Array ('ID_FILE','ID_OUT_PUT_DOC_UPLOAD_TITLE','ID_UPLOADING_FILE','ID_UPLOAD','ID_CANCEL','ID_SAVE','ID_LOAD_FROM_FILE','ID_SELECT_TEMPLATE_FILE','ID_ALERT_MESSAGE','ID_INVALID_FILE') ); - // $oHeadPublisher->assign('TRANSLATIONS', $translations); - $oHeadPublisher->addExtJsScript( 'outputdocs/htmlEditor', false ); //adding a javascript file .js - G::RenderPage( 'publish', 'extJs' ); + global $G_PUBLISH; + $G_PUBLISH = new Publisher(); + $fcontent = ''; + $proUid = ''; + $filename = ''; + $title = ''; + require_once 'classes/model/OutputDocument.php'; + $oOutputDocument = new OutputDocument(); + if (isset( $_REQUEST['OUT_DOC_UID'] )) { + $aFields = $oOutputDocument->load( $_REQUEST['OUT_DOC_UID'] ); + $fcontent = $aFields['OUT_DOC_TEMPLATE']; + $proUid = $aFields['PRO_UID']; + $filename = $aFields['OUT_DOC_FILENAME']; + $title = $aFields['OUT_DOC_TITLE']; + } + $aData = Array ( + 'PRO_UID' => $proUid, + 'OUT_DOC_TEMPLATE' => $fcontent, + 'FILENAME' => $filename, + 'OUT_DOC_UID'=> $_REQUEST['OUT_DOC_UID'], + 'OUT_DOC_TITLE'=> $title, + ); + $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocs_Edit', '', $aData ); + G::RenderPage( 'publish', 'blank' ); die(); break; case 'JRXML': diff --git a/workflow/engine/methods/setup/appCacheViewAjax.php b/workflow/engine/methods/setup/appCacheViewAjax.php index 2902acc0f..26475a346 100755 --- a/workflow/engine/methods/setup/appCacheViewAjax.php +++ b/workflow/engine/methods/setup/appCacheViewAjax.php @@ -3,6 +3,87 @@ require_once ('classes/model/AppCacheView.php'); $request = isset( $_POST['request'] ) ? $_POST['request'] : (isset( $_GET['request'] ) ? $_GET['request'] : null); +function testConnection($type, $server, $user, $passwd, $port = 'none', $dbName = "") +{ + + if (($port == 'none') || ($port == '') || ($port == 0)) { + //setting defaults ports + switch ($type) { + case 'mysql': + $port = 3306; + break; + case 'pgsql': + $port = 5432; + break; + case 'mssql': + $port = 1433; + break; + case 'oracle': + $port = 1521; + break; + } + } + + G::LoadClass('net'); + $Server = new NET($server); + + if ($Server->getErrno() == 0) { + $Server->scannPort($port); + if ($Server->getErrno() == 0) { + $Server->loginDbServer($user, $passwd); + $Server->setDataBase($dbName, $port); + if ($Server->errno == 0) { + $response = $Server->tryConnectServer($type); + if ($response->status == 'SUCCESS') { + if ($Server->errno == 0) { + $message = ""; + $response = $Server->tryConnectServer($type); + $connDatabase = @mysql_connect($server, $user, $passwd); + $dbNameTest = "PROCESSMAKERTESTDC"; + $db = @mysql_query("CREATE DATABASE " . $dbNameTest, $connDatabase); + $success = false; + if (!$db) { + $message = mysql_error();; + } else { + $usrTest = "wfrbtest"; + $chkG = "GRANT ALL PRIVILEGES ON `" . $dbNameTest . "`.* TO " . $usrTest . "@'%' IDENTIFIED BY 'sample' WITH GRANT OPTION"; + $ch = @mysql_query($chkG, $connDatabase); + if (!$ch) { + $message = mysql_error(); + } else { + $sqlCreateUser = "CREATE USER '" . $user . "_usertest'@'%' IDENTIFIED BY 'sample'"; + $result = @mysql_query($sqlCreateUser, $connDatabase); + if (!$result) { + $message = mysql_error(); + } else { + $success = true; + $message = G::LoadTranslation('ID_SUCCESSFUL_CONNECTION'); + } + $sqlDropUser = "DROP USER '" . $user . "_usertest'@'%'"; + @mysql_query($sqlDropUser, $connDatabase); + + @mysql_query("DROP USER " . $usrTest . "@'%'", $connDatabase); + } + @mysql_query("DROP DATABASE " . $dbNameTest, $connDatabase); + } + return array($success, ($message != "")? $message : $Server->error); + } else { + return array(false, $Server->error); + } + } else { + return array(false, $Server->error); + } + } else { + return array(false, $Server->error); + } + } else { + return array(false, $Server->error); + } + } else { + return array(false, $Server->error); + } +} + switch ($request) { //check if the APP_CACHE VIEW table and their triggers are installed case 'info': @@ -19,8 +100,7 @@ switch ($request) { $lang = (defined('SYS_LANG')) ? SYS_LANG : $appCacheViewEngine['LANG']; $status = strtoupper( $appCacheViewEngine['STATUS'] ); } else { - $confParams = Array ('LANG' => (defined('SYS_LANG')) ? SYS_LANG : 'en','STATUS' => '' - ); + $confParams = Array ('LANG' => (defined('SYS_LANG')) ? SYS_LANG : 'en','STATUS' => ''); $oConf->aConfig = $confParams; $oConf->saveConfig( 'APP_CACHE_VIEW_ENGINE', '', '', '' ); $lang = (defined('SYS_LANG')) ? SYS_LANG : 'en'; @@ -34,26 +114,22 @@ switch ($request) { //setup the appcacheview object, and the path for the sql files $appCache = new AppCacheView(); $appCache->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP ); - + $res = $appCache->getMySQLVersion(); //load translations G::LoadTranslation - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_MYSQL_VERSION' ) ,'value' => $res - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_MYSQL_VERSION' ) ,'value' => $res); $res = $appCache->checkGrantsForUser( false ); $currentUser = $res['user']; $currentUserIsSuper = $res['super']; - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_CURRENT_USER' ) ,'value' => $currentUser - ); - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_USER_SUPER_PRIVILEGE' ) ,'value' => $currentUserIsSuper - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_CURRENT_USER' ) ,'value' => $currentUser); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_USER_SUPER_PRIVILEGE' ) ,'value' => $currentUserIsSuper); try { PROPEL::Init( PATH_METHODS . 'dbConnections/rootDbConnections.php' ); $con = Propel::getConnection( "root" ); } catch (Exception $e) { - $result->info[] = array ('name' => 'Checking MySql Root user','value' => 'failed' - ); + $result->info[] = array ('name' => 'Checking MySql Root user','value' => 'failed'); $result->error = true; $result->errorMsg = $e->getMessage(); } @@ -62,19 +138,15 @@ switch ($request) { if (! $currentUserIsSuper && ! $result->error) { $res = $appCache->checkGrantsForUser( true ); if (! isset( $res['error'] )) { - $result->info[] = array ('name' => 'Root User','value' => $res['user'] - ); - $result->info[] = array ('name' => 'Root User has SUPER privilege','value' => $res['super'] - ); + $result->info[] = array ('name' => 'Root User','value' => $res['user']); + $result->info[] = array ('name' => 'Root User has SUPER privilege','value' => $res['super']); } else { - $result->info[] = array ('name' => 'Error','value' => $res['msg'] - ); + $result->info[] = array ('name' => 'Error','value' => $res['msg']); } $res = $appCache->setSuperForUser( $currentUser ); if (! isset( $res['error'] )) { - $result->info[] = array ('name' => 'Setting SUPER privilege','value' => 'Successfully' - ); + $result->info[] = array ('name' => 'Setting SUPER privilege','value' => 'Successfully'); } else { $result->error = true; $result->errorMsg = $res['msg']; @@ -85,41 +157,33 @@ switch ($request) { //now check if table APPCACHEVIEW exists, and it have correct number of fields, etc. $res = $appCache->checkAppCacheView(); - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TABLE' ),'value' => $res['found'] - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TABLE' ),'value' => $res['found']); - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_ROWS' ),'value' => $res['count'] - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_ROWS' ),'value' => $res['count']); //now check if we have the triggers installed //APP_DELEGATION INSERT $res = $appCache->triggerAppDelegationInsert( $lang, false ); - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_INSERT' ),'value' => $res - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_INSERT' ),'value' => $res); //APP_DELEGATION Update $res = $appCache->triggerAppDelegationUpdate( $lang, false ); - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_UPDATE' ),'value' => $res - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_UPDATE' ),'value' => $res); //APPLICATION UPDATE $res = $appCache->triggerApplicationUpdate( $lang, false ); - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_APPLICATION_UPDATE' ),'value' => $res - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_APPLICATION_UPDATE' ),'value' => $res); //APPLICATION DELETE $res = $appCache->triggerApplicationDelete( $lang, false ); - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_APPLICATION_DELETE' ),'value' => $res - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_APPLICATION_DELETE' ),'value' => $res); //CONTENT UPDATE $res = $appCache->triggerContentUpdate( $lang, false ); - $result->info[] = array ("name" => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_CONTENT_UPDATE' ),"value" => $res - ); + $result->info[] = array ("name" => G::LoadTranslation ( 'ID_CACHE_BUILDER_TRIGGER_CONTENT_UPDATE' ),"value" => $res); //show language - $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_LANGUAGE' ),'value' => $lang - ); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_CACHE_BUILDER_LANGUAGE' ),'value' => $lang); echo G::json_encode( $result ); break; @@ -131,8 +195,7 @@ switch ($request) { $langs = $Translations->getTranslationEnvironments(); foreach ($langs as $lang) { - $result->rows[] = Array ('LAN_ID' => $lang['LOCALE'],'LAN_NAME' => $lang['LANGUAGE'] - ); + $result->rows[] = Array ('LAN_ID' => $lang['LOCALE'],'LAN_NAME' => $lang['LANGUAGE']); } print (G::json_encode( $result )) ; @@ -186,8 +249,7 @@ switch ($request) { //set status in config table - $confParams = Array ('LANG' => $lang,'STATUS' => 'active' - ); + $confParams = Array ('LANG' => $lang,'STATUS' => 'active'); $conf->aConfig = $confParams; $conf->saveConfig( 'APP_CACHE_VIEW_ENGINE', '', '', '' ); @@ -198,35 +260,46 @@ switch ($request) { echo G::json_encode( $result ); } catch (Exception $e) { - $confParams = Array ('lang' => $lang,'status' => 'failed' - ); + $confParams = Array ('lang' => $lang,'status' => 'failed'); $appCacheViewEngine = $oServerConf->setProperty( 'APP_CACHE_VIEW_ENGINE', $confParams ); echo '{success: false, msg:"' . $e->getMessage() . '"}'; } break; case 'recreate-root': - $sh = md5( filemtime( PATH_GULLIVER . "/class.g.php" ) ); - $h = G::encrypt( $_POST['host'] . $sh . $_POST['user'] . $sh . $_POST['password'] . $sh . (1), $sh ); - $insertStatements = "define ( 'HASH_INSTALLATION','{$h}' ); \ndefine ( 'SYSTEM_HASH', '{$sh}' ); \n"; - $lines = array (); - $content = ''; - $filename = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php'; - $lines = file( $filename ); + $user = $_POST['user']; + $passwd = $_POST['password']; + $server = $_POST['host']; + $aServer = split(":", $server); + $serverName = $aServer[0]; + $port = (count($aServer)>1) ? $aServer[1] : "none"; + list($sucess, $msgErr) = testConnection(DB_ADAPTER, $serverName, $user, $passwd, $port); - $count = 1; - foreach ($lines as $line_num => $line) { - $pos = strpos( $line, "define" ); - if ($pos !== false && $count < 3) { - $content = $content . $line; - $count ++; + if ($sucess) { + $sh = md5( filemtime( PATH_GULLIVER . "/class.g.php" ) ); + $h = G::encrypt( $_POST['host'] . $sh . $_POST['user'] . $sh . $_POST['password'] . $sh . (1), $sh ); + $insertStatements = "define ( 'HASH_INSTALLATION','{$h}' ); \ndefine ( 'SYSTEM_HASH', '{$sh}' ); \n"; + $lines = array (); + $content = ''; + $filename = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php'; + $lines = file( $filename ); + + $count = 1; + foreach ($lines as $line_num => $line) { + $pos = strpos( $line, "define" ); + if ($pos !== false && $count < 3) { + $content = $content . $line; + $count ++; + } + } + $content = "getNewCriterion(UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_EMAIL, '%' . $filter . '%', Criteria::LIKE)))); $oCriteria->add($cc); } - $oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED' - ), Criteria::NOT_IN); + $oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN); if ($auths != '') { $totalRows = sizeof($aUsers); } else { @@ -393,23 +393,11 @@ try { $oCriteria->addAsColumn('TOTAL_CASES', 0); $oCriteria->addAsColumn('DUE_DATE_OK', 1); $sep = "'"; - $oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED' - ), Criteria::NOT_IN); + $oCriteria->add(UsersPeer::USR_STATUS, array('CLOSED'), Criteria::NOT_IN); if ($filter != '') { $cc = $oCriteria->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(UsersPeer::USR_EMAIL, '%' . $filter . '%', Criteria::LIKE)))); $oCriteria->add($cc); } - // $sw_add = false; - // for ($i=0; $i < sizeof($aUsers); $i++){ - // if ($i>0){ - // $tmpL = $tmpL->addOr($oCriteria->getNewCriterion(UsersPeer::USR_UID, $aUsers[$i],Criteria::EQUAL)); - // }else{ - // $uList = $oCriteria->getNewCriterion(UsersPeer::USR_UID, $aUsers[$i],Criteria::EQUAL); - // $tmpL = $uList; - // $sw_add = true; - // } - // } - // if ($sw_add) $oCriteria->add($uList); if (sizeof($aUsers) > 0) { $oCriteria->add(UsersPeer::USR_UID, $aUsers, Criteria::IN); } elseif ($totalRows == 0 && $auths != '') { @@ -438,9 +426,12 @@ try { require_once PATH_CONTROLLERS . 'adminProxy.php'; $uxList = adminProxy::getUxTypesList(); + $oRoles = new Roles(); $rows = Array(); while ($oDataset->next()) { $row = $oDataset->getRow(); + $uRole = $oRoles->loadByCode($row['USR_ROLE']); + $row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['USR_ROLE']) : $uRole['USR_ROLE']; $row['DUE_DATE_OK'] = (date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE']))) ? 0 : 1; $row['LAST_LOGIN'] = isset($aLogin[$row['USR_UID']]) ? $aLogin[$row['USR_UID']] : ''; $row['TOTAL_CASES'] = isset($aCases[$row['USR_UID']]) ? $aCases[$row['USR_UID']] : 0; diff --git a/workflow/engine/templates/admin/system.js b/workflow/engine/templates/admin/system.js index bc94e88cd..2d7ee926a 100644 --- a/workflow/engine/templates/admin/system.js +++ b/workflow/engine/templates/admin/system.js @@ -101,12 +101,26 @@ Ext.onReady(function(){ name : 'memory_limit', fieldLabel: _('ID_MEMORY_LIMIT'), allowBlank: false, + autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15 }, value: sysConf.memory_limit, listeners:{ change: function(){ changeSettings(); } } + }, { + xtype: 'numberfield', + id : 'max_life_time', + name : 'max_life_time', + fieldLabel: _('ID_MAX_LIFETIME'), + // allowBlank: false, + autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15 }, + value: sysConf.session_gc_maxlifetime, + listeners:{ + change: function(){ + changeSettings(); + } + } } ] }); diff --git a/workflow/engine/templates/dashboard/index.js b/workflow/engine/templates/dashboard/index.js index 179b42b73..832a35a4f 100644 --- a/workflow/engine/templates/dashboard/index.js +++ b/workflow/engine/templates/dashboard/index.js @@ -42,6 +42,7 @@ var reallocate = function (cols) { } }.defaults(3); + Ext.onReady(function(){ Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); @@ -141,7 +142,6 @@ Ext.onReady(function(){ } }; */ - pd.items.items[0].columnWidth = 0.49; pd.items.items[1].columnWidth = 0.49; pd.items.items[2].columnWidth = 0.01; @@ -320,28 +320,47 @@ Ext.onReady(function(){ } } - - pd.doLayout(); - - if (dashletsColumns == 2) { - tbDashboard.items.items[0].setDisabled(false); - tbDashboard.items.items[1].setDisabled(true); - - var pd = Ext.getCmp('portalDashboard'); - - pd.items.items[0].columnWidth = 0.49; - pd.items.items[1].columnWidth = 0.49; - pd.items.items[2].columnWidth = 0.01; - pd.doLayout(); - } else { - var pd = Ext.getCmp('portalDashboard'); - - pd.items.items[0].columnWidth = 0.33; - pd.items.items[1].columnWidth = 0.33; - pd.items.items[2].columnWidth = 0.33; pd.doLayout(); - tbDashboard.items.items[0].setDisabled(true); - tbDashboard.items.items[1].setDisabled(false); - } + switch(dashletsColumns) { + case 1: + var pd = Ext.getCmp("portalDashboard"); + reallocate(1); + + pd.items.items[0].columnWidth = 0.98; + pd.items.items[1].columnWidth = 0.01; + pd.items.items[2].columnWidth = 0.01; + pd.doLayout(); + + tbDashboard.items.items[0].setDisabled(false); + tbDashboard.items.items[1].setDisabled(false); + tbDashboard.items.items[2].setDisabled(true); + break; + case 2: + var pd = Ext.getCmp("portalDashboard"); + reallocate(2); + + pd.items.items[0].columnWidth = 0.49; + pd.items.items[1].columnWidth = 0.49; + pd.items.items[2].columnWidth = 0.01; + pd.doLayout(); + + tbDashboard.items.items[0].setDisabled(false); + tbDashboard.items.items[1].setDisabled(true); + tbDashboard.items.items[2].setDisabled(false); + break; + case 3: + var pd = Ext.getCmp("portalDashboard"); + reallocate(3); + + pd.items.items[0].columnWidth = 0.33; + pd.items.items[1].columnWidth = 0.33; + pd.items.items[2].columnWidth = 0.33; + pd.doLayout(); + + tbDashboard.items.items[0].setDisabled(true); + tbDashboard.items.items[1].setDisabled(false); + tbDashboard.items.items[2].setDisabled(false); + break; + } }); diff --git a/workflow/engine/templates/pmTables/data.js b/workflow/engine/templates/pmTables/data.js index eb7ffacd6..2107a9376 100755 --- a/workflow/engine/templates/pmTables/data.js +++ b/workflow/engine/templates/pmTables/data.js @@ -112,7 +112,7 @@ Ext.onReady(function(){ columnAlign = 'right'; columnEditor = { xtype : 'numberfield', - format : 'Y-m-d', + decimalPrecision : 8, allowBlank : true }; break; diff --git a/workflow/engine/xmlform/outputdocs/outputdocs_Edit.xml b/workflow/engine/xmlform/outputdocs/outputdocs_Edit.xml index 38e7bfc69..208a4b172 100755 --- a/workflow/engine/xmlform/outputdocs/outputdocs_Edit.xml +++ b/workflow/engine/xmlform/outputdocs/outputdocs_Edit.xml @@ -20,7 +20,19 @@ function cancel(){ tinyMCE.execCommand('mceRemoveControl',false,'form[OUT_DOC_TEMPLATE]'); - outputdocsEditor.remove(); + if (( _BROWSER.name == 'msie' ) && ( _BROWSER.version < '9' )) { + window.close(); + } else { + outputdocsEditor.remove(); + } + } + if (( _BROWSER.name == 'msie' ) && ( _BROWSER.version < '9' )) { + function outputdocsSave( form ) { + tinyMCE.execCommand('mceRemoveControl',false,'form[OUT_DOC_TEMPLATE]'); + form.action = '../outputdocs/outputdocs_Save'; + ajax_post( form.action, form, 'POST' ); + window.close(); + } } ]]> diff --git a/workflow/engine/xmlform/outputdocs/outputdocs_Options.xml b/workflow/engine/xmlform/outputdocs/outputdocs_Options.xml index afd7f8b42..93088e9a1 100755 --- a/workflow/engine/xmlform/outputdocs/outputdocs_Options.xml +++ b/workflow/engine/xmlform/outputdocs/outputdocs_Options.xml @@ -25,7 +25,7 @@ var outputdocsEditor; var left = (screen.width/2)-(w/2); var top = (screen.height/2);//-(h/2); - var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); + var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); } //////////////////////////////////////////////////// diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 9270dce25..2233bef8b 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -223,8 +223,13 @@ define( 'PML_WSDL_URL', PML_SERVER . '/syspmLibrary/en/green/services/wsdl' ); define( 'PML_UPLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/uploadProcess' ); define( 'PML_DOWNLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/download' ); +$config = Bootstrap::getSystemConfiguration(); // starting session -$timelife = ini_get('session.gc_maxlifetime'); +if (isset($config['session.gc_maxlifetime'])) { + $timelife = $config['session.gc_maxlifetime']; +} else { + $timelife = ini_get('session.gc_maxlifetime'); +} if (is_null($timelife)) { $timelife = 1440; } @@ -232,7 +237,6 @@ ini_set('session.gc_maxlifetime', $timelife); ini_set('session.cookie_lifetime', $timelife); session_start(); -$config = Bootstrap::getSystemConfiguration(); $e_all = defined( 'E_DEPRECATED' ) ? E_ALL & ~ E_DEPRECATED : E_ALL; $e_all = defined( 'E_STRICT' ) ? $e_all & ~ E_STRICT : $e_all;