From d5aa7d2fe1badfe38c7ba337fe30745d26485add Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Sun, 11 Feb 2001 19:08:32 +0000 Subject: [PATCH] making user admin pages working --- admin/editaccount.php | 70 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/admin/editaccount.php b/admin/editaccount.php index 7ae2769ef4..d2cad31456 100755 --- a/admin/editaccount.php +++ b/admin/editaccount.php @@ -21,18 +21,17 @@ include($phpgw_info["server"]["app_inc"]."/accounts_".$phpgw_info["server"]["account_repository"].".inc.php"); // creates the html for the user data - function createPageBody($account_id) + function createPageBody($_account_id) { global $phpgw,$phpgw_info; $t = new Template($phpgw->common->get_tpl_dir("admin")); $t->set_file(array("form" => "account_form.tpl")); - $account = CreateObject('phpgwapi.accounts',$account_id); - - $userData = $account->read_repository($account_id); + $account = CreateObject('phpgwapi.accounts',$_account_id); + $userData = $account->read_repository(); - $t->set_var("form_action",$phpgw->link("editaccount.php","account_id=".$userData["account_id"])); + $t->set_var("form_action",$phpgw->link("editaccount.php","account_id=$_account_id")); $t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]); $t->set_var("tr_color1",$phpgw_info["theme"]["row_on"]); @@ -63,6 +62,67 @@ $t->set_var("n_firstname_value",$userData["firstname"]); $t->set_var("n_lastname_value",$userData["lastname"]); + // create list of available app + $i = 0; + + $availableApps = $phpgw_info["apps"]; + @asort($availableApps); + @reset($availableApps); + while ($application = each($availableApps)) + { + if ($application[1]["enabled"]) + { + $perm_display[$i]['appName'] = $application[0]; + $perm_display[$i]['translatedName'] = $application[1]["title"]; + $i++; + } + } + + // create apps output + $apps = CreateObject('phpgwapi.applications',intval($_account_id)); + $db_perms = $apps->read_account_specific(); + + @reset($db_perms); + + // The $i<200 is only used for a brake + for ($i=0;$i<200;) + { + if (! $perm_display[$i]['translatedName']) break; + $perm_html .= '' . lang($perm_display[$i]['translatedName']) . '' + . '' + . 'set_var("permissions_list",$perm_html); + + + + + + + + $t->pparse('out','form'); }