Fixed illegal index type errors, fixed permission sorting, fixed account active not showing up

This commit is contained in:
jengo 2000-12-23 06:28:34 +00:00
parent 4d0970d8a6
commit 75a45c9405
3 changed files with 46 additions and 49 deletions

View File

@ -88,7 +88,7 @@
} }
$docommit = False; $docommit = False;
for ($j=0;$j<count($new_apps);$j++) { for ($j=0;$j<count($new_apps);$j++) {
if (!$phpgw_newuser["user"]["preferences"][$new_apps[$j]]) { if (! @$phpgw_newuser["user"]["preferences"][$new_apps[$j]]) {
$phpgw->common->hook_single("add_def_pref", $new_apps[$j]); $phpgw->common->hook_single("add_def_pref", $new_apps[$j]);
$docommit = True; $docommit = True;
} }
@ -121,7 +121,6 @@
$phpgw->template->set_var("error_messages",""); $phpgw->template->set_var("error_messages","");
} }
$userData = $phpgw->accounts->read_userData($account_id); $userData = $phpgw->accounts->read_userData($account_id);
$db_perms = $phpgw->accounts->read_apps($userData["account_lid"]); $db_perms = $phpgw->accounts->read_apps($userData["account_lid"]);
@ -172,7 +171,10 @@
$phpgw->template->set_var("groups_select",$groups_select); $phpgw->template->set_var("groups_select",$groups_select);
$i = 0; $i = 0;
while ($permission = each($phpgw_info["apps"])) { $sorted_apps = $phpgw_info["apps"];
asort($sorted_apps);
reset($sorted_apps);
while ($permission = each($sorted_apps)) {
if ($permission[1]["enabled"]) { if ($permission[1]["enabled"]) {
$perm_display[$i][0] = $permission[0]; $perm_display[$i][0] = $permission[0];
$perm_display[$i][1] = $permission[1]["title"]; $perm_display[$i][1] = $permission[1]["title"];
@ -201,10 +203,11 @@
$perm_html .= "></td></tr>"; $perm_html .= "></td></tr>";
$i++; $i++;
} }
$perm_html .= '<tr><td colspan="4" align="center">' . lang("Account active") . ':&nbsp;<input type="checkbox" name="n_account_status" value="A"' . ($userData["status"]?" checked":"") . '></td></tr>';
$phpgw->template->set_var("permissions_list",$perm_html); $phpgw->template->set_var("permissions_list",$perm_html);
$phpgw->template->set_var("lang_button",lang("Edit")); $phpgw->template->set_var("lang_button",lang("Edit"));
$phpgw->template->pparse("out","form"); $phpgw->template->pparse("out","form");
/* /*

View File

@ -52,11 +52,11 @@
"firstname" => $n_firstname, "lastname" => $n_lastname, "firstname" => $n_firstname, "lastname" => $n_lastname,
"passwd" => $n_passwd, "passwd" => $n_passwd,
"groups" => $phpgw->accounts->groups_array_to_string($n_groups))); "groups" => $phpgw->accounts->groups_array_to_string($n_groups)));
$phpgw->db->query("SELECT account_permissions FROM accounts WHERE account_lid='$n_loginid'"); $phpgw->db->query("SELECT account_permissions FROM accounts WHERE account_lid='$n_loginid'",__LINE__,__FILE__);
$phpgw->db->next_record(); $phpgw->db->next_record();
$apps = explode(":",$phpgw->db->f("account_permissions")); $apps = explode(":",$phpgw->db->f("account_permissions"));
$phpgw->common->hook_single("add_def_pref", "admin"); $phpgw->common->hook_single("add_def_pref", "admin");
for($i=1;$i<=sizeof($apps);$i++) { for ($i=1;$i<=sizeof($apps);$i++) {
$appname = $apps[$i]; $appname = $apps[$i];
$phpgw->common->hook_single("add_def_pref", $appname); $phpgw->common->hook_single("add_def_pref", $appname);
} }
@ -110,7 +110,10 @@
$phpgw->template->set_var("",""); $phpgw->template->set_var("","");
$i = 0; $i = 0;
while ($permission = each($phpgw_info["apps"])) { $sorted_apps = $phpgw_info["apps"];
asort($sorted_apps);
reset($sorted_apps);
while ($permission = each($sorted_apps)) {
if ($permission[1]["enabled"]) { if ($permission[1]["enabled"]) {
$perm_display[$i][0] = $permission[0]; $perm_display[$i][0] = $permission[0];
$perm_display[$i][1] = $permission[1]["title"]; $perm_display[$i][1] = $permission[1]["title"];

View File

@ -468,15 +468,6 @@
} }
$i++; $i++;
if (file_exists($phpgw_info["server"]["app_root"]."/about.php")) {
$tabs[$i]["label"] = "about";
$tabs[$i]["link"] = $phpgw->link($phpgw_info["server"]["webserver_url"] . "/".$phpgw_info["flags"]["currentapp"]."/about.php");
if ($PHP_SELF == $phpgw_info["server"]["webserver_url"] . "/".$phpgw_info["flags"]["currentapp"]."/index.php") {
$selected = $i;
}
$i++;
}
$tabs[$i]["label"] = "logout"; $tabs[$i]["label"] = "logout";
$tabs[$i]["link"] = $phpgw->link($phpgw_info["server"]["webserver_url"] . "/logout.php"); $tabs[$i]["link"] = $phpgw->link($phpgw_info["server"]["webserver_url"] . "/logout.php");