egroupware_official/admin/accounts.php

99 lines
4.2 KiB
PHP
Raw Normal View History

2000-08-18 05:24:22 +02:00
<?php
/**************************************************************************\
* phpGroupWare - administration *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
$phpgw_info["flags"] = array("currentapp" => "admin", "enable_nextmatchs_class" => True);
2000-08-18 05:24:22 +02:00
include("../header.inc.php");
include($phpgw_info["server"]["server_root"] . "/admin/inc/accounts_"
. $phpgw_info["server"]["auth_type"] . ".inc.php");
2000-08-18 05:24:22 +02:00
2000-11-07 21:37:02 +01:00
$phpgw->template->set_file(array("header" => "accounts.tpl",
2000-10-23 05:33:30 +02:00
"row" => "accounts.tpl",
"footer" => "accounts.tpl"));
2000-11-07 21:37:02 +01:00
$phpgw->template->set_block("header","row","footer");
2000-11-07 21:37:02 +01:00
$phpgw->templateotal = account_total();
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("bg_color",$phpgw_info["theme"]["bg_color"]);
$phpgw->template->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("left_next_matchs",$phpgw->nextmatchs->left("accounts.php",$start,$phpgw->templateotal));
$phpgw->template->set_var("lang_user_accounts",lang("user accounts"));
$phpgw->template->set_var("right_next_matchs",$phpgw->nextmatchs->right("accounts.php",$start,$phpgw->templateotal));
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("lang_lastname",$phpgw->nextmatchs->show_sort_order($sort,"account_lastname",$order,"accounts.php",lang("last name")));
$phpgw->template->set_var("lang_firstname",$phpgw->nextmatchs->show_sort_order($sort,"account_firstname",$order,"accounts.php",lang("first name")));
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("lang_edit",lang("Edit"));
$phpgw->template->set_var("lang_delete",lang("Delete"));
$phpgw->template->set_var("lang_view",lang("View"));
2000-11-07 21:37:02 +01:00
$phpgw->template->parse("out","header");
$account_info = account_read($method,$start,$sort,$order);
2000-08-18 05:24:22 +02:00
while (list($null,$account) = each($account_info)) {
2000-10-26 03:16:10 +02:00
// while (list($key) = each($account_info[0])) {
// for ($i=0; $i<count($account_info);$i++) {
// echo "<br>0: " . $account_info[1][$key];
// echo "<br>1: " . $a[2];
// echo "<br>2: " . $b[1];
$lastname = $account["account_lastname"];
$firstname = $account["account_firstname"];
$account_id = $account["account_id"];
$loginid = $account["account_lid"];
2000-11-07 21:37:02 +01:00
$phpgw->templater_color = $phpgw->nextmatchs->alternate_row_color($phpgw->templater_color);
$phpgw->template->set_var("tr_color",$phpgw->templater_color);
2000-08-18 05:24:22 +02:00
2000-10-26 03:16:10 +02:00
// $lastname = $account["account_lastname"];
// $firstname = $account["account_firstname"];
2000-08-18 05:24:22 +02:00
if (! $lastname) $lastname = '&nbsp;';
if (! $firstname) $firstname = '&nbsp;';
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("row_firstname",$firstname);
$phpgw->template->set_var("row_lastname",$lastname);
$phpgw->template->set_var("row_edit",'<a href="'.$phpgw->link("editaccount.php","account_id="
2000-10-26 03:16:10 +02:00
. $account_id) . '"> ' . lang("Edit") . ' </a>');
if ($phpgw_info["user"]["userid"] != $account["account_lid"]) {
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("row_delete",'<a href="' . $phpgw->link("deleteaccount.php",'account_id='
2000-10-26 03:16:10 +02:00
. $account_id) . '"> '.lang("Delete").' </a>');
} else {
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("row_delete","&nbsp;");
}
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("row_view",'<a href="' . $phpgw->link("viewaccount.php", "account_id="
2000-10-26 03:16:10 +02:00
. $account_id) . '"> ' . lang("View") . ' </a>');
2000-11-07 21:37:02 +01:00
if ($phpgw->templateotal == 1) {
$phpgw->template->set_var("output","");
}
2000-11-07 21:37:02 +01:00
if ($phpgw->templateotal != ++$i) {
$phpgw->template->parse("output","row",True);
}
2000-08-18 05:24:22 +02:00
}
2000-11-07 21:37:02 +01:00
$phpgw->template->set_var("actionurl",$phpgw->link("newaccount.php"));
$phpgw->template->set_var("lang_add",lang("add"));
$phpgw->template->set_var("lang_search",lang("search"));
2000-11-07 21:37:02 +01:00
$phpgw->template->pparse("out","footer");
2000-08-18 05:24:22 +02:00
$phpgw->common->phpgw_footer();
account_close();
2000-09-28 04:25:19 +02:00
?>