diff --git a/admin/editaccount.php b/admin/editaccount.php index d3c3699db7..013dfa77f8 100755 --- a/admin/editaccount.php +++ b/admin/editaccount.php @@ -71,37 +71,37 @@ } $cd = account_edit(array("loginid" => $n_loginid, "permissions" => $new_permissions, - "firstname" => $n_firstname, "lastname" => $n_lastname, - "passwd" => $n_passwd, "account_status" => $n_account_status, - "old_loginid" => $old_loginid, "account_id" => rawurldecode($account_id), - "groups" => $phpgw->accounts->groups_array_to_string($n_groups))); + "firstname" => $n_firstname, "lastname" => $n_lastname, + "passwd" => $n_passwd, "account_status" => $n_account_status, + "old_loginid" => $old_loginid, "account_id" => rawurldecode($account_id), + "groups" => $phpgw->accounts->groups_array_to_string($n_groups))); // The following sets any default preferences needed for new applications.. // This is smart enough to know if previous preferences were selected, use them. if (count($new_apps)) { - if ($account_id <> $phpgw_info["user"]["account_id"]) { - $phpgw->db->query("SELECT preference_value FROM preferences WHERE preference_owner=".$account_id,__FILE__,__LINE__); - $phpgw->db->next_record(); - $phpgw_newuser["user"]["preferences"] = unserialize($phpgw->db->f("preference_value")); - } else { - $phpgw_newuser["user"]["preferences"] = $phpgw_info["user"]["preferences"]; - } - $docommit = False; - for ($j=0;$jcommon->hook_single("add_def_pref", $new_apps[$j]); - $docommit = True; - } - } - if ($docommit) { - if ($account_id <> $phpgw_info["user"]["account_id"]) { - $phpgw->preferences->commit_user($account_id); - } else { - $phpgw_info["user"]["preferences"] = $phpgw_newuser["user"]["preferences"]; - unset($phpgw_newuser); - $phpgw->preferences->commit(); - } - } + if ($account_id <> $phpgw_info["user"]["account_id"]) { + $phpgw->db->query("SELECT preference_value FROM preferences WHERE preference_owner=".$account_id,__FILE__,__LINE__); + $phpgw->db->next_record(); + $phpgw_newuser["user"]["preferences"] = unserialize($phpgw->db->f("preference_value")); + } else { + $phpgw_newuser["user"]["preferences"] = $phpgw_info["user"]["preferences"]; + } + $docommit = False; + for ($j=0;$jcommon->hook_single("add_def_pref", $new_apps[$j]); + $docommit = True; + } + } + if ($docommit) { + if ($account_id <> $phpgw_info["user"]["account_id"]) { + $phpgw->preferences->commit_user($account_id); + } else { + $phpgw_info["user"]["preferences"] = $phpgw_newuser["user"]["preferences"]; + unset($phpgw_newuser); + $phpgw->preferences->commit(); + } + } } Header("Location: " . $phpgw->link("accounts.php", "cd=$cd")); @@ -121,7 +121,6 @@ $phpgw->template->set_var("error_messages",""); } - $userData = $phpgw->accounts->read_userData($account_id); $db_perms = $phpgw->accounts->read_apps($userData["account_lid"]); @@ -172,7 +171,10 @@ $phpgw->template->set_var("groups_select",$groups_select); $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"]) { $perm_display[$i][0] = $permission[0]; $perm_display[$i][1] = $permission[1]["title"]; @@ -201,10 +203,11 @@ $perm_html .= ">"; $i++; } + $perm_html .= '' . lang("Account active") . ': '; + $phpgw->template->set_var("permissions_list",$perm_html); $phpgw->template->set_var("lang_button",lang("Edit")); - $phpgw->template->pparse("out","form"); /* diff --git a/admin/newaccount.php b/admin/newaccount.php index 76aa4c9228..d6bba891b2 100755 --- a/admin/newaccount.php +++ b/admin/newaccount.php @@ -52,15 +52,15 @@ "firstname" => $n_firstname, "lastname" => $n_lastname, "passwd" => $n_passwd, "groups" => $phpgw->accounts->groups_array_to_string($n_groups))); - $phpgw->db->query("SELECT account_permissions FROM accounts WHERE account_lid='$n_loginid'"); - $phpgw->db->next_record(); - $apps = explode(":",$phpgw->db->f("account_permissions")); - $phpgw->common->hook_single("add_def_pref", "admin"); - for($i=1;$i<=sizeof($apps);$i++) { - $appname = $apps[$i]; - $phpgw->common->hook_single("add_def_pref", $appname); - } - $phpgw->preferences->commit_newuser($n_loginid); + $phpgw->db->query("SELECT account_permissions FROM accounts WHERE account_lid='$n_loginid'",__LINE__,__FILE__); + $phpgw->db->next_record(); + $apps = explode(":",$phpgw->db->f("account_permissions")); + $phpgw->common->hook_single("add_def_pref", "admin"); + for ($i=1;$i<=sizeof($apps);$i++) { + $appname = $apps[$i]; + $phpgw->common->hook_single("add_def_pref", $appname); + } + $phpgw->preferences->commit_newuser($n_loginid); Header("Location: " . $phpgw->link("accounts.php","cd=$cd")); exit; } @@ -110,7 +110,10 @@ $phpgw->template->set_var("",""); $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"]) { $perm_display[$i][0] = $permission[0]; $perm_display[$i][1] = $permission[1]["title"]; diff --git a/phpgwapi/inc/phpgw_common.inc.php b/phpgwapi/inc/phpgw_common.inc.php index 1d3f376834..171c0c2146 100644 --- a/phpgwapi/inc/phpgw_common.inc.php +++ b/phpgwapi/inc/phpgw_common.inc.php @@ -468,15 +468,6 @@ } $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]["link"] = $phpgw->link($phpgw_info["server"]["webserver_url"] . "/logout.php");