From f772bf69cd0dcee54cd65c4f2ab9790bd0bf22bf Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 7 Oct 2024 16:34:25 +0200 Subject: [PATCH] remove facility to keep not autoloadable classes in EGroupware session, as there are no such classes anymore --- api/src/Session.php | 23 ----------------------- api/src/loader.php | 12 +----------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/api/src/Session.php b/api/src/Session.php index bb33974a40..903b8bcd99 100644 --- a/api/src/Session.php +++ b/api/src/Session.php @@ -55,13 +55,6 @@ class Session */ const EGW_APPSESSION_VAR = 'egw_app_session'; - /** - * key of eGW's required files in $_SESSION - * - * These files get set by Db and Egw class, for classes which get not autoloaded (eg. ADOdb, idots_framework) - */ - const EGW_REQUIRED_FILES = 'egw_required_files'; - /** * key of eGW's egw_info cached in $_SESSION */ @@ -160,13 +153,6 @@ class Session */ private $egw_domains; - /** - * $_SESSION at the time the constructor was called - * - * @var array - */ - var $required_files; - /** * Nummeric code why session creation failed * @@ -212,8 +198,6 @@ class Session */ function __construct(array $domain_names=null) { - $this->required_files = $_SESSION[self::EGW_REQUIRED_FILES]; - $this->sessionid = self::get_sessionid(); $this->kp3 = self::get_request('kp3'); @@ -983,13 +967,6 @@ class Session */ private function register_session($login,$user_ip,$now,$session_flags) { - // restore session vars set before session was started - if (is_array($this->required_files)) - { - $_SESSION[self::EGW_REQUIRED_FILES] = !is_array($_SESSION[self::EGW_REQUIRED_FILES] ?? null) ? $this->required_files : - array_unique(array_merge($_SESSION[self::EGW_REQUIRED_FILES],$this->required_files)); - unset($this->required_files); - } $_SESSION[self::EGW_SESSION_VAR] = array( 'session_id' => $this->sessionid, 'session_lid' => $login, diff --git a/api/src/loader.php b/api/src/loader.php index f291b7b91d..fc8d73a77b 100644 --- a/api/src/loader.php +++ b/api/src/loader.php @@ -56,7 +56,7 @@ if (Session::init_handler()) { if ($GLOBALS['egw_info']['flags']['currentapp'] != 'login' && $GLOBALS['egw_info']['flags']['currentapp'] != 'logout') { - if (is_array($_SESSION[Session::EGW_INFO_CACHE]) && $_SESSION[Session::EGW_OBJECT_CACHE] && $_SESSION[Session::EGW_REQUIRED_FILES]) + if (is_array($_SESSION[Session::EGW_INFO_CACHE]) && !empty($_SESSION[Session::EGW_OBJECT_CACHE])) { // marking the context as restored from the session, used by session->verify to not read the data from the db again $GLOBALS['egw_info']['flags']['restored_from_session'] = true; @@ -64,14 +64,6 @@ if (Session::init_handler()) // restoring the egw_info-array $GLOBALS['egw_info'] = array_merge($_SESSION[Session::EGW_INFO_CACHE],array('flags' => $GLOBALS['egw_info']['flags'])); - // include required class-definitions - if (is_array($_SESSION[Session::EGW_REQUIRED_FILES])) // all classes, which can not be autoloaded - { - foreach($_SESSION[Session::EGW_REQUIRED_FILES] as $file) - { - require_once($file); - } - } $GLOBALS['egw'] = unserialize($_SESSION[Session::EGW_OBJECT_CACHE], ['allowed_classes' => true]); if (is_object($GLOBALS['egw']) && ($GLOBALS['egw'] instanceof Egw)) // only egw object has wakeup2, setups egw_minimal eg. has not! @@ -86,14 +78,12 @@ if (Session::init_handler()) $GLOBALS['egw_info'] = array('flags'=>$GLOBALS['egw_info']['flags']); unset($GLOBALS['egw_info']['flags']['restored_from_session']); unset($_SESSION[Session::EGW_INFO_CACHE]); - unset($_SESSION[Session::EGW_REQUIRED_FILES]); unset($_SESSION[Session::EGW_OBJECT_CACHE]); } } else // destroy the session-cache if called by login or logout { unset($_SESSION[Session::EGW_INFO_CACHE]); - unset($_SESSION[Session::EGW_REQUIRED_FILES]); unset($_SESSION[Session::EGW_OBJECT_CACHE]); } }