release/3.2.2 to develop conflicts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
|
||||
@@ -140,7 +140,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
|
||||
@@ -73,7 +73,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
|
||||
@@ -84,7 +84,7 @@ td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #A
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:220px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
|
||||
@@ -2121,8 +2121,8 @@ class Bootstrap
|
||||
$sysCon["SYS_SKIN"] = SYS_SKIN;
|
||||
}
|
||||
|
||||
if (defined("SYS_SYS")) {
|
||||
$sysCon["SYS_SYS"] = SYS_SYS;
|
||||
if (!empty(config("system.workspace"))) {
|
||||
$sysCon["SYS_SYS"] = config("system.workspace");
|
||||
}
|
||||
|
||||
$sysCon["APPLICATION"] = (isset($_SESSION["APPLICATION"])) ? $_SESSION["APPLICATION"] : "";
|
||||
@@ -2567,11 +2567,7 @@ class Bootstrap
|
||||
$hashType = Bootstrap::getPasswordHashType();
|
||||
}
|
||||
|
||||
$filter = new InputFilter();
|
||||
$hashType = $filter->validateInput($hashType);
|
||||
$pass = $filter->validateInput($pass);
|
||||
|
||||
eval("\$var = hash('" . $hashType . "', '" . $pass . "');");
|
||||
$var = hash($hashType, $pass);
|
||||
|
||||
if ($includeHashType) {
|
||||
$var = $hashType . ':' . $var;
|
||||
@@ -2686,7 +2682,7 @@ class Bootstrap
|
||||
* @return array $aContext void
|
||||
*/
|
||||
public static function getDefaultContextLog(){
|
||||
$sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";
|
||||
$sysSys = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined";
|
||||
$date = \ProcessMaker\Util\DateTime::convertUtcToTimeZone(date('Y-m-d H:m:s'));
|
||||
$aContext = array(
|
||||
'ip' => \G::getIpAddress()
|
||||
@@ -2726,7 +2722,7 @@ class Bootstrap
|
||||
$context['url'] = SYS_CURRENT_URI . '?' . SYS_CURRENT_PARMS;
|
||||
}
|
||||
$context['usrUid'] = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '';
|
||||
$sysSys = defined("SYS_SYS") ? SYS_SYS : "Undefined";
|
||||
$sysSys = !empty(config("system.workspace")) ? config("system.workspace") : "Undefined";
|
||||
\Bootstrap::registerMonolog($channel, $level, $message, $context, $sysSys, 'processmaker.log');
|
||||
}
|
||||
|
||||
@@ -2738,12 +2734,13 @@ class Bootstrap
|
||||
* @return void
|
||||
*/
|
||||
public static function setConstantsRelatedWs($wsName = null) {
|
||||
if (!defined('SYS_SYS') && !is_null($wsName)) {
|
||||
if (empty(config("system.workspace")) && !is_null($wsName)) {
|
||||
//If SYS_SYS exists, is not update with $wsName
|
||||
define('SYS_SYS', $wsName);
|
||||
config(["system.workspace" => $wsName]);
|
||||
}
|
||||
if (defined('SYS_SYS') && !defined('PATH_DATA_SITE')) {
|
||||
define('PATH_DATA_SITE', PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP);
|
||||
if (!empty(config("system.workspace")) && !defined('PATH_DATA_SITE')) {
|
||||
define('PATH_DATA_SITE', PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP);
|
||||
}
|
||||
if (defined('PATH_DATA_SITE') && !defined('PATH_WORKSPACE')) {
|
||||
define('PATH_WORKSPACE', PATH_DATA_SITE);
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -31,7 +31,7 @@ class MonologProvider
|
||||
public $numOfKeepFiles = 60;
|
||||
public $levelDebug = 100;
|
||||
public $bubble = true;
|
||||
public $filePermission = 0775;
|
||||
public $filePermission = 0666;
|
||||
|
||||
public function __construct ($channel, $fileLog)
|
||||
{
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,6 +185,7 @@ class RBAC
|
||||
];
|
||||
$this->aliasPermissions['PM_CASES'] = [self::PM_GUEST_CASE];
|
||||
$this->aliasPermissions['PM_LOGIN'] = [self::PM_GUEST_CASE];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -793,7 +794,7 @@ class RBAC
|
||||
* @access public
|
||||
* @param string $strUser the system
|
||||
* @param string $strPass the password
|
||||
* @return $res
|
||||
* @return $result
|
||||
*/
|
||||
public function checkAutomaticRegister($strUser, $strPass)
|
||||
{
|
||||
@@ -817,17 +818,25 @@ class RBAC
|
||||
$plugin->sSystem = $this->sSystem;
|
||||
//search the usersRolesObj
|
||||
//create the users in ProcessMaker
|
||||
$res = $plugin->automaticRegister($row, $strUser, $strPass);
|
||||
if ($res == 1) {
|
||||
return $res;
|
||||
try {
|
||||
$res = $plugin->automaticRegister($row, $strUser, $strPass);
|
||||
if ($res == 1) {
|
||||
return $res;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$context = Bootstrap::getDefaultContextLog();
|
||||
$context["action"] = "ldapSynchronize";
|
||||
$context["authSource"] = $row;
|
||||
Bootstrap::registerMonolog("ldapSynchronize", 400, $e->getMessage(), $context, $context["workspace"], "processmaker.log");
|
||||
}
|
||||
}
|
||||
|
||||
$dataset->next();
|
||||
$row = $dataset->getRow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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>";
|
||||
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -255,7 +255,7 @@ class XmlFormField
|
||||
$rs = $con->executeQuery( $query, ResultSet::FETCHMODE_NUM );
|
||||
} catch (Exception $e) {
|
||||
//dismiss error because dbarray shouldnt be defined in some contexts.
|
||||
$workspace = defined("SYS_SYS")? SYS_SYS : "Wokspace Undefined";
|
||||
$workspace = !empty(config("system.workspace"))? config("system.workspace") : "Wokspace Undefined";
|
||||
G::log($workspace . " | ip: | " . G::getIpAddress() . " | type error: | " . $e->getMessage() . " | query: " . $query, PATH_DATA, "queriesWithErrors.log");
|
||||
|
||||
return $result;
|
||||
@@ -267,7 +267,7 @@ class XmlFormField
|
||||
$rs = $stmt->executeQuery( $query, ResultSet::FETCHMODE_NUM );
|
||||
} catch (Exception $e) {
|
||||
//dismiss error because dbarray shouldnt be defined in some contexts.
|
||||
$workspace = defined("SYS_SYS")? SYS_SYS : "Wokspace Undefined";
|
||||
$workspace = !empty(config("system.workspace"))? config("system.workspace") : "Wokspace Undefined";
|
||||
G::log($workspace . " | ip: | " . G::getIpAddress() . " | type error: | " . $e->getMessage() . " | query: " . $query, PATH_DATA, "queriesWithErrors.log");
|
||||
|
||||
return $result;
|
||||
@@ -5480,7 +5480,7 @@ class XmlForm
|
||||
$this->fileName = $filename;
|
||||
$parsedFile = dirname( $filename ) . PATH_SEP . basename( $filename, 'xml' ) . $language;
|
||||
|
||||
$parsedFilePath = defined( 'PATH_C' ) ? (defined( 'SYS_SYS' ) ? PATH_C . 'ws' . PATH_SEP . SYS_SYS . PATH_SEP : PATH_C) : PATH_DATA;
|
||||
$parsedFilePath = defined('PATH_C') ? (!empty(config("system.workspace")) ? PATH_C . 'ws' . PATH_SEP . config("system.workspace") . PATH_SEP : PATH_C) : PATH_DATA;
|
||||
$parsedFilePath .= 'xmlform/' . substr( $parsedFile, strlen( $this->home ) );
|
||||
|
||||
// Improvement for the js cache - Start
|
||||
|
||||
Reference in New Issue
Block a user