From 5ef7bdf19034f7108e8232287de682298757ed07 Mon Sep 17 00:00:00 2001 From: jengo Date: Sun, 24 Dec 2000 09:52:27 +0000 Subject: [PATCH] Working on possiable fix for LDAP apps problems --- admin/editaccount.php | 7 ++++--- phpgwapi/inc/phpgw_accounts_ldap.inc.php | 25 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/admin/editaccount.php b/admin/editaccount.php index 3897b97775..d0a04abe28 100755 --- a/admin/editaccount.php +++ b/admin/editaccount.php @@ -172,9 +172,10 @@ $i = 0; $sorted_apps = $phpgw_info["apps"]; - @asort($sorted_apps); - @reset($sorted_apps); - while ($permission = each($sorted_apps)) { + echo "TEST: " . gettype($phpgw_info); +// @asort($sorted_apps); +// @reset($sorted_apps); + while ($permission = each($phpgw_info["apps"])) { if ($permission[1]["enabled"]) { $perm_display[$i][0] = $permission[0]; $perm_display[$i][1] = $permission[1]["title"]; diff --git a/phpgwapi/inc/phpgw_accounts_ldap.inc.php b/phpgwapi/inc/phpgw_accounts_ldap.inc.php index cf3149a964..542ebec531 100644 --- a/phpgwapi/inc/phpgw_accounts_ldap.inc.php +++ b/phpgwapi/inc/phpgw_accounts_ldap.inc.php @@ -210,7 +210,7 @@ return $return_apps; } */ - // This works a little odd, but it is required for apps to be listed in the correct order. + // This works a little odd, but it is required for apps to be listed in the correct order. // We first take an array of apps in the correct order and give it a value of 1. Which local means false. // After the app is verified, it is giving the value of 2, meaning true. function read_apps($lid) @@ -218,12 +218,17 @@ global $phpgw, $phpgw_info; $db2 = $phpgw->db; - - $db2->query("select app_name,app_enabled from applications where app_enabled != 0 order by app_order",__LINE__,__FILE__); + + $db2->query("select * from applications where app_enabled != '0'",__LINE__,__FILE__); while ($db2->next_record()) { - $enabled_apps[$db2->f("app_name")] = 1; - $app_status[$db2->f("app_name")] = $db2->f("app_status"); - } + $name = $db2->f("app_name"); + $title = $db2->f("app_title"); + $status = $db2->f("app_enabled"); + $phpgw_info["apps"][$name] = array("title" => $title, "enabled" => True, "status" => $status); + + $enabled_apps[$db2->f("app_name")] = 1; + $app_status[$db2->f("app_name")] = $db2->f("app_status"); + } if (gettype($lid) == "integer") { $db2->query("select account_permissions from accounts where account_id=$lid",__LINE__,__FILE__); @@ -297,10 +302,14 @@ return $accounts; } - function accounts_const() + function accounts_const($line,$file) { global $phpgw, $phpgw_info; - + + //echo "accounts_const called
line: $line
$file"; + + $phpgw->accounts->phpgw_fillarray(); + $phpgw->preferences->read_preferences(); $this->groups = $this->read_groups($phpgw_info["user"]["userid"]); $this->apps = $this->read_apps($phpgw_info["user"]["userid"]);