diff --git a/admin/accounts.php b/admin/accounts.php
index fa4003786b..89be080393 100755
--- a/admin/accounts.php
+++ b/admin/accounts.php
@@ -56,8 +56,8 @@
$account_id = $account["account_id"];
$loginid = $account["account_lid"];
- $phpgw->templater_color = $phpgw->nextmatchs->alternate_row_color($phpgw->templater_color);
- $phpgw->template->set_var("tr_color",$phpgw->templater_color);
+ $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
+ $phpgw->template->set_var("tr_color",$tr_color);
// $lastname = $account["account_lastname"];
// $firstname = $account["account_firstname"];
diff --git a/admin/templates/default/account_view.tpl b/admin/templates/default/account_view.tpl
new file mode 100644
index 0000000000..7d52cb6a01
--- /dev/null
+++ b/admin/templates/default/account_view.tpl
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/admin/templates/default/account_view_row.tpl b/admin/templates/default/account_view_row.tpl
new file mode 100644
index 0000000000..8ef51a3dac
--- /dev/null
+++ b/admin/templates/default/account_view_row.tpl
@@ -0,0 +1,8 @@
+
+
+
+ {lable} |
+ {value} |
+
+
+
diff --git a/admin/viewaccount.php b/admin/viewaccount.php
index 39eac23237..572429e512 100755
--- a/admin/viewaccount.php
+++ b/admin/viewaccount.php
@@ -16,7 +16,9 @@
if (! $account_id) {
$phpgw_info["flags"] = array("nonavbar" => True, "noheader" => True);
}
- $phpgw_info["flags"]["currentapp"] = "admin";
+
+ $phpgw_info["flags"]["enable_nextmatchs_class"] = True;
+ $phpgw_info["flags"]["currentapp"] = "admin";
$phpgw_info["flags"]["parent_page"] = "accounts.php";
include("../header.inc.php");
@@ -27,12 +29,28 @@
Header("Location: " . $phpgw->link("accounts.php"));
}
+ function display_row($lable,$value)
+ {
+ global $phpgw, $tr_color;
+
+ $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
+
+ $phpgw->template->set_var("tr_color",$tr_color);
+ $phpgw->template->set_var("lable",$lable);
+ $phpgw->template->set_var("value",$value);
+
+ $phpgw->template->parse("rows","row",True);
+ }
+
+ $phpgw->template->set_file(array("display" => "account_view.tpl",
+ "row" => "account_view_row.tpl"));
+
$userData = $phpgw->accounts->read_userData($account_id);
$loginid = $userData["account_lid"];
$account_lastlogin = $userData["account_lastlogin"];
$account_lastloginfrom = $userData["account_lastloginfrom"];
- $account_status = $userData["account_status"];
+ $account_status = $userData["account_status"];
$db_perms = $phpgw->accounts->read_apps($loginid);
@@ -46,79 +64,46 @@
#$phpgw->db->query("select account_lastlogin,account_lastloginfrom,account_status from accounts "
# . "where account_id='$account_id'");
#$phpgw->db->next_record();
-
- ?>
-
-
+ $phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
- ">
- |
-
+ display_row(lang("LoginID"),$loginid);
+ display_row(lang("First Name"),$userData["firstname"]);
+ display_row(lang("Last Name"),$userData["lastname"]);
- ">
- |
- |
-
+ $i = 0;
+ while ($permission = each($db_perms)) {
+ if ($phpgw_info["apps"][$permission[0]]["enabled"]) {
+ $perm_display[$i] = lang($phpgw_info["apps"][$permission[0]]["title"]);
+ $i++;
+ }
+ }
+ display_row(lang("account permissions"),implode(", ", $perm_display));
- ">
- |
- |
-
+ if ($userData["status"] == "A") {
+ $account_status = lang("yes");
+ } else {
+ $account_status = "" . lang("no") . "";
+ }
+ display_row(lang("account active"),$account_status);
- ">
- |
- |
-
-
- ">
- |
- accounts->read_group_names($userData["account_lid"]);
+ for ($i=0;$i" . implode(", ", $perm_display) . "
";
+ if (! $userData["lastlogin"]) {
+ $lastlogin = lang("Never");
+ } else {
+ $lastlogin = $phpgw->common->show_date($userData["lastlogin"]);
+ }
+ display_row(lang("Last login"),$lastlogin);
+ display_row(lang("Last login from"),$userData["lastloginfrom"]);
- echo ""
- . lang("account active") . " | ";
- if ($userData["status"] == "A")
- echo lang("yes");
- else
- echo "" . lang("no") . "";
-
- ?> |
- ">
- Groups: |
- accounts->read_group_names($userData["account_lid"]);
- for ($i=0;$i |
-
- ">
- Last login | common->show_date($userData["lastlogin"]);
-
- ?> |
- ">
- Last login from |
- |
-
-
-
-template->pparse("out","display");
$phpgw->common->phpgw_footer();
?>