move paths_installed to shared folder CORE #55
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
variables:
|
||||
GIT_STRATEGY: fetch
|
||||
GIT_FETCH_EXTRA_FLAGS: --prune --tags --depth 1000
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
|
||||
1119
composer.lock
generated
1119
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
# Use our base image
|
||||
FROM gitlab.luranasoft.com:5050/luos/docker/base-image:1.0.12-php8.3
|
||||
FROM gitlab.luranasoft.com:5050/luos/docker/base-image:1.0.30-php8.3
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /code
|
||||
|
||||
@@ -451,6 +451,7 @@ class WebApplication
|
||||
define("PATH_TRUNK", $this->rootDir . PATH_SEP);
|
||||
define("PATH_OUTTRUNK", realpath($this->rootDir . "/../") . PATH_SEP);
|
||||
define("PATH_HOME", $this->rootDir . PATH_SEP . "workflow" . PATH_SEP);
|
||||
define('PATH_DATA', isset($_SERVER['PATH_DATA']) ? $_SERVER['PATH_DATA'] : PATH_TRUNK . 'shared' . PATH_SEP );
|
||||
|
||||
define("PATH_HTML", PATH_HOME . "public_html" . PATH_SEP);
|
||||
define("PATH_RBAC_HOME", PATH_TRUNK . "rbac" . PATH_SEP);
|
||||
@@ -479,7 +480,7 @@ class WebApplication
|
||||
define("PATH_UPLOAD", PATH_HTML . "files" . PATH_SEP);
|
||||
define("PATH_WORKFLOW_MYSQL_DATA", PATH_CORE . "data" . PATH_SEP . "mysql" . PATH_SEP);
|
||||
define("PATH_RBAC_MYSQL_DATA", PATH_RBAC_CORE . "data" . PATH_SEP . "mysql" . PATH_SEP);
|
||||
define("FILE_PATHS_INSTALLED", PATH_CORE . "config" . PATH_SEP . "paths_installed.php");
|
||||
define("FILE_PATHS_INSTALLED", PATH_DATA . "config" . PATH_SEP . "paths_installed.php");
|
||||
define("PATH_WORKFLOW_MSSQL_DATA", PATH_CORE . "data" . PATH_SEP . "mssql" . PATH_SEP);
|
||||
define("PATH_RBAC_MSSQL_DATA", PATH_RBAC_CORE . "data" . PATH_SEP . "mssql" . PATH_SEP);
|
||||
define("PATH_CONTROLLERS", PATH_CORE . "controllers" . PATH_SEP);
|
||||
@@ -493,7 +494,7 @@ class WebApplication
|
||||
}
|
||||
|
||||
// include the server installed configuration
|
||||
require_once PATH_CORE . "config" . PATH_SEP . "paths_installed.php";
|
||||
require_once FILE_PATHS_INSTALLED;
|
||||
|
||||
// defining system constant when a valid server environment exists
|
||||
define("PATH_LANGUAGECONT", PATH_DATA . "META-INF" . PATH_SEP);
|
||||
|
||||
@@ -16,9 +16,62 @@ class Bootstrap
|
||||
public static $includeClassPaths = array();
|
||||
public static $includePaths = array();
|
||||
protected $relativeIncludePaths = array();
|
||||
|
||||
public static $startingTime = 0;
|
||||
//below here only approved methods
|
||||
|
||||
/**
|
||||
* Function to initialize session settings
|
||||
*/
|
||||
public static function initializeSession($config) {
|
||||
// Start the timer
|
||||
self::$startingTime = microtime(true);
|
||||
|
||||
// Determine session lifetime
|
||||
$sessionLifetime = isset($config['session.gc_maxlifetime'])
|
||||
? $config['session.gc_maxlifetime']
|
||||
: ini_get('session.gc_maxlifetime');
|
||||
|
||||
// Default to 1440 seconds (24 minutes) if lifetime is not set
|
||||
if (is_null($sessionLifetime)) {
|
||||
$sessionLifetime = 1440;
|
||||
}
|
||||
|
||||
// Set the session garbage collection maximum lifetime
|
||||
ini_set('session.gc_maxlifetime', $sessionLifetime);
|
||||
|
||||
// Configure cookie lifetime based on user agent and configuration
|
||||
Bootstrap::configureCookieLifetime($sessionLifetime, $config);
|
||||
|
||||
// Set cookie security options if REMOTE_USER is not set
|
||||
if (!array_key_exists('REMOTE_USER', $_SERVER) || empty($_SERVER['REMOTE_USER'])) {
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
if (G::is_https()) {
|
||||
ini_set('session.cookie_secure', 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Start the session
|
||||
session_start();
|
||||
}
|
||||
|
||||
/*
|
||||
* Function to configure cookie lifetime based on user agent
|
||||
*/
|
||||
public static function configureCookieLifetime($sessionLifetime, $config) {
|
||||
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
$isIE = preg_match("/msie/i", $userAgent);
|
||||
$isSafari = preg_match("/safari/i", $userAgent) && !preg_match("/chrome/i", $userAgent);
|
||||
|
||||
// Set cookie lifetime based on browser and configuration
|
||||
if (($isIE && $config['ie_cookie_lifetime'] != 1) ||
|
||||
($isSafari && $config['safari_cookie_lifetime'] != 1)) {
|
||||
return; // Do not set cookie lifetime if conditions are not met
|
||||
}
|
||||
|
||||
ini_set('session.cookie_lifetime', $sessionLifetime);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 3.2.2, We keep this function only for backwards compatibility because is used in the plugin manager
|
||||
*/
|
||||
@@ -247,6 +300,10 @@ class Bootstrap
|
||||
$file = $filter->xssFilterHard($file);
|
||||
$downloadFileName = $filter->xssFilterHard($downloadFileName);
|
||||
|
||||
//if (DEBUG_TIME_LOG) { // to do: remove comment
|
||||
self::logTimeByPage();
|
||||
//}
|
||||
|
||||
$browserCacheFilesUid = G::browserCacheFilesGetUid();
|
||||
|
||||
if ($browserCacheFilesUid != null) {
|
||||
@@ -720,16 +777,16 @@ class Bootstrap
|
||||
*/
|
||||
public static function logTimeByPage()
|
||||
{
|
||||
if (!defined(PATH_DATA)) {
|
||||
if (!defined('PATH_DATA')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$serverAddr = $_SERVER ['SERVER_ADDR'];
|
||||
global $startingTime;
|
||||
$endTime = microtime(true);
|
||||
$time = $endTime - $startingTime;
|
||||
$fpt = fopen(PATH_DATA . 'log/time.log', 'a');
|
||||
fwrite($fpt, sprintf("%s.%03d %15s %s %5.3f %s\n", date('Y-m-d H:i:s'), $time, getenv('REMOTE_ADDR'), substr($serverAddr, - 4), $time, $_SERVER ['REQUEST_URI']));
|
||||
$time = $endTime - self::$startingTime;
|
||||
Bootstrap::verifyPath(PATH_DATA . 'logs', true);
|
||||
$fpt = fopen(PATH_DATA . 'logs/time.log', 'a');
|
||||
fwrite($fpt, sprintf("%s %7.6f %-15s %s\n", date('Y-m-d H:i:s'), $time, getenv('REMOTE_ADDR'), $_SERVER ['REQUEST_URI']));
|
||||
fclose($fpt);
|
||||
}
|
||||
|
||||
|
||||
@@ -822,16 +822,18 @@ class InstallerModule extends Controller
|
||||
'USR_LASTNAME' => $adminUsername,
|
||||
'USR_PASSWORD' => G::encryptHash($adminPassword)
|
||||
]);
|
||||
|
||||
// Write the paths_installed.php file (contains all the information configured so far)
|
||||
if (!file_exists(FILE_PATHS_INSTALLED)) {
|
||||
$sh = G::encryptOld(filemtime(PATH_GULLIVER . '/class.g.php'));
|
||||
$h = G::encrypt($db_host . $sh . $db_username . $sh . $db_password, $sh);
|
||||
$dbText = "<?php\n";
|
||||
$dbText .= sprintf(" define('PATH_DATA', '%s');\n", $pathShared);
|
||||
$dbText .= sprintf(" define('PATH_C', '%s');\n", $pathShared . 'compiled/');
|
||||
$dbText .= sprintf(" define('PATH_C', '%s');\n", PATH_DATA . 'compiled/');
|
||||
$dbText .= sprintf(" define('HASH_INSTALLATION', '%s');\n", $h);
|
||||
$dbText .= sprintf(" define('SYSTEM_HASH', '%s');\n", $sh);
|
||||
$this->installLog(G::LoadTranslation('ID_CREATING', SYS_LANG, [FILE_PATHS_INSTALLED]));
|
||||
|
||||
Bootstrap::verifyPath(PATH_DATA . 'config', true);
|
||||
file_put_contents(FILE_PATHS_INSTALLED, $dbText);
|
||||
}
|
||||
|
||||
|
||||
@@ -442,6 +442,7 @@ Ext.onReady(function () {
|
||||
fieldLabel: '<span id="pathSharedSpan"></span> ' + _('ID_WORFLOW_DATA_DIRECTORY'),
|
||||
id: 'pathShared',
|
||||
width: 430,
|
||||
disabled: true,
|
||||
value: path_shared,
|
||||
enableKeyEvents: true,
|
||||
allowBlank: false,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user