release/3.2.2 to develop conflicts

This commit is contained in:
Paula Quispe
2017-10-23 11:37:41 -04:00
185 changed files with 2479 additions and 2209 deletions

View File

@@ -290,7 +290,7 @@ class WebApplication
}
// Setting current workspace to Api class
Services\Api::setWorkspace(SYS_SYS);
Services\Api::setWorkspace(config("system.workspace"));
$cacheDir = defined("PATH_WORKSPACE") ? PATH_WORKSPACE : (defined("PATH_C") ? PATH_C : sys_get_temp_dir());
$sysConfig = System::getSystemConfiguration();
@@ -387,7 +387,7 @@ class WebApplication
}
}
Services\OAuth2\Server::setWorkspace(SYS_SYS);
Services\OAuth2\Server::setWorkspace(config("system.workspace"));
$this->rest->addAPIClass('\ProcessMaker\\Services\\OAuth2\\Server', 'oauth2');
return $uri;
@@ -498,15 +498,16 @@ class WebApplication
}
define("SYS_SYS", $workspace);
config(["system.workspace" => $workspace]);
if (!file_exists(PATH_DB . SYS_SYS . PATH_SEP . "db.php")) {
if (!file_exists(PATH_DB . config("system.workspace") . PATH_SEP . "db.php")) {
$rest = new \Maveriks\Extension\Restler();
$rest->setMessage(new RestException(Api::STAT_APP_EXCEPTION, \G::LoadTranslation("ID_NOT_WORKSPACE")));
exit(0);
}
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
//Do not change any of these settings directly, use env.ini instead
ini_set('display_errors', $arraySystemConfiguration['display_errors']);
@@ -524,11 +525,11 @@ class WebApplication
define('SYS_SKIN', $arraySystemConfiguration['default_skin']);
define('DISABLE_DOWNLOAD_DOCUMENTS_SESSION_VALIDATION', $arraySystemConfiguration['disable_download_documents_session_validation']);
require_once(PATH_DB . SYS_SYS . "/db.php");
require_once(PATH_DB . config("system.workspace") . "/db.php");
// defining constant for workspace shared directory
$this->workspaceDir = PATH_DB . SYS_SYS . PATH_SEP;
$this->workspaceCacheDir = PATH_DB . SYS_SYS . PATH_SEP . "cache" . PATH_SEP;
$this->workspaceDir = PATH_DB . config("system.workspace") . PATH_SEP;
$this->workspaceCacheDir = PATH_DB . config("system.workspace") . PATH_SEP . "cache" . PATH_SEP;
define("PATH_WORKSPACE", $this->workspaceDir);
// including workspace shared classes -> particularlly for pmTables
@@ -539,7 +540,7 @@ class WebApplication
define("PATH_SMARTY_C", PATH_C . "smarty" . PATH_SEP . "c");
define("PATH_SMARTY_CACHE", PATH_C . "smarty" . PATH_SEP . "cache");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . config("system.workspace") . "/");
define("PATH_DOCUMENT", PATH_DATA_SITE . "files/");
define("PATH_DATA_MAILTEMPLATES", PATH_DATA_SITE . "mailTemplates/");
define("PATH_DATA_PUBLIC", PATH_DATA_SITE . "public/");

View File

@@ -2230,7 +2230,9 @@ function run_update_plugin_attributes($task, $args)
//Set variables
$pluginName = $args[0];
// virtual SYS_SYS for cache
define('SYS_SYS', uniqid());
$sys_sys = uniqid();
define('SYS_SYS', $sys_sys);
config(["system.workspace" => $sys_sys]);
foreach (PmSystem::listWorkspaces() as $value) {
\ProcessMaker\Util\Cnn::connect($value->name);
//Update plugin attributes

View File

@@ -107,5 +107,5 @@
}
function ajax_LoadJavaScript( $phpMethod, $phpFile ) {
print ' LoadPopJavaScript ( "/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/tools/loadJavaScript.html?method=' .$phpMethod . '&file=' . $phpFile . "\");\n";
print ' LoadPopJavaScript ( "/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/tools/loadJavaScript.html?method=' .$phpMethod . '&file=' . $phpFile . "\");\n";
}

View File

@@ -84,7 +84,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
/* Panels */
.panel_wrapper div.panel {display:none;}
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
/* Columns */

View File

@@ -140,7 +140,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
/* Panels */
.panel_wrapper div.panel {display:none;}
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
/* Columns */

View File

@@ -73,7 +73,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
/* Panels */
.panel_wrapper div.panel {display:none;}
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;}
/* Columns */

View File

@@ -84,7 +84,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
/* Panels */
.panel_wrapper div.panel {display:none;}
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
/* Columns */

View File

@@ -2121,8 +2121,8 @@ class Bootstrap
$sysCon["SYS_SKIN"] = SYS_SKIN;
}
if (defined("SYS_SYS")) {
$sysCon["SYS_SYS"] = SYS_SYS;
if (!empty(config("system.workspace"))) {
$sysCon["SYS_SYS"] = config("system.workspace");
}
$sysCon["APPLICATION"] = (isset($_SESSION["APPLICATION"])) ? $_SESSION["APPLICATION"] : "";
@@ -2567,11 +2567,7 @@ class Bootstrap
$hashType = Bootstrap::getPasswordHashType();
}
$filter = new InputFilter();
$hashType = $filter->validateInput($hashType);
$pass = $filter->validateInput($pass);
eval("\$var = hash('" . $hashType . "', '" . $pass . "');");
$var = hash($hashType, $pass);
if ($includeHashType) {
$var = $hashType . ':' . $var;
@@ -2686,7 +2682,7 @@ class Bootstrap
* @return array $aContext void
*/
public static function getDefaultContextLog(){
$sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";
$sysSys = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined";
$date = \ProcessMaker\Util\DateTime::convertUtcToTimeZone(date('Y-m-d H:m:s'));
$aContext = array(
'ip' => \G::getIpAddress()
@@ -2726,7 +2722,7 @@ class Bootstrap
$context['url'] = SYS_CURRENT_URI . '?' . SYS_CURRENT_PARMS;
}
$context['usrUid'] = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '';
$sysSys = defined("SYS_SYS") ? SYS_SYS : "Undefined";
$sysSys = !empty(config("system.workspace")) ? config("system.workspace") : "Undefined";
\Bootstrap::registerMonolog($channel, $level, $message, $context, $sysSys, 'processmaker.log');
}
@@ -2738,12 +2734,13 @@ class Bootstrap
* @return void
*/
public static function setConstantsRelatedWs($wsName = null) {
if (!defined('SYS_SYS') && !is_null($wsName)) {
if (empty(config("system.workspace")) && !is_null($wsName)) {
//If SYS_SYS exists, is not update with $wsName
define('SYS_SYS', $wsName);
config(["system.workspace" => $wsName]);
}
if (defined('SYS_SYS') && !defined('PATH_DATA_SITE')) {
define('PATH_DATA_SITE', PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP);
if (!empty(config("system.workspace")) && !defined('PATH_DATA_SITE')) {
define('PATH_DATA_SITE', PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP);
}
if (defined('PATH_DATA_SITE') && !defined('PATH_WORKSPACE')) {
define('PATH_WORKSPACE', PATH_DATA_SITE);

View File

@@ -267,7 +267,7 @@ class DataBaseMaintenance
// Commented that is not assigned to a variable.
// mysql_escape_string("';");
if (! @mysql_query( $sql )) {
$ws = (defined("SYS_SYS"))? SYS_SYS : "Wokspace Undefined";
$ws = (!empty(config("system.workspace")))? config("system.workspace") : "Wokspace Undefined";
Bootstrap::registerMonolog('MysqlCron', 400, mysql_error(), array('sql'=>$sql), $ws, 'processmaker.log');
$varRes = mysql_error() . "\n";
G::outRes( $varRes );
@@ -288,7 +288,7 @@ class DataBaseMaintenance
$tableName = str_replace( '.dump', '', basename( $backupFile ) );
$sql = "LOAD DATA INFILE '$backupFile' INTO TABLE $tableName FIELDS TERMINATED BY '\t|\t' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\t\t\r\r\n'";
if (! @mysql_query( $sql )) {
$ws = (defined("SYS_SYS"))? SYS_SYS : "Wokspace Undefined";
$ws = (!empty(config("system.workspace")))? config("system.workspace") : "Wokspace Undefined";
Bootstrap::registerMonolog('MysqlCron', 400, mysql_error(), array('sql'=>$sql), $ws, 'processmaker.log');
$varRes = mysql_error() . "\n";
G::outRes( $varRes );

View File

@@ -2448,7 +2448,7 @@ class G
global $RBAC;
if (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] == '') {
$sys = (ENABLE_ENCRYPT == 'yes' ? SYS_SYS : "sys" . SYS_SYS);
$sys = (ENABLE_ENCRYPT == 'yes' ? config("system.workspace") : "sys" . config("system.workspace"));
$lang = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( SYS_LANG ), URL_KEY ) : SYS_LANG);
$skin = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( SYS_SKIN ), URL_KEY ) : SYS_SKIN);
$login = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( 'login' ), URL_KEY ) : 'login');
@@ -2466,7 +2466,7 @@ class G
$sessionBrowser = defined( 'SESSION_BROWSER' ) ? SESSION_BROWSER : '';
if (($sessionPc == "1") or ($sessionBrowser == "1")) {
if ($row['LOG_STATUS'] == 'X') {
$sys = (ENABLE_ENCRYPT == 'yes' ? SYS_SYS : "sys" . SYS_SYS);
$sys = (ENABLE_ENCRYPT == 'yes' ? config("system.workspace") : "sys" . config("system.workspace"));
$lang = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( SYS_LANG ), URL_KEY ) : SYS_LANG);
$skin = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( SYS_SKIN ), URL_KEY ) : SYS_SKIN);
$login = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( 'login' ), URL_KEY ) : 'login');
@@ -2502,7 +2502,7 @@ class G
if ($sw == 0 && $urlNoAccess != "") {
$aux = explode( '/', $urlNoAccess );
$sys = (ENABLE_ENCRYPT == 'yes' ? SYS_SYS : "/sys" . SYS_LANG);
$sys = (ENABLE_ENCRYPT == 'yes' ? config("system.workspace") : "/sys" . SYS_LANG);
$lang = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( SYS_LANG ), URL_KEY ) : SYS_LANG);
$skin = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( SYS_SKIN ), URL_KEY ) : SYS_SKIN);
$login = (ENABLE_ENCRYPT == 'yes' ? G::encrypt( urldecode( $aux[0] ), URL_KEY ) : $aux[0]);
@@ -2563,7 +2563,7 @@ class G
{
$configuration = new Configurations();
if (defined('SYS_SYS') && $configuration->exists("ENVIRONMENT_SETTINGS")) {
if (!empty(config("system.workspace")) && $configuration->exists("ENVIRONMENT_SETTINGS")) {
return ($configuration->getDirectoryStructureVer() > 1);
}
return false;
@@ -2976,8 +2976,8 @@ class G
$sysCon["SYS_SKIN"] = SYS_SKIN;
}
if (defined("SYS_SYS")) {
$sysCon["SYS_SYS"] = SYS_SYS;
if (!empty(config("system.workspace"))) {
$sysCon["SYS_SYS"] = config("system.workspace");
}
$sysCon["APPLICATION"] = (isset($_SESSION["APPLICATION"]))? $_SESSION["APPLICATION"] : "";
@@ -5445,7 +5445,7 @@ class G
*/
public static function auditLog($actionToLog, $valueToLog = "")
{
$workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
$workspace = !empty(config("system.workspace")) ? config("system.workspace") : 'Wokspace Undefined';
$conf = new Configurations();
$sflag = $conf->getConfiguration('AUDIT_LOG', 'log');
$sflagAudit = $sflag == 'true' ? true : false;

View File

@@ -388,7 +388,7 @@ class headPublisher
*/
// Load external/plugin css
// NOTE is necesary to move this to decorator server
if (class_exists('ProcessMaker\Plugins\PluginRegistry') && defined('SYS_SYS')) {
if (class_exists('ProcessMaker\Plugins\PluginRegistry') && !empty(config("system.workspace"))) {
$oPluginRegistry = PluginRegistry::loadSingleton();
$registeredCss = $oPluginRegistry->getRegisteredCss();
/** @var \ProcessMaker\Plugins\Interfaces\CssFile $cssFile */
@@ -553,7 +553,7 @@ class headPublisher
$this->extJsScript[] = '/extjs/' . $cacheName;
//hook for registered javascripts from plugins
if (class_exists('ProcessMaker\Plugins\PluginRegistry') && defined('SYS_SYS')) {
if (class_exists('ProcessMaker\Plugins\PluginRegistry') && !empty(config("system.workspace"))) {
$oPluginRegistry = PluginRegistry::loadSingleton();
$pluginJavascripts = $oPluginRegistry->getRegisteredJavascriptBy($filename);
} else {

View File

@@ -310,9 +310,9 @@ class Menu
$target = $this->Options[$intPos];
if ($this->Types[$intPos] != "absolute") {
if (defined('ENABLE_ENCRYPT')) {
$target = "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $target;
} elseif (defined('SYS_SYS')) {
$target = "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $target;
$target = "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $target;
} elseif (!empty(config("system.workspace"))) {
$target = "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $target;
} else {
$target = "/sys/" . SYS_LANG . "/" . SYS_SKIN . "/" . $target;
}
@@ -358,7 +358,7 @@ class Menu
$target = $this->Options[$ncount];
}
if ($this->Types[$ncount] != 'absolute') {
if (defined('SYS_SYS')) {
if (!empty(config("system.workspace"))) {
$target = '/sys' . SYS_TEMP . G::encryptLink('/' . SYS_LANG . '/' . SYS_SKIN . '/' . $this->Options[$ncount]);
} else {
$target = '/sys/' . G::encryptLink(SYS_LANG . '/' . SYS_SKIN . '/' . $this->Options[$ncount]);

View File

@@ -31,7 +31,7 @@ class MonologProvider
public $numOfKeepFiles = 60;
public $levelDebug = 100;
public $bubble = true;
public $filePermission = 0775;
public $filePermission = 0666;
public function __construct ($channel, $fileLog)
{

View File

@@ -21,7 +21,7 @@ class PMException extends Exception
}
public static function registerErrorLog($error, $token){
$ws = (defined("SYS_SYS"))? SYS_SYS : "Wokspace Undefined";
$ws = (!empty(config("system.workspace")))? config("system.workspace") : "Wokspace Undefined";
Bootstrap::registerMonolog('ExceptionCron', 400, $error->getMessage(), array('token'=>$token), $ws, 'processmaker.log');
}
}

View File

@@ -185,6 +185,7 @@ class RBAC
];
$this->aliasPermissions['PM_CASES'] = [self::PM_GUEST_CASE];
$this->aliasPermissions['PM_LOGIN'] = [self::PM_GUEST_CASE];
}
/**
@@ -793,7 +794,7 @@ class RBAC
* @access public
* @param string $strUser the system
* @param string $strPass the password
* @return $res
* @return $result
*/
public function checkAutomaticRegister($strUser, $strPass)
{
@@ -817,17 +818,25 @@ class RBAC
$plugin->sSystem = $this->sSystem;
//search the usersRolesObj
//create the users in ProcessMaker
$res = $plugin->automaticRegister($row, $strUser, $strPass);
if ($res == 1) {
return $res;
try {
$res = $plugin->automaticRegister($row, $strUser, $strPass);
if ($res == 1) {
return $res;
}
} catch (Exception $e) {
$context = Bootstrap::getDefaultContextLog();
$context["action"] = "ldapSynchronize";
$context["authSource"] = $row;
Bootstrap::registerMonolog("ldapSynchronize", 400, $e->getMessage(), $context, $context["workspace"], "processmaker.log");
}
}
$dataset->next();
$row = $dataset->getRow();
}
}
}
return $result;
}
/**

View File

@@ -461,7 +461,7 @@ class Table
//$res .= "<a class=\"" . $strClass . "Link\" href=\"";
$res .= "<a class=\"" . $strClass . "\" href=\"";
$res .= (ENABLE_ENCRYPT == 'yes' ? str_replace( G::encrypt( 'sys' . SYS_SYS, URL_KEY ), SYS_SYS, G::encryptUrl( urldecode( SYS_CURRENT_URI ), URL_KEY ) ) : SYS_CURRENT_URI) . "?order=" . $this->Columns[$intPos]['Name'] . "&page=" . $pa . "&label=true";
$res .= (ENABLE_ENCRYPT == 'yes' ? str_replace( G::encrypt( 'sys' . config("system.workspace"), URL_KEY ), config("system.workspace"), G::encryptUrl( urldecode( SYS_CURRENT_URI ), URL_KEY ) ) : SYS_CURRENT_URI) . "?order=" . $this->Columns[$intPos]['Name'] . "&page=" . $pa . "&label=true";
//$res .= $_SERVER['REDIRECT_URL'] . "?order=" . $this->Columns[$intPos]['Name']."&page=".$pa."&label=true";
$res .= "\">" . $this->Labels[$intPos] . "</a>";

View File

@@ -75,7 +75,7 @@ class XmlFormFieldWYSIWYGEditor extends XmlFormField
public function attachEvents ($element)
{
$editorDefinition = 'tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce"; ';
$editorDefinition .= 'var domainURL = "/sys'.SYS_SYS.'/'.SYS_LANG.'/'.SYS_SKIN.'/"';
$editorDefinition .= 'var domainURL = "/sys'.config("system.workspace").'/'.SYS_LANG.'/'.SYS_SKIN.'/"';
$serverConf =& ServerConf::getSingleton();
switch ($this->editorType){

View File

@@ -255,7 +255,7 @@ class XmlFormField
$rs = $con->executeQuery( $query, ResultSet::FETCHMODE_NUM );
} catch (Exception $e) {
//dismiss error because dbarray shouldnt be defined in some contexts.
$workspace = defined("SYS_SYS")? SYS_SYS : "Wokspace Undefined";
$workspace = !empty(config("system.workspace"))? config("system.workspace") : "Wokspace Undefined";
G::log($workspace . " | ip: | " . G::getIpAddress() . " | type error: | " . $e->getMessage() . " | query: " . $query, PATH_DATA, "queriesWithErrors.log");
return $result;
@@ -267,7 +267,7 @@ class XmlFormField
$rs = $stmt->executeQuery( $query, ResultSet::FETCHMODE_NUM );
} catch (Exception $e) {
//dismiss error because dbarray shouldnt be defined in some contexts.
$workspace = defined("SYS_SYS")? SYS_SYS : "Wokspace Undefined";
$workspace = !empty(config("system.workspace"))? config("system.workspace") : "Wokspace Undefined";
G::log($workspace . " | ip: | " . G::getIpAddress() . " | type error: | " . $e->getMessage() . " | query: " . $query, PATH_DATA, "queriesWithErrors.log");
return $result;
@@ -5480,7 +5480,7 @@ class XmlForm
$this->fileName = $filename;
$parsedFile = dirname( $filename ) . PATH_SEP . basename( $filename, 'xml' ) . $language;
$parsedFilePath = defined( 'PATH_C' ) ? (defined( 'SYS_SYS' ) ? PATH_C . 'ws' . PATH_SEP . SYS_SYS . PATH_SEP : PATH_C) : PATH_DATA;
$parsedFilePath = defined('PATH_C') ? (!empty(config("system.workspace")) ? PATH_C . 'ws' . PATH_SEP . config("system.workspace") . PATH_SEP : PATH_C) : PATH_DATA;
$parsedFilePath .= 'xmlform/' . substr( $parsedFile, strlen( $this->home ) );
// Improvement for the js cache - Start

View File

@@ -28,7 +28,7 @@ class WorkflowTestCase extends TestCase
$pdo->exec(file_get_contents(PATH_RBAC_CORE.'data/mysql/insert.sql'));
$pdo->exec("INSERT INTO `APP_SEQUENCE` (`ID`) VALUES ('1')");
$pdo->exec("INSERT INTO `OAUTH_CLIENTS` (`CLIENT_ID`, `CLIENT_SECRET`, `CLIENT_NAME`, `CLIENT_DESCRIPTION`, `CLIENT_WEBSITE`, `REDIRECT_URI`, `USR_UID`) VALUES
('x-pm-local-client', '179ad45c6ce2cb97cf1029e212046e81', 'PM Web Designer', 'ProcessMaker Web Designer App', 'www.processmaker.com', 'http://".$_SERVER["HTTP_HOST"].":".$_SERVER['SERVER_PORT']."/sys".SYS_SYS."/en/neoclassic/oauth2/grant', '00000000000000000000000000000001');");
('x-pm-local-client', '179ad45c6ce2cb97cf1029e212046e81', 'PM Web Designer', 'ProcessMaker Web Designer App', 'www.processmaker.com', 'http://".$_SERVER["HTTP_HOST"].":".$_SERVER['SERVER_PORT']."/sys".config("system.workspace")."/en/neoclassic/oauth2/grant', '00000000000000000000000000000001');");
$pdo->exec("INSERT INTO `OAUTH_ACCESS_TOKENS` (`ACCESS_TOKEN`, `CLIENT_ID`, `USER_ID`, `EXPIRES`, `SCOPE`) VALUES
('39704d17049f5aef45e884e7b769989269502f83', 'x-pm-local-client', '00000000000000000000000000000001', '2017-06-15 17:55:19', 'view_processes edit_processes *');");
}
@@ -193,7 +193,7 @@ class WorkflowTestCase extends TestCase
protected function getBaseUrl($url)
{
return (\G::is_https() ? "https://" : "http://").
$GLOBALS["APP_HOST"].':'.$GLOBALS['SERVER_PORT']."/sys".SYS_SYS."/".
$GLOBALS["APP_HOST"].':'.$GLOBALS['SERVER_PORT']."/sys".config("system.workspace")."/".
SYS_LANG."/".SYS_SKIN."/".$url;
}
}

View File

@@ -72,6 +72,6 @@ class SkinsTest extends \WorkflowTestCase
$this->assertCount(4, $skins);
$this->assertEquals($skins[2]['SKIN_FOLDER_ID'], 'test');
$this->assertEquals($skins[3]['SKIN_FOLDER_ID'], 'test2');
$this->assertEquals($skins[3]['SKIN_WORKSPACE'], SYS_SYS);
$this->assertEquals($skins[3]['SKIN_WORKSPACE'], config("system.workspace"));
}
}

View File

@@ -284,7 +284,7 @@ class WebEntryEventTest extends \WorkflowTestCase
$this->createWebEntryEvent(
$processUid, $entryEvents,
[
'WEE_URL' => $this->domain."/sys".SYS_SYS."/".SYS_LANG."/".SYS_SKIN."/".$processUid."/custom.php",
'WEE_URL' => $this->domain."/sys".config("system.workspace")."/".SYS_LANG."/".SYS_SKIN."/".$processUid."/custom.php",
'WE_TYPE' => "NOT-VALID-SINGLE",
'WE_CUSTOM_TITLE' => $this->customTitle,
'WE_AUTHENTICATION' => 'NOT-VALID-ANONYMOUS',
@@ -373,7 +373,7 @@ class WebEntryEventTest extends \WorkflowTestCase
$webEntryEventUid,
$userUidUpdater,
[
'WEE_URL' => $this->domain."/sys".SYS_SYS."/".SYS_LANG."/".SYS_SKIN."/".$processUid."/custom.php",
'WEE_URL' => $this->domain."/sys".config("system.workspace")."/".SYS_LANG."/".SYS_SKIN."/".$processUid."/custom.php",
'WE_TYPE' => "NOT-VALID-SINGLE",
'WE_CUSTOM_TITLE' => $this->customTitle,
'WE_AUTHENTICATION' => 'NOT-VALID-ANONYMOUS',
@@ -671,7 +671,7 @@ class WebEntryEventTest extends \WorkflowTestCase
private function getSimpleWebEntryUrl(\WebEntry $we)
{
return (\G::is_https() ? "https://" : "http://").
$_SERVER["HTTP_HOST"]."/sys".SYS_SYS."/".
$_SERVER["HTTP_HOST"]."/sys".config("system.workspace")."/".
SYS_LANG."/".SYS_SKIN."/".$we->getProUid()."/".$we->getWeData();
}

View File

@@ -102,7 +102,6 @@ define('MAX_IMAGE_ROW_LEN',16);
define('MAX_TRANSPARENT_IMAGE_ROW_LEN',16);
define('CACHE_DIR', HTML2PS_DIR.'cache/');
//define('OUTPUT_FILE_DIRECTORY', HTML2PS_DIR.'out/'.(defined('SYS_SYS') ? SYS_SYS . '/' : ''));
define('OUTPUT_FILE_DIRECTORY', PATH_OUTPUT_FILE_DIRECTORY);
define('FPDF_PATH', HTML2PS_DIR.'fpdf/');

View File

@@ -284,8 +284,9 @@ class Log_file extends Log
if ( !defined('PM_PID') ) {
define ('PM_PID', rand(0,1000) );
}
if ( !defined('SYS_SYS') ) {
if (empty(config("system.workspace"))) {
define ('SYS_SYS', '' );
config(["system.workspace" => ""]);
}
/* If a priority hasn't been specified, use the default value. */
if ($priority === null) {
@@ -326,7 +327,7 @@ class Log_file extends Log
$micro = date('H:i:s.') . sprintf("%04d", floor($usec * 10000 ));
/* Build the string containing the complete message */
$msg = sprintf ( "%s|%s|%s|%05d|%s|%s|%s|%s|%s\n", $micro,SYS_SYS,$ip, $myPid, $message, $backTrace[3], $method, $uri, $request);
$msg = sprintf ( "%s|%s|%s|%05d|%s|%s|%s|%s|%s\n", $micro,config("system.workspace"),$ip, $myPid, $message, $backTrace[3], $method, $uri, $request);
/* Build the string containing the complete log line. */
$line = $this->_format('%4$s', $micro,'',$msg );

View File

@@ -239,11 +239,10 @@ class PmBootstrap extends Bootstrap
public function initPropel($sys = '')
{
if (empty($sys)) {
if (! defined(SYS_SYS)) {
throw new Exception("Error: Undefined syemtem env. constant 'SYS_SYS'");
$sys = config("system.workspace");
if (empty($sys)) {
throw new Exception("Error: Undefined system environment (workspace).");
}
$sys = SYS_SYS;
}
// setup propel definitions and logging

View File

@@ -132,12 +132,13 @@ try {
if (is_dir(PATH_DB . $workspace) && file_exists(PATH_DB . $workspace . PATH_SEP . 'db.php')) {
define('SYS_SYS', $workspace);
config(["system.workspace" => $workspace]);
include_once(PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php');
include_once(PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
//PM Paths DATA
define('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
define('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
define('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
define('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
define('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
@@ -417,7 +418,7 @@ function executePlugins()
}
if ($handle = opendir($pathCronPlugins)) {
setExecutionMessage('Executing cron files in bin/plugins directory in Workspace: ' . SYS_SYS);
setExecutionMessage('Executing cron files in bin/plugins directory in Workspace: ' . config("system.workspace"));
while (false !== ($file = readdir($handle))) {
if (strpos($file, '.php',1) && is_file($pathCronPlugins . $file)) {
$filename = str_replace('.php' , '', $file);
@@ -437,7 +438,7 @@ function executePlugins()
// -> Execute functions
if (!empty($cronFiles)) {
setExecutionMessage('Executing registered cron files for Workspace: ' . SYS_SYS);
setExecutionMessage('Executing registered cron files for Workspace: ' . config("system.workspace"));
foreach($cronFiles as $cronFile) {
executeCustomCronFunction(PATH_PLUGINS . $cronFile->namespace . PATH_SEP . 'bin' . PATH_SEP . $cronFile->cronFile . '.php', $cronFile->cronFile);
}
@@ -819,7 +820,7 @@ function executeCaseSelfService()
unset($appFields['APP_PIN']);
$case->updateCase($appFields["APP_UID"], $appFields);
saveLog("unassignedCase", "action", "OK Executed tigger to the case $appcacheAppNumber");
saveLog("unassignedCase", "action", "OK Executed trigger to the case $appcacheAppNumber");
}
}

View File

@@ -128,7 +128,7 @@ print "PATH_DB: " . PATH_DB . "\n";
print "PATH_CORE: " . PATH_CORE . "\n";
// define the site name (instance name)
if (! defined ('SYS_SYS')) {
if (empty(config("system.workspace"))) {
$sObject = $workspaceName;
$sNow = ''; // $argv[2];
$sFilter = '';
@@ -144,11 +144,12 @@ if (! defined ('SYS_SYS')) {
if (file_exists (PATH_DB . $sObject . PATH_SEP . 'db.php')) {
define ('SYS_SYS', $sObject);
config(["system.workspace" => $sObject]);
// ****************************************
// read initialize file
require_once PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.system.php';
$config = System::getSystemConfiguration ('', '', SYS_SYS);
$config = System::getSystemConfiguration ('', '', config("system.workspace"));
define ('MEMCACHED_ENABLED', $config ['memcached']);
define ('MEMCACHED_SERVER', $config ['memcached_server']);
define ('TIME_ZONE', $config ['time_zone']);
@@ -170,7 +171,7 @@ if (! defined ('SYS_SYS')) {
include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
// ***************** PM Paths DATA **************************
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
define ('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
define ('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
define ('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
@@ -264,7 +265,7 @@ function processWorkspace()
try {
if (($solrConf = System::solrEnv (SYS_SYS)) !== false) {
if (($solrConf = System::solrEnv (config("system.workspace"))) !== false) {
print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n";
print "solr_enabled: " . $solrConf ['solr_enabled'] . "\n";
print "solr_host: " . $solrConf ['solr_host'] . "\n";

View File

@@ -46,11 +46,12 @@ function run_addon_core_install($args)
$storeId = $args[1];
$addonName = $args[2];
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspace);
config(["system.workspace" => $workspace]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . config("system.workspace") . "/");
}
if (!defined("DB_ADAPTER")) {
define("DB_ADAPTER", $args[3]);
@@ -102,11 +103,12 @@ function change_hash($command, $opts)
$response = new stdclass();
$response->workspace = $workspace;
$response->hash = $hash;
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspace->name);
config(["system.workspace" => $workspace->name]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . config("system.workspace") . "/");
}
$_SESSION['__sw__'] = '';
if (!$workspace->changeHashPassword($workspace->name, $response)) {

View File

@@ -132,12 +132,13 @@ function run_upgrade($command, $args)
$flagUpdateXml = !array_key_exists('noxml', $args);
foreach ($workspaces as $index => $workspace) {
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspace->name);
config(["system.workspace" => $workspace->name]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP);
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP);
}
if(!defined('DB_ADAPTER')) {

View File

@@ -358,12 +358,13 @@ function run_workspace_upgrade($args, $opts)
foreach ($workspaces as $workspace) {
try {
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspace->name);
config(["system.workspace" => $workspace->name]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP);
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP);
}
$workspace->upgrade($buildCacheView, $workspace->name, false, $lang, ['updateXml' => $flagUpdateXml, 'updateMafe' => $first]);

View File

@@ -98,7 +98,7 @@ print "PATH_DB: " . PATH_DB . "\n";
print "PATH_CORE: " . PATH_CORE . "\n";
// define the site name (instance name)
if (! defined ('SYS_SYS')) {
if (empty(config("system.workspace"))) {
$sObject = $workspaceName;
$sNow = ''; // $argv[2];
/*
@@ -115,11 +115,12 @@ if (! defined ('SYS_SYS')) {
if (file_exists (PATH_DB . $sObject . PATH_SEP . 'db.php')) {
define ('SYS_SYS', $sObject);
config(["system.workspace" => $sObject]);
// ****************************************
// read initialize file
require_once PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.system.php';
$config = System::getSystemConfiguration ('', '', SYS_SYS);
$config = System::getSystemConfiguration ('', '', config("system.workspace"));
define ('MEMCACHED_ENABLED', $config ['memcached']);
define ('MEMCACHED_SERVER', $config ['memcached_server']);
define ('TIME_ZONE', $config ['time_zone']);
@@ -142,7 +143,7 @@ if (! defined ('SYS_SYS')) {
print "MEMCACHED_SERVER: " . $MEMCACHED_SERVER . "\n";
// ***************** PM Paths DATA **************************
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
define ('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
define ('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
define ('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
@@ -337,7 +338,7 @@ function displayMissingCases($aAppUidsDB, $aAppUidsSolr)
function getListUids($usrUid, $action)
{
if (($solrConf = System::solrEnv (SYS_SYS)) !== false) {
if (($solrConf = System::solrEnv (config("system.workspace"))) !== false) {
print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n";
print "solr_enabled: " . $solrConf ['solr_enabled'] . "\n";

Some files were not shown because too many files have changed in this diff Show More