From 58dead0b75d25888c57584f0300b1465fc7c22ff Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 20 Apr 2014 12:59:14 +0000 Subject: [PATCH] made can_manage() abstract in baseModule to save memory --- lam/lib/baseModule.inc | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index f72ee1c7..60937971 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -85,13 +85,15 @@ abstract class baseModule { * @param string $scope the account type (user, group, host) */ public function __construct($scope) { - // load configuration - if (isset($_SESSION['config'])) $this->moduleSettings = $_SESSION['config']->get_moduleSettings(); - if (isset($_SESSION['selfServiceProfile'])) $this->selfServiceSettings = $_SESSION['selfServiceProfile']; - // initialize module $this->scope = $scope; - $this->load_Messages(); - $this->meta = $this->get_metaData(); + // load configuration + if ($this->can_manage()) { + if (isset($_SESSION['config'])) $this->moduleSettings = $_SESSION['config']->get_moduleSettings(); + if (isset($_SESSION['selfServiceProfile'])) $this->selfServiceSettings = $_SESSION['selfServiceProfile']; + // initialize module + $this->load_Messages(); + $this->meta = $this->get_metaData(); + } } /** @@ -178,15 +180,6 @@ abstract class baseModule { * The returned array contains a list of key-value pairs for the different functions.
*