From e9c319813dcadd1e3a1ba1e301a87cab573007eb Mon Sep 17 00:00:00 2001 From: seek3r Date: Sat, 27 Jan 2001 04:07:29 +0000 Subject: [PATCH] fixd --- phpgwapi/inc/class.acl.inc.php | 1 + phpgwapi/inc/class.applications.inc.php | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.acl.inc.php b/phpgwapi/inc/class.acl.inc.php index bc11752b8c..90e083691d 100644 --- a/phpgwapi/inc/class.acl.inc.php +++ b/phpgwapi/inc/class.acl.inc.php @@ -75,6 +75,7 @@ } function check($location, $required, $appname = False){ + global $phpgw, $phpgw_info; $rights = $this->get_rights($location,$appname); return !!($rights & $required); diff --git a/phpgwapi/inc/class.applications.inc.php b/phpgwapi/inc/class.applications.inc.php index 7ab3f7703b..80c299fe32 100755 --- a/phpgwapi/inc/class.applications.inc.php +++ b/phpgwapi/inc/class.applications.inc.php @@ -29,17 +29,21 @@ var $group_apps = Array(); function applications($var = ""){ + global $phpgw, $phpgw_info; if ($var != ""){ $this->users_enabled_apps(); } + } function users_enabled_apps() { global $phpgw, $phpgw_info; + if (gettype($phpgw_info["apps"]) != "array") { $this->read_installed_apps(); } + reset ($phpgw_info["apps"]); while (list($app) = each($phpgw_info["apps"])) { if ($phpgw->acl->check("run",1,$app)) { $phpgw_info["user"]["apps"][$app] = array("title" => $phpgw_info["apps"][$app]["title"], "name" => $app, "enabled" => True, "status" => $phpgw_info["apps"][$app]["status"]); @@ -49,18 +53,16 @@ function read_installed_apps(){ global $phpgw, $phpgw_info; - $phpgw->db->lock(array("applications")); $phpgw->db->query("select * from applications where app_enabled != '0' order by app_order",__LINE__,__FILE__); if($phpgw->db->num_rows()) { while ($phpgw->db->next_record()) { -# echo "
TEST: " . $phpgw->db->f("app_order") . " - " . $phpgw->db->f("app_name"); +// echo "
TEST: " . $phpgw->db->f("app_order") . " - " . $phpgw->db->f("app_name"); $name = $phpgw->db->f("app_name"); $title = $phpgw->db->f("app_title"); $status = $phpgw->db->f("app_enabled"); $phpgw_info["apps"][$name] = array("title" => $title, "enabled" => True, "status" => $status); } } - $phpgw->db->unlock(); } function read_user_apps($lid ="") { @@ -208,4 +210,4 @@ } } } -?> +?> \ No newline at end of file