This commit is contained in:
Paula Quispe
2017-10-19 12:58:04 -04:00
152 changed files with 432 additions and 413 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

@@ -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"] : "";
@@ -2682,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()
@@ -2722,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');
}
@@ -2734,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

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

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

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

@@ -369,12 +369,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";

View File

@@ -160,7 +160,7 @@ class ActionsByEmailCoreClass extends PMPlugin
if (!empty($envPort) && strpos($envHost, $envPort) === false) {
$envHost = $envHost . $envPort;
}
$link = (G::is_https() || $envProtocol ? 'https://' : 'http://') . $envHost . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . $envSkin . '/services/ActionsByEmail';
$link = (G::is_https() || $envProtocol ? 'https://' : 'http://') . $envHost . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $envSkin . '/services/ActionsByEmail';
switch ($configuration['ABE_TYPE']) {
case 'CUSTOM':

View File

@@ -705,7 +705,7 @@ class Applications
$tableName = implode( '', $newTableName );
// so the pm table class can be invoqued from the pm table model clases
if (! class_exists( $tableName )) {
require_once (PATH_DB . SYS_SYS . PATH_SEP . "classes" . PATH_SEP . $tableName . ".php");
require_once (PATH_DB . config("system.workspace") . PATH_SEP . "classes" . PATH_SEP . $tableName . ".php");
}
}
$totalCount = AppCacheViewPeer::doCount($CriteriaCount, $distinct);

View File

@@ -1068,7 +1068,7 @@ class Cases
$oDerivation->verifyIsCaseChild($sAppUid);
}
} catch (Exception $e) {
Bootstrap::registerMonolog('DeleteCases', 200, 'Error in sub-process when trying to route a child case related to the case', ['application_uid' => $sAppUid, 'error' => $e->getMessage()], SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('DeleteCases', 200, 'Error in sub-process when trying to route a child case related to the case', ['application_uid' => $sAppUid, 'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
}
//Delete the registries in the table SUB_APPLICATION
@@ -2211,7 +2211,7 @@ class Cases
"delIndex" => $iDelIndex,
"appInitDate" => $Fields['APP_INIT_DATE']
];
Bootstrap::registerMonolog('CreateCase', 200, "Create case", $data, SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('CreateCase', 200, "Create case", $data, config("system.workspace"), 'processmaker.log');
//call plugin
if (class_exists('folderData')) {
@@ -3375,7 +3375,7 @@ class Cases
$oPMScript->setFields($aFields);
/*----------------------------------********---------------------------------*/
$cs = new CodeScanner(SYS_SYS);
$cs = new CodeScanner(config("system.workspace"));
$strFoundDisabledCode = "";
/*----------------------------------********---------------------------------*/

View File

@@ -146,7 +146,7 @@ class ConsolidatedCases
}
$sClassName = $TableName;
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
@unlink($sPath . $sClassName . '.php');
@unlink($sPath . $sClassName . 'Peer.php');

View File

@@ -856,7 +856,7 @@ class Derivation
*/
function derivate(array $currentDelegation, array $nextDelegations, $removeList = true)
{
$this->sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";
$this->sysSys = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined";
$this->context = Bootstrap::getDefaultContextLog();
$aContext = $this->context;
$this->removeList = $removeList;

View File

@@ -101,11 +101,11 @@ class EnterpriseClass extends PMPlugin
{
$oServerConf = &ServerConf::getSingleton();
$infoLicense =$oServerConf->getProperty('LICENSE_INFO');
if (isset($infoLicense[SYS_SYS]['LIMIT_USERS'])) {
if (isset($infoLicense[config("system.workspace")]['LIMIT_USERS'])) {
$criteria = new Criteria('workflow');
$criteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$count = UsersPeer::doCount($criteria);
if ($count >= $infoLicense[SYS_SYS]['LIMIT_USERS'] ) {
if ($count >= $infoLicense[config("system.workspace")]['LIMIT_USERS'] ) {
throw new Exception("You can\'t add more users to the System, this reach the limit of allowed users by license that it has installed now");
}
}

View File

@@ -650,7 +650,7 @@ class IndicatorsCalculator
}
private function pdoConnection() {
$currentWS = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
$currentWS = !empty(config("system.workspace")) ? config("system.workspace") : 'Wokspace Undefined';
$workSpace = new WorkspaceTools($currentWS);
$arrayHost = explode(':', $workSpace->dbHost);
$host = "host=".$arrayHost[0];

View File

@@ -470,7 +470,7 @@ class LdapAdvanced
}
//log format: date hour ipaddress workspace ldapErrorNr
fwrite($fpt, sprintf("%s %s %s %s %s \n", date("Y-m-d H:i:s"), getenv("REMOTE_ADDR"), SYS_SYS, $ldapErrorNr, $text));
fwrite($fpt, sprintf("%s %s %s %s %s \n", date("Y-m-d H:i:s"), getenv("REMOTE_ADDR"), config("system.workspace"), $ldapErrorNr, $text));
fclose($fpt);
} else {
error_log("file $logFile is not writable ");

View File

@@ -337,7 +337,7 @@ class PMLicensedFeatures
/*----------------------------------********---------------------------------*/
public function verifyfeature ($featureName)
{
$cached = Cache::get(PmLicenseManager::CACHE_KEY . '.' . SYS_SYS, []);
$cached = Cache::get(PmLicenseManager::CACHE_KEY . '.' . config("system.workspace"), []);
if (isset($cached[$featureName])) {
return $cached[$featureName];
}
@@ -360,7 +360,7 @@ class PMLicensedFeatures
$this->featuresDetails[$value[0]]->enabled = $enable;
$cached[$featureName] = $enable;
Cache::put(PmLicenseManager::CACHE_KEY . '.' . SYS_SYS, $cached, Carbon::now()->addDay(1));
Cache::put(PmLicenseManager::CACHE_KEY . '.' . config("system.workspace"), $cached, Carbon::now()->addDay(1));
return $enable;
}

View File

@@ -1103,7 +1103,7 @@ class PMPluginRegistry
try {
$iPlugins = 0;
$oServerConf = & ServerConf::getSingleton();
$oServerConf->addPlugin( SYS_SYS, $this->_aPluginDetails );
$oServerConf->addPlugin( config("system.workspace"), $this->_aPluginDetails );
foreach ($this->_aPluginDetails as $namespace => $detail) {
if (isset( $detail->enabled ) && $detail->enabled) {
if (! empty( $detail->sFilename ) && file_exists( $detail->sFilename )) {

View File

@@ -31,7 +31,7 @@ class PmDrive extends PmGoogleApi
$this->folderIdPMDrive = empty($dataUser['USR_PMDRIVE_FOLDER_UID']) ? '' : $dataUser['USR_PMDRIVE_FOLDER_UID'];
$conf = $this->getConfigGmail();
$this->folderNamePMDrive = empty($conf->aConfig['folderNamePMDrive']) ? 'PMDrive (' . SYS_SYS . ')' : $conf->aConfig['folderNamePMDrive'];
$this->folderNamePMDrive = empty($conf->aConfig['folderNamePMDrive']) ? 'PMDrive (' . config("system.workspace") . ')' : $conf->aConfig['folderNamePMDrive'];
if ($this->folderIdPMDrive == '') {
$folderid = $this->createFolder($this->folderNamePMDrive);

View File

@@ -35,7 +35,7 @@ class PmDynaform
public function __construct($fields = array())
{
$this->sysSys = (defined("SYS_SYS")) ? SYS_SYS : "Undefined";
$this->sysSys = (!empty(config("system.workspace"))) ? config("system.workspace") : "Undefined";
$this->context = \Bootstrap::getDefaultContextLog();
$this->dataSources = array("database", "dataVariable");
$this->pathRTLCss = '/lib/pmdynaform/build/css/PMDynaform-rtl.css';
@@ -1007,7 +1007,7 @@ class PmDynaform
var app_uid = \"" . $this->fields["APP_UID"] . "\";
var prj_uid = \"" . $this->fields["PRO_UID"] . "\";
var step_mode = \"\";
var workspace = \"" . SYS_SYS . "\";
var workspace = \"" . config("system.workspace") . "\";
var credentials = " . G::json_encode($this->credentials) . ";
var filePost = \"\";
var fieldsRequired = null;
@@ -1068,7 +1068,7 @@ class PmDynaform
"var app_uid = '" . $this->fields["APP_UID"] . "';\n" .
"var prj_uid = '" . $this->fields["PRO_UID"] . "';\n" .
"var step_mode = null;\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var filePost = null;\n" .
"var fieldsRequired = null;\n" .
@@ -1147,7 +1147,7 @@ class PmDynaform
"var app_uid = '" . $this->fields["APP_UID"] . "';\n" .
"var prj_uid = '" . $this->fields["PRO_UID"] . "';\n" .
"var step_mode = '" . $this->fields["STEP_MODE"] . "';\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var filePost = null;\n" .
"var fieldsRequired = null;\n" .
@@ -1204,7 +1204,7 @@ class PmDynaform
var app_uid = \"" . $this->fields["APP_UID"] . "\";
var prj_uid = \"" . $this->fields["PRO_UID"] . "\";
var step_mode = null;
var workspace = \"" . SYS_SYS . "\";
var workspace = \"" . config("system.workspace") . "\";
var credentials = " . G::json_encode($this->credentials) . ";
var filePost = \"cases_SaveDataSupervisor?UID=" . $this->fields["CURRENT_DYNAFORM"] . "\";
var fieldsRequired = null;
@@ -1248,7 +1248,7 @@ class PmDynaform
"var app_uid = null;\n" .
"var prj_uid = '" . $this->record["PRO_UID"] . "';\n" .
"var step_mode = null;\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var filePost = '" . $filename . "';\n" .
"var fieldsRequired = " . G::json_encode(array()) . ";\n" .
@@ -1290,7 +1290,7 @@ class PmDynaform
"var app_uid = '" . G::decrypt($record['APP_UID'], URL_KEY) . "';\n" .
"var prj_uid = '" . $this->record["PRO_UID"] . "';\n" .
"var step_mode = null;\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var filePost = '" . $filename . "';\n" .
"var fieldsRequired = " . G::json_encode(array()) . ";\n" .
@@ -1354,7 +1354,7 @@ class PmDynaform
"var app_uid = null;\n" .
"var prj_uid = '" . $this->record["PRO_UID"] . "';\n" .
"var step_mode = null;\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var fieldsRequired = " . G::json_encode(array()) . ";\n" .
"var triggerDebug = null;\n" .
@@ -2100,7 +2100,7 @@ class PmDynaform
400,
'JSON encoded string error ' . $jsonLastError . ': ' . $jsonLastErrorMsg,
['token' => $token, 'projectUid' => $this->record['PRO_UID'], 'dynaFormUid' => $this->record['DYN_UID']],
SYS_SYS,
config("system.workspace"),
'processmaker.log'
);
}

View File

@@ -26,11 +26,11 @@ class PmLicenseManager
$activeLicenseSetting = $oServerConf->getProperty('ACTIVE_LICENSE');
if ((isset($activeLicenseSetting[SYS_SYS])) && (file_exists($activeLicenseSetting[SYS_SYS]))) {
$licenseFile = $activeLicenseSetting[SYS_SYS];
if ((isset($activeLicenseSetting[config("system.workspace")])) && (file_exists($activeLicenseSetting[config("system.workspace")]))) {
$licenseFile = $activeLicenseSetting[config("system.workspace")];
} else {
$activeLicense = $this->getActiveLicense();
$oServerConf->setProperty('ACTIVE_LICENSE', [SYS_SYS => $activeLicense['LICENSE_PATH']]);
$oServerConf->setProperty('ACTIVE_LICENSE', [config("system.workspace") => $activeLicense['LICENSE_PATH']]);
$licenseFile = $activeLicense['LICENSE_PATH'];
}
@@ -77,7 +77,7 @@ class PmLicenseManager
$this->supportEndDate = date("Y-m-d H:i:s", strtotime($this->supportEndDate));
$conf = new Configurations();
if (defined('SYS_SYS') && $conf->exists("ENVIRONMENT_SETTINGS")) {
if (!empty(config("system.workspace")) && $conf->exists("ENVIRONMENT_SETTINGS")) {
$this->supportStartDate = $conf->getSystemDate($this->supportStartDate);
$this->supportEndDate = $conf->getSystemDate($this->supportEndDate);
} else {
@@ -103,14 +103,14 @@ class PmLicenseManager
$licInfoA = $oServerConf->getProperty('LICENSE_INFO');
// The HUMAN attribute varies according to the timezone configured in the server, therefore it does not need
// to be considered in the comparison if the value was changed or not, it is only comparing with te "timestamp"
if (isset($licInfoA[SYS_SYS]['date']['HUMAN'])) {
unset($licInfoA[SYS_SYS]['date']['HUMAN']);
if (isset($licInfoA[config("system.workspace")]['date']['HUMAN'])) {
unset($licInfoA[config("system.workspace")]['date']['HUMAN']);
}
} else {
$licInfoA = [];
}
if (empty($licInfoA[SYS_SYS]) || ($licInfoA[SYS_SYS] != $resultsRegister)) {
$licInfoA[SYS_SYS] = $resultsRegister;
if (empty($licInfoA[config("system.workspace")]) || ($licInfoA[config("system.workspace")] != $resultsRegister)) {
$licInfoA[config("system.workspace")] = $resultsRegister;
$oServerConf->setProperty('LICENSE_INFO', $licInfoA);
}
}
@@ -337,11 +337,11 @@ class PmLicenseManager
}
if (class_exists('pmTrialPlugin')) {
$linkText = $linkText . "<a href='/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/pmTrial/services/buyNow?n=true" . "'> <img align='absmiddle' src='/plugin/pmLicenseManager/btn_buy_now.gif' border='0' /></a>";
$linkText = $linkText . "<a href='/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/pmTrial/services/buyNow?n=true" . "'> <img align='absmiddle' src='/plugin/pmLicenseManager/btn_buy_now.gif' border='0' /></a>";
}
if (isset($_SESSION["__ENTERPRISE_SYSTEM_UPDATE__"]) && $_SESSION["__ENTERPRISE_SYSTEM_UPDATE__"] == 1) {
$aOnclick = "onclick=\"this.href='" . EnterpriseUtils::getUrlServerName() . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PMENTERPRISE';\"";
$aOnclick = "onclick=\"this.href='" . EnterpriseUtils::getUrlServerName() . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PMENTERPRISE';\"";
if (EnterpriseUtils::skinIsUx() == 1) {
$aOnclick = "onclick=\"Ext.ComponentMgr.get('mainTabPanel').setActiveTab('pm-option-setup'); Ext.ComponentMgr.get('pm-option-setup').setLocation(Ext.ComponentMgr.get('pm-option-setup').defaultSrc + 's=PMENTERPRISE', true); return (false);\"";
}
@@ -385,7 +385,7 @@ class PmLicenseManager
} else {
$oServerConf = &ServerConf::getSingleton();
$oServerConf->setProperty('ACTIVE_LICENSE', [SYS_SYS => $path]);
$oServerConf->setProperty('ACTIVE_LICENSE', [config("system.workspace") => $path]);
$this->saveDataLicense($results, $path, $redirect);
if ($redirect) {
G::Header('location: ../enterprise/addonsStore');
@@ -482,7 +482,7 @@ class PmLicenseManager
$tr->setLicenseType($LicenseType);
$res = $tr->save();
Cache::forget(PmLicenseManager::CACHE_KEY . '.' . SYS_SYS);
Cache::forget(PmLicenseManager::CACHE_KEY . '.' . config("system.workspace"));
} catch (Exception $e) {
G::pr($e);
}

View File

@@ -212,7 +212,7 @@ class PmTable
}
$this->schemaFilename = 'schema.xml';
$this->baseDir = PATH_DB . SYS_SYS . PATH_SEP;
$this->baseDir = PATH_DB . config("system.workspace") . PATH_SEP;
$this->targetDir = $this->baseDir . 'pmt-propel' . PATH_SEP . $this->dataSource . PATH_SEP;
$this->configDir = $this->targetDir . 'config' . PATH_SEP;
$this->dataDir = $this->targetDir . 'data' . PATH_SEP;

View File

@@ -2755,7 +2755,7 @@ class ProcessMap
$http = 'http://';
}
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$row = array();
$c = 0;
@@ -2767,8 +2767,8 @@ class ProcessMap
$TaskFields['TAS_ASSIGN_TYPE'] = '';
$row[] = array('W_TITLE' => '', 'W_DELETE' => '', 'TAS_ASSIGN_TYPE' => $TaskFields['TAS_ASSIGN_TYPE'] );
if (is_dir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
if (is_dir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
while ($archivo = readdir($dir)) {
//print $archivo." **** <hr>";
if ($archivo != '.') {
@@ -3115,7 +3115,7 @@ class ProcessMap
public function listNoProcessesUser($sProcessUID)
{
$memcache = & PMmemcached::getSingleton(SYS_SYS);
$memcache = & PMmemcached::getSingleton(config("system.workspace"));
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
@@ -4777,7 +4777,7 @@ class ProcessMap
$http = 'http://';
}
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$row = array();
$c = 0;
@@ -4790,8 +4790,8 @@ class ProcessMap
//$row [] = array ('W_TITLE' => '', 'W_DELETE' => '', 'TAS_ASSIGN_TYPE' => $TaskFields ['TAS_ASSIGN_TYPE'] );
if (is_dir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
if (is_dir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
$dynTitle = str_replace(' ', '_', str_replace('/', '_', $dynTitle));
$arlink = $link . $dynTitle . '.php';
//$arlink = "<a href='" . $alink . "' target='blank'><font color='#9999CC'>" . $alink . "</font></a>";
@@ -5812,7 +5812,7 @@ class ProcessMap
public function listExtNoProcessesUser($sProcessUID)
{
$memcache = & PMmemcached::getSingleton(SYS_SYS);
$memcache = & PMmemcached::getSingleton(config("system.workspace"));
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);

View File

@@ -4131,7 +4131,7 @@ class Processes
try {
$result = $scriptTask->create($processUid, $record);
} catch (Exception $e) {
Bootstrap::registerMonolog('DataError', 400, $e->getMessage(), $record, SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('DataError', 400, $e->getMessage(), $record, config("system.workspace"), 'processmaker.log');
}
}
} catch (Exception $e) {
@@ -4499,7 +4499,7 @@ class Processes
$proTitle = (substr(G::inflect($data->process['PRO_TITLE']), 0, 245));
$proTitle = preg_replace("/[^A-Za-z0-9_]/", "", $proTitle);
//Calculating the maximum length of file name
$pathLength = strlen(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP);
$pathLength = strlen(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP);
$length = strlen($proTitle) + $pathLength;
$limit = 200;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
@@ -4578,7 +4578,7 @@ class Processes
// for mailtemplates files
$MAILS_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'mailTemplates' . PATH_SEP . $data->process['PRO_UID'];
$MAILS_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'mailTemplates' . PATH_SEP . $data->process['PRO_UID'];
$isMailTempSent = false;
$isPublicSent = false;
@@ -4615,7 +4615,7 @@ class Processes
}
// for public files
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP . $data->process['PRO_UID'];
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP . $data->process['PRO_UID'];
//Get WebEntry file names
$arrayWebEntryFile = array();
@@ -4671,7 +4671,7 @@ class Processes
/*
// for public files
$PUBLIC_ROOT_PATH = PATH_DATA.'sites'.PATH_SEP.SYS_SYS.PATH_SEP.'public'.PATH_SEP.$data->process['PRO_UID'];
$PUBLIC_ROOT_PATH = PATH_DATA.'sites'.PATH_SEP.config("system.workspace").PATH_SEP.'public'.PATH_SEP.$data->process['PRO_UID'];
//if this process have any mailfile
if ( is_dir( $PUBLIC_ROOT_PATH ) ) {
//get mail files list from this directory
@@ -5067,7 +5067,7 @@ class Processes
$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";
$message = 'The imported template has a number of byes different than the original template, please verify if the file \'' . $newFileName . '\' is correct.';
$level = 400;
Bootstrap::registerMonolog($channel, $level, $message, $context, $sysSys, 'processmaker.log');
@@ -6079,7 +6079,7 @@ class Processes
}
//Set variables
$cs = new CodeScanner((!is_null($workspaceName))? $workspaceName : SYS_SYS);
$cs = new CodeScanner((!is_null($workspaceName))? $workspaceName : config("system.workspace"));
$delimiter = DBAdapter::getStringDelimiter();

View File

@@ -605,7 +605,7 @@ class ReportTables
try {
$rs = $stmt->executeQuery($sQuery);
} catch (Exception $e) {
Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', ['sql' => $sQuery,'error' => $e->getMessage()], SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', ['sql' => $sQuery,'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
}
}
@@ -644,7 +644,7 @@ class ReportTables
try {
$rs = $stmt->executeQuery($sQuery);
} catch (Exception $e) {
Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', ['sql' => $sQuery,'error' => $e->getMessage()], SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', ['sql' => $sQuery,'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
}
}
} else {

View File

@@ -152,12 +152,12 @@ class ServerConf
public function sucessfulLogin()
{
$this->logins++;
if (isset($this->workspaces[SYS_SYS]) && isset($this->workspaces[SYS_SYS]['WSP_LOGINS'])) {
$this->workspaces[SYS_SYS]['WSP_LOGINS']++;
if (isset($this->workspaces[config("system.workspace")]) && isset($this->workspaces[config("system.workspace")]['WSP_LOGINS'])) {
$this->workspaces[config("system.workspace")]['WSP_LOGINS']++;
}
if (isset($this->workspaces[SYS_SYS]) && !isset($this->workspaces[SYS_SYS]['WSP_LOGINS'])) {
$this->workspaces[SYS_SYS]['WSP_LOGINS'] = 1;
if (isset($this->workspaces[config("system.workspace")]) && !isset($this->workspaces[config("system.workspace")]['WSP_LOGINS'])) {
$this->workspaces[config("system.workspace")]['WSP_LOGINS'] = 1;
}
$this->saveSingleton();

View File

@@ -100,7 +100,7 @@ class Upgrade
try {
$num += 1;
printf("Upgrading workspaces ($num/$count): {$workspace->name}\n");
$workspace->upgrade(false, SYS_SYS, false, 'en', ['updateXml' => $first, 'updateMafe' => $first]);
$workspace->upgrade(false, config("system.workspace"), false, 'en', ['updateXml' => $first, 'updateMafe' => $first]);
$workspace->close();
$first = false;
} catch (Exception $e) {

View File

@@ -219,8 +219,11 @@ class WorkspaceTools
*
* @return void
*/
public function upgrade($buildCacheView = false, $workSpace = SYS_SYS, $onedb = false, $lang = 'en', array $arrayOptTranslation = null)
public function upgrade($buildCacheView = false, $workSpace = null, $onedb = false, $lang = 'en', array $arrayOptTranslation = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
if (is_null($arrayOptTranslation)) {
$arrayOptTranslation = ['updateXml' => true, 'updateMafe' => true];
}
@@ -340,8 +343,11 @@ class WorkspaceTools
* Updating cases directories structure
*
*/
public function updateStructureDirectories($workSpace = SYS_SYS)
public function updateStructureDirectories($workSpace = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
$start = microtime(true);
CLI::logging("> Updating cases directories structure...\n");
$this->upgradeCasesDirectoryStructure($workSpace);
@@ -593,8 +599,11 @@ class WorkspaceTools
* @param boolean $executeRegenerateContent
* @return void
*/
public function upgradeContent($workspace = SYS_SYS, $executeRegenerateContent = false)
public function upgradeContent($workspace = null, $executeRegenerateContent = false)
{
if ($workspace === null) {
$workspace = config("system.workspace");
}
$this->initPropel(true);
//If the execute flag is false we will check if we needed
if (!$executeRegenerateContent) {
@@ -615,9 +624,8 @@ class WorkspaceTools
}
}
//If the flag is not created we will check the last Content migration
//The $lastContentMigrateTable return true if content is migrated
if (!$executeRegenerateContent && !$this->getLastContentMigrateTable()) {
//The $lastContentMigrateTable return false if we need to force regenerate content
if (!$this->getLastContentMigrateTable()) {
$executeRegenerateContent = true;
}
}
@@ -1896,12 +1904,13 @@ class WorkspaceTools
$aParameters = array('dbHost' => $dbHost, 'dbUser' => $dbUser, 'dbPass' => $dbPass);
//Restore
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspaceName);
config(["system.workspace" => $workspaceName]);
}
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);
}
$pmVersionWorkspaceToRestore = (preg_match("/^([\d\.]+).*$/", $metadata->PM_VERSION, $arrayMatch)) ? $arrayMatch[1] : "";
@@ -1957,13 +1966,13 @@ class WorkspaceTools
$start = microtime(true);
CLI::logging("> Verify License Enterprise...\n");
$workspace->verifyLicenseEnterprise($workspaceName);
//$workspace->verifyLicenseEnterprise($workspaceName);
$stop = microtime(true);
CLI::logging("<*> Verify took " . ($stop - $start) . " seconds.\n");
$start = microtime(true);
CLI::logging("> Check Mafe Requirements...\n");
$workspace->checkMafeRequirements($workspaceName, $lang);
//$workspace->checkMafeRequirements($workspaceName, $lang);
$stop = microtime(true);
CLI::logging("<*> Check Mafe Requirements Process took " . ($stop - $start) . " seconds.\n");
@@ -4018,8 +4027,11 @@ class WorkspaceTools
* Updating framework directory structure
*
*/
private function updateFrameworkPaths($workSpace = SYS_SYS)
private function updateFrameworkPaths($workSpace = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
$paths = [
PATH_DATA.'framework' => 0770,
PATH_DATA.'framework' . DIRECTORY_SEPARATOR . 'cache' => 0770,

View File

@@ -239,7 +239,7 @@ function literalDate ($date, $lang = 'en')
*/
function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter = array())
{
$sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";
$sysSys = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined";
$aContext = \Bootstrap::getDefaultContextLog();
$con = Propel::getConnection( $DBConnectionUID );
$con->begin();
@@ -537,7 +537,7 @@ function WSOpen ($force = false)
);
if (! isset( $_SESSION["WS_END_POINT"] )) {
$defaultEndpoint = $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . "/sys" . SYS_SYS . "/en/classic/services/wsdl2";
$defaultEndpoint = $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . "/sys" . config("system.workspace") . "/en/classic/services/wsdl2";
}
$endpoint = isset( $_SESSION["WS_END_POINT"] ) ? $_SESSION["WS_END_POINT"] : $defaultEndpoint;
@@ -3455,7 +3455,7 @@ function PMFCaseLink($caseUid, $workspace = null, $language = null, $skin = null
if ($arrayApplicationData === false) {
return false;
}
$workspace = (!empty($workspace)) ? $workspace : SYS_SYS;
$workspace = (!empty($workspace)) ? $workspace : config("system.workspace");
$language = (!empty($language)) ? $language : SYS_LANG;
$skin = (!empty($skin)) ? $skin : SYS_SKIN;

View File

@@ -45,16 +45,16 @@ use ProcessMaker\Plugins\PluginRegistry;
*/
function __autoload ($sClassName)
{
if (defined( 'SYS_SYS' )) {
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
if (!empty(config("system.workspace"))) {
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (file_exists( $sPath . $sClassName . '.php' )) {
require_once $sPath . $sClassName . '.php';
}
}
}
if (defined('SYS_SYS') && (!defined('PATH_DATA_SITE') || !defined('PATH_WORKSPACE'))) {
Bootstrap::setConstantsRelatedWs(SYS_SYS);
if (!empty(config("system.workspace")) && (!defined('PATH_DATA_SITE') || !defined('PATH_WORKSPACE'))) {
Bootstrap::setConstantsRelatedWs(config("system.workspace"));
}
//Add External Triggers

View File

@@ -39,7 +39,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
public function ServeRequest($base = false)
{
//$this->base = '/';
$this->uriBase = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/webdav/';
$this->uriBase = '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/webdav/';
// let the base class do all the work
parent::ServeRequest();
@@ -72,7 +72,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
// prepare property array
$files["files"] = array();
$pathClasses = PATH_DB . PATH_SEP . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$pathClasses = PATH_DB . PATH_SEP . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (count($paths) == 0 && is_dir($pathClasses)) {
$props = array();
$props[] = $this->mkprop("displayname", 'Classes');
@@ -110,7 +110,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
} //path classes
$pathProcesses = PATH_DB . SYS_SYS . PATH_SEP;
$pathProcesses = PATH_DB . config("system.workspace") . PATH_SEP;
if (count($paths) == 0 && is_dir($pathProcesses)) {
$props = array();
$props[] = $this->mkprop("displayname", 'Processes');
@@ -404,7 +404,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
$options = $filter->xssFilterHard($options);
$paths = $filter->xssFilterHard($this->paths);
$pathClasses = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$pathClasses = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (count($paths) > 0 && $paths[0] == 'classes' && is_dir($pathClasses)) {
$fsFile = $pathClasses . $paths[1];
$fsFile = $filter->xssFilterHard($fsFile);
@@ -419,7 +419,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
}
}
$pathProcesses = PATH_DB . SYS_SYS . PATH_SEP;
$pathProcesses = PATH_DB . config("system.workspace") . PATH_SEP;
if (count($paths) > 0 && $paths[0] == 'processes' && is_dir($pathProcesses)) {
if (count($paths) == 4 && $paths[2] == 'xmlforms') {
$pathXmlform = $pathProcesses . 'xmlForms' . PATH_SEP . $paths[1] . PATH_SEP;
@@ -636,7 +636,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
}
}
$pathProcesses = PATH_DB . SYS_SYS . PATH_SEP;
$pathProcesses = PATH_DB . config("system.workspace") . PATH_SEP;
if (count($paths) > 0 && $paths[0] == 'processes' && is_dir($pathProcesses)) {
if ($paths[2] == 'xmlforms') {
$pathTemplates = $pathProcesses . 'xmlForms' . PATH_SEP . $paths[1] . PATH_SEP;

View File

@@ -332,7 +332,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -383,7 +383,7 @@ class AdditionalTables extends BaseAdditionalTables
$_SESSION["PROCESS"] = $aData['PRO_UID'];
}
$aData['DBS_UID'] = $aData['DBS_UID'] ? $aData['DBS_UID'] : 'workflow';
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -531,7 +531,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -550,7 +550,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -604,7 +604,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -632,7 +632,7 @@ class AdditionalTables extends BaseAdditionalTables
try {
//$sPMUID = $aFields['PM_UNIQUE_ID'];
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -679,7 +679,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -1159,7 +1159,7 @@ class AdditionalTables extends BaseAdditionalTables
$sClassName = $this->getPHPName($sTableName);
}
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (!file_exists($sPath)) {
G::mk_dir($sPath);
}

View File

@@ -367,7 +367,7 @@ class AddonsStore extends BaseAddonsStore
$sStatus = $oDetails->isEnabled() ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_DISABLED');
if ($oDetails->getWorkspaces()) {
if (!in_array(SYS_SYS, $oDetails->getWorkspaces())) {
if (!in_array(config("system.workspace"), $oDetails->getWorkspaces())) {
continue;
}
}

View File

@@ -332,7 +332,7 @@ class CaseScheduler extends BaseCaseScheduler
}
}
$url = SERVER_NAME . $port . "/sys" . SYS_SYS . "/" . SYS_LANG . "/classic/services/wsdl2";
$url = SERVER_NAME . $port . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/classic/services/wsdl2";
$testConnection = true;
try {

View File

@@ -312,8 +312,11 @@ class Content extends BaseContent
*
* @param array $langs
*/
public function regenerateContent ($langs, $workSpace = SYS_SYS)
public function regenerateContent ($langs, $workSpace = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
//Search the language
$key = array_search( 'en', $langs );
if ($key === false) {

View File

@@ -739,7 +739,7 @@ class Process extends BaseProcess
}
$memcache = & PMmemcached::getSingleton( SYS_SYS );
$memcache = & PMmemcached::getSingleton( config("system.workspace") );
if (isset($memcache) && $memcache->enabled == 1 ) {
return $aProcesses;
}
@@ -766,7 +766,7 @@ class Process extends BaseProcess
GROUP BY PRO_UID, APP_STATUS*/
require_once 'classes/model/Application.php';
$memcache = & PMmemcached::getSingleton( SYS_SYS );
$memcache = & PMmemcached::getSingleton( config("system.workspace") );
$memkey = 'getCasesCountInAllProcesses';
if (($aProcesses = $memcache->get( $memkey )) === false) {
$oCriteria = new Criteria( 'workflow' );
@@ -877,7 +877,7 @@ class Process extends BaseProcess
$limit = 25;
$start = 0;
$memcache = PMmemcached::getSingleton( SYS_SYS );
$memcache = PMmemcached::getSingleton( config("system.workspace") );
for ($start = 0; $start <= 50 - 1; $start ++) {
$memkey = "processList-allProcesses-" . ($start * $limit) . "-" . $limit;

View File

@@ -258,10 +258,10 @@ class UsersProperties extends BaseUsersProperties
$url = $this->_getDefaultLocation();
return $url;
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/main';
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/main';
}
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/main';
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/main';
}
global $RBAC;
$oConf = new Configurations();
@@ -330,9 +330,9 @@ class UsersProperties extends BaseUsersProperties
$pathMethod = $detail->getPathMethod();
if (isset($pathMethod) && $detail->equalRoleCodeTo($userRole)) {
if (isset($_COOKIE['workspaceSkin'])) {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $pathMethod;
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $pathMethod;
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/' . $pathMethod;
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/' . $pathMethod;
}
}
}
@@ -376,7 +376,7 @@ class UsersProperties extends BaseUsersProperties
case 'SINGLE':
$_SESSION['user_experience'] = $uxType;
$_SESSION['user_last_skin'] = SYS_SKIN;
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/uxs/' . 'home';
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/uxs/' . 'home';
break;
}
@@ -393,11 +393,10 @@ class UsersProperties extends BaseUsersProperties
$oConf = new Configurations();
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
//$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
if (isset($_COOKIE['workspaceSkin'])) {
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
$baseUrl = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
} else {
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
$baseUrl = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/';
}
$url = '';

View File

@@ -23,12 +23,12 @@
*
*/
if (defined('PATH_DB') && defined('SYS_SYS')) {
if (defined('PATH_DB') && !empty(config("system.workspace"))) {
if (!file_exists(PATH_DB . SYS_SYS . '/db.php'))
throw new Exception("Could not find db.php in current workspace " . SYS_SYS);
if (!file_exists(PATH_DB . config("system.workspace") . '/db.php'))
throw new Exception("Could not find db.php in current workspace " . config("system.workspace"));
require_once(PATH_DB . SYS_SYS . '/db.php');
require_once(PATH_DB . config("system.workspace") . '/db.php');
//to do: enable for other databases
$dbType = DB_ADAPTER;
$dsn = DB_ADAPTER . '://' . DB_USER . ':' . urlencode(DB_PASS) . '@' . DB_HOST . '/' . DB_NAME;

View File

@@ -314,7 +314,7 @@ class Admin extends Controller
);
}
$properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,defined( "SYS_SYS" ) ? SYS_SYS : "Not defined",$pmSection
$properties[] = array(G::LoadTranslation('ID_WORKSPACE'), !empty(config("system.workspace")) ? config("system.workspace") : "Not defined", $pmSection
);
$properties[] = array ( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv( 'SERVER_PROTOCOL' ),$sysSection

View File

@@ -117,7 +117,7 @@ class adminProxy extends HttpProxyController
$this->success = true;
$this->restart = $restart;
$this->url = "/sys" . SYS_SYS . "/" . (($sysConf["default_lang"] != "")? $sysConf["default_lang"] : ((defined("SYS_LANG") && SYS_LANG != "")? SYS_LANG : "en")) . "/" . $sysConf["default_skin"] . $urlPart;
$this->url = "/sys" . config("system.workspace") . "/" . (($sysConf["default_lang"] != "")? $sysConf["default_lang"] : ((defined("SYS_LANG") && SYS_LANG != "")? SYS_LANG : "en")) . "/" . $sysConf["default_skin"] . $urlPart;
$this->message = 'Saved Successfully';
$msg = "";
if ($httpData->proxy_host != '' || $httpData->proxy_port != '' || $httpData->proxy_user != '') {
@@ -1191,7 +1191,7 @@ class adminProxy extends HttpProxyController
$snameLogo = self::changeNamelogo($snameLogo);
$oConf = new Configurations;
$aConf = Array(
'WORKSPACE_LOGO_NAME' => SYS_SYS,
'WORKSPACE_LOGO_NAME' => config("system.workspace"),
'DEFAULT_LOGO_NAME' => $snameLogo
);
@@ -1356,7 +1356,7 @@ class adminProxy extends HttpProxyController
'%s://%s/sys%s/%s/%s/oauth2/grant',
$http,
$host,
SYS_SYS,
config("system.workspace"),
$lang,
SYS_SKIN
);
@@ -1416,7 +1416,7 @@ class adminProxy extends HttpProxyController
//On premise or cloud
$licInfo = $oServerConf->getProperty( 'LICENSE_INFO' );
$params['lt'] = isset($licInfo[SYS_SYS]) ? isset($licInfo[SYS_SYS]['TYPE'])? $licInfo[SYS_SYS]['TYPE'] : '' : '';
$params['lt'] = isset($licInfo[config("system.workspace")]) ? isset($licInfo[config("system.workspace")]['TYPE'])? $licInfo[config("system.workspace")]['TYPE'] : '' : '';
//ProcessMaker Version
$params['v'] = System::getVersion();
@@ -1511,7 +1511,7 @@ class adminProxy extends HttpProxyController
$params['t'] = (defined('TIME_ZONE') && TIME_ZONE != "Unknown") ? TIME_ZONE : date_default_timezone_get();
$params['w'] = count(System::listWorkspaces());
$support = PATH_DATA_SITE . G::sanitizeString($licenseManager->info['FIRST_NAME'] . '-' . $licenseManager->info['LAST_NAME'] . '-' . SYS_SYS . '-' . date('YmdHis'), false, false) . '.spm';
$support = PATH_DATA_SITE . G::sanitizeString($licenseManager->info['FIRST_NAME'] . '-' . $licenseManager->info['LAST_NAME'] . '-' . config("system.workspace") . '-' . date('YmdHis'), false, false) . '.spm';
file_put_contents($support, serialize($params));
G::streamFile($support, true);
G::rm_dir($support);

View File

@@ -97,7 +97,7 @@ class caseSchedulerProxy extends HttpProxyController
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$user = $sWS_USER;

View File

@@ -62,7 +62,7 @@ class Designer extends Controller
$this->setVar('credentials', base64_encode(json_encode($clientToken)));
$this->setVar('isDebugMode', $debug);
$this->setVar("distribution", $distribution);
$this->setVar("SYS_SYS", SYS_SYS);
$this->setVar("SYS_SYS", config("system.workspace"));
$this->setVar("SYS_LANG", SYS_LANG);
$this->setVar("SYS_SKIN", SYS_SKIN);
$this->setVar('HTTP_SERVER_HOSTNAME', System::getHttpServerHostnameRequestsFrontEnd());
@@ -219,7 +219,7 @@ class Designer extends Controller
}
Tracker::authentication($_SESSION['CASE'], $_SESSION['PIN']);
} catch (\Exception $e) {
Bootstrap::registerMonolog('CaseTracker', 400, $e->getMessage(), [], SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('CaseTracker', 400, $e->getMessage(), [], config("system.workspace"), 'processmaker.log');
\G::header('Location: /errors/error403.php');
die();
}

View File

@@ -131,7 +131,7 @@ class Home extends Controller
if (!isset($_COOKIE['workspaceSkin'])) {
if (substr( $sysConf['default_skin'], 0, 2 ) == 'ux') {
$_SESSION['_defaultUserLocation'] = $switchLink;
$switchLink = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
$switchLink = '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
}
}
@@ -531,7 +531,7 @@ class Home extends Controller
$conf = new Configurations();
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$cases['data'][$i]['DEL_DELEGATE_DATE'] = '';
if (defined('SYS_SYS')) {
if (!empty(config("system.workspace"))) {
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
$cases['data'][$i]['DEL_DELEGATE_DATE'] = $conf->getSystemDate($row['DEL_DELEGATE_DATE'], 'casesListDateFormat');
}

View File

@@ -919,6 +919,7 @@ class InstallerModule extends Controller
define( 'SYSTEM_HASH', $sh );
define( 'PATH_DB', $pathShared . 'sites' . PATH_SEP );
define( 'SYS_SYS', $workspace );
config(["system.workspace" => $workspace]);
require_once ("propel/Propel.php");

View File

@@ -17,7 +17,7 @@ class Main extends Controller
public function __construct ()
{
$this->memcache = & PMmemcached::getSingleton( defined( 'SYS_SYS' ) ? SYS_SYS : '' );
$this->memcache = & PMmemcached::getSingleton( !empty(config("system.workspace")) ? config("system.workspace") : '' );
define( 'ERROR_EXCEPTION', 1 );
define( 'INFO_EXCEPTION', 3 );
@@ -40,7 +40,7 @@ class Main extends Controller
$this->setVar( 'pipe', isset( $_SESSION['USR_USERNAME'] ) ? ' | ' : '' );
$this->setVar( 'rolename', $this->getUserRole() );
$this->setVar( 'logout', G::LoadTranslation( 'ID_LOGOUT' ) );
$this->setVar( 'workspace', defined( 'SYS_SYS' ) ? ucfirst( SYS_SYS ) : '' );
$this->setVar( 'workspace', !empty(config("system.workspace")) ? ucfirst( config("system.workspace") ) : '' );
$this->setVar( 'user_avatar', 'users/users_ViewPhotoGrid?pUID=' . $_SESSION['USER_LOGGED'] . '&h=' . rand() );
// license notification
@@ -464,7 +464,7 @@ class Main extends Controller
{
$sCompanyLogo = '/images/processmaker2.logo2.png';
if (defined( "SYS_SYS" )) {
if (!empty(config("system.workspace"))) {
if (($aFotoSelect = $this->memcache->get( 'aFotoSelect' )) === false) {
$oLogoR = new ReplacementLogo();
$aFotoSelect = $oLogoR->getNameLogo( (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : '' );
@@ -480,9 +480,9 @@ class Main extends Controller
$logoPlugin = $oPluginRegistry->getCompanyLogo( $sCompanyLogo );
if ($logoPlugin != '/images/processmaker2.logo2.png') {
$sCompanyLogo = $logoPlugin;
} elseif (isset( $sFotoSelect ) && $sFotoSelect != '' && ! (strcmp( $sWspaceSelect, SYS_SYS ))) {
} elseif (isset( $sFotoSelect ) && $sFotoSelect != '' && ! (strcmp( $sWspaceSelect, config("system.workspace") ))) {
$sCompanyLogo = $oPluginRegistry->getCompanyLogo( $sFotoSelect );
$sCompanyLogo = "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/adminProxy/showLogoFile?id=" . base64_encode( $sCompanyLogo );
$sCompanyLogo = "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/adminProxy/showLogoFile?id=" . base64_encode( $sCompanyLogo );
}
}
return $sCompanyLogo;
@@ -778,7 +778,7 @@ class Main extends Controller
);
}
$properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,defined( "SYS_SYS" ) ? SYS_SYS : "Not defined",$pmSection
$properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,!empty(config("system.workspace")) ? config("system.workspace") : "Not defined",$pmSection
);
$properties[] = array ( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv( 'SERVER_PROTOCOL' ),$sysSection

View File

@@ -147,7 +147,7 @@ class pmTables extends Controller
public function streamExported ($httpData)
{
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP;
$sFileName = $httpData->f;
$realPath = $PUBLIC_ROOT_PATH . $sFileName;

View File

@@ -117,7 +117,7 @@ class pmTablesProxy extends HttpProxyController
$dbConn = new DbConnections();
$dbConnections = $dbConn->getConnectionsProUid( $proUid, array('mysql') );
$workSpace = new WorkspaceTools(SYS_SYS);
$workSpace = new WorkspaceTools(config("system.workspace"));
$workspaceDB = $workSpace->getDBInfo();
if ($workspaceDB['DB_NAME'] == $workspaceDB['DB_RBAC_NAME']) {
@@ -399,7 +399,7 @@ class pmTablesProxy extends HttpProxyController
$primaryKeys = $oAdditionalTables->getPrimaryKeys( 'keys' );
$this->className = $table['ADD_TAB_CLASS_NAME'];
$this->classPeerName = $this->className . 'Peer';
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (! file_exists( $sPath . $this->className . '.php' )) {
throw new Exception( 'Update:: ' . G::loadTranslation( 'ID_PMTABLE_CLASS_DOESNT_EXIST', $this->className ) );
@@ -440,7 +440,7 @@ class pmTablesProxy extends HttpProxyController
$table = $oAdditionalTables->load( $httpData->id, true );
$this->className = $table['ADD_TAB_CLASS_NAME'];
$this->classPeerName = $this->className . 'Peer';
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (! file_exists( $sPath . $this->className . '.php' )) {
throw new Exception( 'Destroy:: ' . G::loadTranslation( 'ID_PMTABLE_CLASS_DOESNT_EXIST', $this->className ) );
@@ -664,7 +664,7 @@ class pmTablesProxy extends HttpProxyController
$rows = $resultData['rows'];
$count = $resultData['count'];
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP;
$filenameOnly = strtolower($aAdditionalTables['ADD_TAB_NAME'] . "_" . date("Y-m-d") . '_' . date("Hi") . ".csv");
$filename = $PUBLIC_ROOT_PATH . $filenameOnly;
$fp = fopen($filename, "wb");
@@ -733,7 +733,7 @@ class pmTablesProxy extends HttpProxyController
$_SESSION['FILES_FORM'] = $_FILES['form'];
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP;
$filename = $_FILES['form']['name']['FILENAME'];
$tempName = $_FILES['form']['tmp_name']['FILENAME'];
@@ -923,7 +923,7 @@ class pmTablesProxy extends HttpProxyController
$result = new stdClass();
$net = new Net( G::getIpAddress() );
$META = " \n-----== ProcessMaker Open Source Private Tables ==-----\n" . " @Ver: 1.0 Oct-2009\n" . " @Processmaker version: " . System::getVersion() . "\n" . " -------------------------------------------------------\n" . " @Export Date: " . date( "l jS \of F Y h:i:s A" ) . "\n" . " @Server address: " . getenv( 'SERVER_NAME' ) . " (" . getenv( 'SERVER_ADDR' ) . ")\n" . " @Client address: " . $net->hostname . "\n" . " @Workspace: " . SYS_SYS . "\n" . " @Export trace back:\n\n";
$META = " \n-----== ProcessMaker Open Source Private Tables ==-----\n" . " @Ver: 1.0 Oct-2009\n" . " @Processmaker version: " . System::getVersion() . "\n" . " -------------------------------------------------------\n" . " @Export Date: " . date( "l jS \of F Y h:i:s A" ) . "\n" . " @Server address: " . getenv( 'SERVER_NAME' ) . " (" . getenv( 'SERVER_ADDR' ) . ")\n" . " @Client address: " . $net->hostname . "\n" . " @Workspace: " . config("system.workspace") . "\n" . " @Export trace back:\n\n";
$EXPORT_TRACEBACK = Array ();
$c = 0;
@@ -947,9 +947,9 @@ class pmTablesProxy extends HttpProxyController
$META .= $sTrace;
///////////////EXPORT PROCESS
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP;
$filenameOnly = strtolower( 'SYS-' . SYS_SYS . "_" . date( "Y-m-d" ) . '_' . date( "Hi" ) . ".pmt" );
$filenameOnly = strtolower( 'SYS-' . config("system.workspace") . "_" . date( "Y-m-d" ) . '_' . date( "Hi" ) . ".pmt" );
$filename = $PUBLIC_ROOT_PATH . $filenameOnly;
$fp = fopen( $filename, "wb" );

View File

@@ -33,7 +33,7 @@ class StrategicDashboard extends Controller
$user = new Users();
$user = $user->load($RBAC->aUserInfo['USER_INFO']['USR_UID']);
$this->usrUnitCost = $this->currencySymbolToShow($user);
$this->urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . SYS_SYS . '/';
$this->urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . config("system.workspace") . '/';
//change
$clientId = 'x-pm-local-client';
$client = $this->getClientCredentials($clientId);
@@ -194,7 +194,7 @@ class StrategicDashboard extends Controller
$this->setView( 'strategicDashboard/viewDashboard' );
$this->setVar('urlProxy', $this->urlProxy);
$this->setVar('SYS_SYS', SYS_SYS);
$this->setVar('SYS_SYS', config("system.workspace"));
$this->setVar('usrId', $this->usrId);
$this->setVar('credentials', $this->clientToken);
$this->setVar('unitCost', $this->usrUnitCost);

View File

@@ -21,8 +21,8 @@ class webEntryProxy extends HttpProxyController
$editEvent['EVN_CONDITIONS'] = null;
$event->update( $editEvent );
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename );
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace( ".php", "Post", $filename ) . ".php" );
unlink( PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename );
unlink( PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace( ".php", "Post", $filename ) . ".php" );
$this->success = true;
$this->msg = G::LoadTranslation( 'ID_WEB_ENTRY_SUCCESS_DELETE' );
@@ -46,7 +46,7 @@ class webEntryProxy extends HttpProxyController
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$user = $sWS_USER;
@@ -122,8 +122,8 @@ class webEntryProxy extends HttpProxyController
$pro_uid = $params->pro_uid;
$filename = $xDYNA;
$filename = $filename . '.php';
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename );
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace( ".php", "Post", $filename ) . ".php" );
unlink( PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename );
unlink( PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace( ".php", "Post", $filename ) . ".php" );
}
$pathProcess = PATH_DATA_SITE . 'public' . PATH_SEP . $sPRO_UID . PATH_SEP;
@@ -167,8 +167,8 @@ class webEntryProxy extends HttpProxyController
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
$template = new TemplatePower( $pluginTpl );
$template->prepare();
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'processUid', $sPRO_UID );
$template->assign( 'dynaformUid', $sDYNAFORM );
$template->assign( 'taskUid', $sTASKS );
@@ -184,7 +184,7 @@ class webEntryProxy extends HttpProxyController
$template->assign( 'dynaform', $dynTitle );
$template->assign( 'timestamp', date( 'l jS \of F Y h:i:s A' ) );
$template->assign( 'ws', SYS_SYS );
$template->assign( 'ws', config("system.workspace") );
$template->assign( 'version', System::getVersion() );
$fileName = $pathProcess . $dynTitle . 'Post.php';
@@ -218,7 +218,7 @@ class webEntryProxy extends HttpProxyController
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
$output = $oEvent->update( $aDataEvent );
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$this->success = true;
$this->msg = G::LoadTranslation( 'ID_WEB_ENTRY_SUCCESS_NEW' );

View File

@@ -263,7 +263,7 @@ if ($sStatus == '1') {
$oAdditionalTables->createPropelClasses($tableName, $sClassName, $aFieldsClases, $sTasUid);
} else {
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
@unlink($sPath . $sClassName . '.php');
@unlink($sPath . $sClassName . 'Peer.php');
@unlink($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName . 'MapBuilder.php');

View File

@@ -71,7 +71,7 @@ while ($rsSql->next()) {
}
if (count($arrayTabItem) > 0) {
$urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . SYS_SYS . '/consolidated/';
$urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . config("system.workspace") . '/consolidated/';
$clientId = 'x-pm-local-client';
$client = getClientCredentials($clientId);
$authCode = getAuthorizationCode($client);

View File

@@ -176,9 +176,9 @@ if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjB
if (isset($_COOKIE['dashboardListInbox'])) {
$oHeadPublisher->assign('valueFilterStatus', $_COOKIE['dashboardListInbox']);
if (PHP_VERSION < 5.2) {
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . SYS_SYS, "; HttpOnly");
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . config("system.workspace"), "; HttpOnly");
} else {
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . SYS_SYS, null, false, true);
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . config("system.workspace"), null, false, true);
}
}
}

View File

@@ -142,8 +142,8 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
if($res->status == 0){
$message = $res->message;
G::SendMessageText( $message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}
@@ -156,8 +156,8 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
if ($inpDocMaxFilesize > 0 && $fileSizeByField > 0) {
if ($fileSizeByField > $inpDocMaxFilesize) {
G::SendMessageText(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"), "ERROR");
$arrayAux1 = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
G::header("location: /sys" . SYS_SYS . $arrayAux1[1]);
$arrayAux1 = explode("sys" . config("system.workspace"), $_SERVER["HTTP_REFERER"]);
G::header("location: /sys" . config("system.workspace") . $arrayAux1[1]);
exit(0);
}
}

View File

@@ -54,8 +54,8 @@ if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME']
break;
}
G::SendMessageText( $message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}
@@ -106,8 +106,8 @@ if(isset($_FILES["form"]["name"]["APP_DOC_FILENAME"]) && isset($_FILES["form"]["
if($res->status == 0){
$message = $res->message;
G::SendMessageText( $message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}
@@ -134,8 +134,8 @@ if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
} catch (Exception $e) {
G::SendMessageText($e->getMessage(), "ERROR");
$arrayAux = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
G::header("location: /sys" . SYS_SYS . $arrayAux[1]);
$arrayAux = explode("sys" . config("system.workspace"), $_SERVER["HTTP_REFERER"]);
G::header("location: /sys" . config("system.workspace") . $arrayAux[1]);
exit(0);
}
}

View File

@@ -40,7 +40,7 @@ if (G::is_https()) {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$client = new SoapClient($endpoint, $streamContext);
$user = $sWS_USER;

View File

@@ -109,8 +109,8 @@ if (! $sw_file_exists) {
print G::json_encode( $res );
} else {
G::SendMessageText( $error_message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}

View File

@@ -122,8 +122,8 @@ if (!$sw_file_exists) {
print G::json_encode( $res );
} else {
G::SendMessageText( $error_message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}

View File

@@ -29,7 +29,7 @@ $oHeadPublisher->addExtJsScript( "cases/main", false ); //Adding a javascript fi
$oHeadPublisher->addContent( "cases/main" ); //Adding a html file .html.
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = &PMmemcached::getSingleton( SYS_SYS );
$memcache = &PMmemcached::getSingleton( config("system.workspace") );
if (($arrayConfig = $memcache->get( $keyMem )) === false) {
$conf->loadConfig( $x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "" );

View File

@@ -9,7 +9,7 @@ $oHeadPublisher = &headPublisher::getSingleton();
if (isset($licenseManager->date) && is_array($licenseManager->date)) {
$conf = new Configurations();
if ( defined('SYS_SYS') && $conf->exists("ENVIRONMENT_SETTINGS")) {
if (!empty(config("system.workspace")) && $conf->exists("ENVIRONMENT_SETTINGS")) {
$licenseManager->date['START'] = date("Y-m-d H:i:s", strtotime($licenseManager->date['HUMAN']['START']));
$licenseManager->date['END'] = date("Y-m-d H:i:s", strtotime($licenseManager->date['HUMAN']['END']));
$licenseManager->date['START'] = $conf->getSystemDate($licenseManager->date['START']);
@@ -63,7 +63,7 @@ $oHeadPublisher->assign("supportStartDate", (isset($licenseManager->supportStart
$oHeadPublisher->assign("supportEndDate", (isset($licenseManager->supportEndDate))? $licenseManager->supportEndDate : '');
$oHeadPublisher->assign("PROCESSMAKER_VERSION", System::getVersion());
$oHeadPublisher->assign("PROCESSMAKER_URL", "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN );
$oHeadPublisher->assign("PROCESSMAKER_URL", "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN );
$oHeadPublisher->assign("SYS_SKIN", SYS_SKIN);
$oHeadPublisher->assign("URL_PART_LOGIN", ((substr(SYS_SKIN, 0, 2) == "ux" && SYS_SKIN != "uxs")? "main/login" : "login/login"));
$oHeadPublisher->assign("URL_PART_SETUP", EnterpriseUtils::getUrlPartSetup());

View File

@@ -160,7 +160,7 @@ try {
}
///////
$workspace = SYS_SYS;
$workspace = config("system.workspace");
$dbAdapter = DB_ADAPTER;
$addon->setAddonState("download-start");

View File

@@ -8,7 +8,7 @@ if (!defined("PATH_PM_ENTERPRISE")) {
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . config("system.workspace") . "/");
}
set_include_path(PATH_PM_ENTERPRISE . PATH_SEPARATOR . get_include_path());
@@ -78,12 +78,10 @@ class enterprisePlugin extends PMPlugin
unset($_SESSION["__EE_SW_PMLICENSEMANAGER__"]);
///////
$js = "window.open(\"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PLUGINS\", \"_top\", \"\");";
$js = "window.open(\"/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PLUGINS\", \"_top\", \"\");";
if (substr(SYS_SKIN, 0, 2) == "ux" && SYS_SKIN != "uxs") {
//$js = "parent.window.location.href = \"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main_init?s=PLUGINS\";";
//$js = "window.location.href = \"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/pluginsImport\";";
$js = "window.open(\"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/main\", \"_top\", \"\");";
$js = "window.open(\"/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/main\", \"_top\", \"\");";
}
///////

View File

@@ -63,7 +63,7 @@ function install($file)
$context = stream_context_create($option);
///////
$fileData = @fopen(EnterpriseUtils::getUrlServerName() . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/enterprise/services/processMakerUpgrade", "rb", false, $context);
$fileData = @fopen(EnterpriseUtils::getUrlServerName() . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/enterprise/services/processMakerUpgrade", "rb", false, $context);
if ($fileData === false) {
throw (new Exception("Could not open services url."));

View File

@@ -146,7 +146,7 @@ try {
$errLabel = G::LoadTranslation('ID_ACCOUNT') . ' "' . $usr . '" ' . G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN');
}
//Log failed authentications
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . SYS_SYS;
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . config("system.workspace");
$message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT'];
G::log($message, PATH_DATA, 'loginFailed.log');
@@ -171,7 +171,7 @@ try {
}
if (!isset( $_SESSION['WORKSPACE'] ) ) {
$_SESSION['WORKSPACE'] = SYS_SYS;
$_SESSION['WORKSPACE'] = config("system.workspace");
}
//Execute the SSO Script from plugin
@@ -248,7 +248,7 @@ try {
$userTimeZone = $user->getUsrTimeZone();
if (trim($userTimeZone) == '') {
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
$userTimeZone = $arraySystemConfiguration['time_zone'];
}
@@ -409,7 +409,7 @@ try {
die;
}
$configS = System::getSystemConfiguration('', '', SYS_SYS);
$configS = System::getSystemConfiguration('', '', config("system.workspace"));
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block']:true;
if ($activeSession){
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');

View File

@@ -20,7 +20,7 @@ try {
}
header(
'Location: /sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN .
'Location: /sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN .
'/login/login' . (($u != '')? '?u=' . $u : '')
);
@@ -40,7 +40,7 @@ try {
}
/*----------------------------------********---------------------------------*/
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
//Set User Time Zone
$user = UsersPeer::retrieveByPK($userUid);

View File

@@ -188,9 +188,9 @@ session_start();
session_regenerate_id();
if (PHP_VERSION < 5.2) {
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . SYS_SYS, "; HttpOnly");
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), "; HttpOnly");
} else {
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . SYS_SYS, null, false, true);
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), null, false, true);
}
if (strlen($msg) > 0) {
@@ -361,7 +361,7 @@ $flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])
setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), time() + (24 * 60 * 60), SYS_URI);
$configS = System::getSystemConfiguration('', '', SYS_SYS);
$configS = System::getSystemConfiguration('', '', config("system.workspace"));
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block'] : true;
if ($activeSession) {
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');

View File

@@ -9,7 +9,7 @@ if (! empty($_GET['error'])) {
$http = G::is_https() ? 'https' : 'http';
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
$endpoint = sprintf('%s://%s/%s/oauth2/token', $http, $host, SYS_SYS);
$endpoint = sprintf('%s://%s/%s/oauth2/token', $http, $host, config("system.workspace"));
$code = empty($_GET['code']) ? 'NN' : $_GET['code'];
$clientId = 'x-pm-local-client';

View File

@@ -19,7 +19,7 @@ class AdditionalTablesConsolidated extends AdditionalTables
$sClassName = $this->getPHPName($sTableName);
}
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (!file_exists($sPath)) {
G::mk_dir($sPath);
G::mk_dir($sPath . 'map');
@@ -626,7 +626,7 @@ class ajax_con extends WebResource
$oAdditionalTables->createPropelClasses($tableName, $sClassName, $aFieldsClases, $sTasUid);
} else {
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
@unlink($sPath . $sClassName . '.php');
@unlink($sPath . $sClassName . 'Peer.php');
@unlink($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName . 'MapBuilder.php');

View File

@@ -92,7 +92,7 @@ $oHeadPublisher->assign("arrayContextMenuOptionPlugin", $arrayContextMenuOptionP
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
$designer = new Designer();
$oHeadPublisher->assign('SYS_SYS', SYS_SYS);
$oHeadPublisher->assign('SYS_SYS', config("system.workspace"));
$oHeadPublisher->assign('SYS_LANG', SYS_LANG);
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
$oHeadPublisher->assign('HTTP_SERVER_HOSTNAME', System::getHttpServerHostnameRequestsFrontEnd());

View File

@@ -33,8 +33,6 @@ $oProcess = new Process();
$oProcess->dir = $dir;
$oProcess->sort = $sort;
//$memcache = & PMmemcached::getSingleton( SYS_SYS );
$memkey = 'no memcache';
$memcacheUsed = 'not used';
$totalCount = 0;

View File

@@ -189,13 +189,13 @@ try {
$filter = new InputFilter();
$form = $_REQUEST;
$filePath = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'];
$filePath = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'];
if (file_exists($filePath)) {
unlink($filter->validateInput($filePath, 'path'));
$webEntry = new \ProcessMaker\BusinessModel\WebEntry();
$webEntry->deleteClassic($form['PRO_UID'], $filePath);
}
$filePath = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php";
$filePath = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php";
if (file_exists($filePath)) {
unlink($filter->validateInput($filePath, 'path'));
}
@@ -900,8 +900,8 @@ try {
$resultArray = array();
$proUid = isset($_REQUEST['PRO_UID']) ? $_REQUEST['PRO_UID'] : '';
$dynUid = isset($_REQUEST['DYN_UID']) ? $_REQUEST['DYN_UID'] : '';
if (is_file(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') && filesize(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') > 0) {
$dyn = new DynaformHandler(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
if (is_file(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') && filesize(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') > 0) {
$dyn = new DynaformHandler(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
$dynaformFields[] = $dyn->getFields();
}
foreach ($dynaformFields as $aDynFormFields) {

View File

@@ -6,7 +6,7 @@ if (!isset($_GET["file_hash"])) {
}
$httpStream = new \ProcessMaker\Util\IO\HttpStream();
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$outputDir = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$fileName = urldecode(base64_decode($_GET["file_hash"]));
$processFile = $outputDir . $fileName;

View File

@@ -24,7 +24,7 @@
use ProcessMaker\Util\Common;
$response = new StdClass();
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$outputDir = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
try {
if(empty($_GET)){

View File

@@ -70,7 +70,7 @@ if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm
if (!empty($arrayTrigger)) {
$cs = new CodeScanner(SYS_SYS);
$cs = new CodeScanner(config("system.workspace"));
$strFoundDisabledCode = "";

View File

@@ -68,8 +68,8 @@ try {
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
$template = new TemplatePower( $pluginTpl );
$template->prepare();
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'processUid', $sPRO_UID );
$template->assign( 'dynaformUid', $sDYNAFORM );
$template->assign( 'taskUid', $sTASKS );
@@ -88,7 +88,7 @@ try {
$template->assign( 'dynaform', $dynTitle );
$template->assign( 'timestamp', date( 'l jS \of F Y h:i:s A' ) );
$template->assign( 'ws', SYS_SYS );
$template->assign( 'ws', config("system.workspace") );
$template->assign( 'version', System::getVersion() );
$fileName = $pathProcess . $dynTitle . 'Post.php';
@@ -134,13 +134,13 @@ try {
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
$output = $oEvent->update( $aDataEvent );
//Show link
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
print $link;
//print "\n<a href='$link' target='_new' > $link </a>";
} else {
$G_FORM = new Form( $sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false );
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
$scriptCode = '';
$scriptCode = $G_FORM->render( PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode );
@@ -158,7 +158,7 @@ try {
$template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
$template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
$template->assign("sysSys", SYS_SYS);
$template->assign("sysSys", config("system.workspace"));
$template->assign("sysLang", SYS_LANG);
$template->assign("sysSkin", SYS_SKIN);
$template->assign("processUid", $sPRO_UID);

View File

@@ -29,7 +29,7 @@ if (G::is_https()) {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$client = new SoapClient( $endpoint, $streamContext );
$user = $sWS_USER;

View File

@@ -14,7 +14,7 @@ if (G::is_https())
else
$http = 'http://';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$oTask = new Task();

View File

@@ -37,7 +37,7 @@ function AuthenticationBasicHTTP ($realm)
return false;
}
$realm = 'ProcessMaker Filesystem for Workspace ' . SYS_SYS;
$realm = 'ProcessMaker Filesystem for Workspace ' . config("system.workspace");
# Choice an authentification type Digest or Basic
//AuthenticationDigestHTTP($realm, $users, $phpcgi);

View File

@@ -6,7 +6,7 @@ $content = file_get_contents($filewsdl);
$http = G::is_https() ? 'https' : 'http';
$port = $_SERVER['SERVER_PORT'] === '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . $port . '/sys' . SYS_SYS . '/' . $lang . '/neoclassic/services/soap2';
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . $port . '/sys' . config("system.workspace") . '/' . $lang . '/neoclassic/services/soap2';
$content = str_replace("___SOAP_ADDRESS___", $endpoint, $content);

View File

@@ -110,7 +110,7 @@ $response = array ();
switch ($option) {
case "LST":
$pageSize = $_REQUEST["pageSize"];
$workspace = SYS_SYS;
$workspace = config("system.workspace");
$action = $_REQUEST["action"];
$description = $_REQUEST["description"];
$dateFrom = $_REQUEST["dateFrom"];

View File

@@ -116,7 +116,7 @@ $response = array ();
switch ($option) {
case "LST":
$pageSize = $_REQUEST["pageSize"];
$workspace = SYS_SYS;
$workspace = config("system.workspace");
$status = $_REQUEST["status"];
$dateFrom = $_REQUEST["dateFrom"];
$dateTo = $_REQUEST["dateTo"];

View File

@@ -78,7 +78,7 @@ try {
$configuration = new Configurations();
$importResults = $language->import( $languageFile );
$renegerateContent = new WorkspaceTools( SYS_SYS );
$renegerateContent = new WorkspaceTools( config("system.workspace") );
$messs = $renegerateContent->upgradeContent();
$result->msg = G::LoadTranslation( 'IMPORT_LANGUAGE_SUCCESS' ) . "\n";

View File

@@ -19,7 +19,7 @@ switch ($request) {
print (G::json_encode( $result )) ;
break;
case 'saveSettings':
$memcache = & PMmemcached::getSingleton( defined( 'SYS_SYS' ) ? SYS_SYS : '' );
$memcache = & PMmemcached::getSingleton( !empty(config("system.workspace")) ? config("system.workspace") : '' );
$conf = new Configurations();
$conf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );

View File

@@ -56,7 +56,7 @@ if ($handle = opendir(PATH_PLUGINS)) {
) {
//Check disabled code
$cs = new CodeScanner(SYS_SYS);
$cs = new CodeScanner(config("system.workspace"));
$arrayFoundDisabledCode = array_merge(
$cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"),

View File

@@ -251,7 +251,7 @@ try {
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
//Check disabled code
$cs = new CodeScanner(SYS_SYS);
$cs = new CodeScanner(config("system.workspace"));
$arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile), $cs->checkDisabledCode("PATH", $path . $sClassName));

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