forked from extern/egroupware
Converted accounts.php to templates and fix a few directory errors
This commit is contained in:
parent
3e770d5a0c
commit
d85efa7bd4
@ -14,6 +14,13 @@
|
||||
$phpgw_flags["currentapp"] = "admin";
|
||||
include("../header.inc.php");
|
||||
|
||||
$t = new Template($phpgw_info["server"]["template_dir"]);
|
||||
$t->set_file(array( "header" => "accounts.tpl",
|
||||
"row" => "accounts.tpl",
|
||||
"footer" => "accounts.tpl" ));
|
||||
|
||||
$t->set_block("header","row","footer");
|
||||
|
||||
if (! $start)
|
||||
$start = 0;
|
||||
|
||||
@ -36,25 +43,28 @@
|
||||
$total = $phpgw->db->f(0);
|
||||
$limit = $phpgw->nextmatchs->sql_limit($start);
|
||||
|
||||
echo '<p><table border="0" width="65%" align="center"><tr bgcolor="'
|
||||
. $phpgw_info["theme"][bg_color] . '">'
|
||||
. '<td align="left">' . $phpgw->nextmatchs->left("accounts.php",$start,$total) . '</td>'
|
||||
. '<td align="center">' . lang_admin("user accounts") . '</td>'
|
||||
. '<td align="right">' . $phpgw->nextmatchs->right("accounts.php",$start,$total) . '</td>'
|
||||
. '</tr></table>';
|
||||
$t->set_var("bg_color",$phpgw_info["theme"]["bg_color"]);
|
||||
$t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
||||
|
||||
echo "<center><table border=0 width=65%>"
|
||||
. "<tr bgcolor=" . $phpgw_info["theme"]["th_bg"] . "><td>"
|
||||
. $phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"accounts.php",lang_common("last name")) . "</td><td>"
|
||||
. $phpgw->nextmatchs->show_sort_order($sort,"firstname",$order,"accounts.php",lang_common("first name")) . "</td><td>"
|
||||
. lang_common("Edit") . " </td> <td> " . lang_common("Delete") . " </td> <td> "
|
||||
. lang_common("View") . " </td></tr>\n";
|
||||
$t->set_var("left_next_matchs",$phpgw->nextmatchs->left("accounts.php",$start,$total));
|
||||
$t->set_var("lang_user_accounts",lang_admin("user accounts"));
|
||||
$t->set_var("right_next_matchs",$phpgw->nextmatchs->right("accounts.php",$start,$total));
|
||||
|
||||
$t->set_var("lang_lastname",$phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"accounts.php",lang_common("last name")));
|
||||
$t->set_var("lang_firstname",$phpgw->nextmatchs->show_sort_order($sort,"firstname",$order,"accounts.php",lang_common("first name")));
|
||||
|
||||
$t->set_var("lang_edit",lang_common("Edit"));
|
||||
$t->set_var("lang_delete",lang_common("Delete"));
|
||||
$t->set_var("lang_view",lang_common("View"));
|
||||
|
||||
$t->parse("out","header");
|
||||
|
||||
$phpgw->db->query("select con,firstname,lastname,loginid from accounts $querymethod "
|
||||
. "$ordermethod limit $limit");
|
||||
. "$ordermethod limit $limit");
|
||||
|
||||
while ($phpgw->db->next_record()) {
|
||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
$t->set_var("tr_color",$tr_color);
|
||||
|
||||
$lastname = $phpgw->db->f("lastname");
|
||||
$firstname = $phpgw->db->f("firstname");
|
||||
@ -62,24 +72,31 @@
|
||||
if (! $lastname) $lastname = ' ';
|
||||
if (! $firstname) $firstname = ' ';
|
||||
|
||||
echo "<tr bgcolor=$tr_color><td>$lastname</td><td>$firstname</td>"
|
||||
. "<td width=5%><a href=\"" . $phpgw->link("editaccount.php",
|
||||
"con=" . $phpgw->db->f("con")) . "\"> " . lang_common("Edit") . " </a></td>";
|
||||
$t->set_var("row_firstname",$firstname);
|
||||
$t->set_var("row_lastname",$lastname);
|
||||
$t->set_var("row_edit",'<a href="'.$phpgw->link("editaccount.php","con="
|
||||
. $phpgw->db->f("con")) . '"> ' . lang_common("Edit") . ' </a>');
|
||||
|
||||
if ($phpgw->session->loginid != $phpgw->db->f("loginid")) {
|
||||
$t->set_var("row_delete",'<a href="' . $phpgw->link("deleteaccount.php",'con='
|
||||
. $phpgw->db->f("con")) . '"> '.lang_common("Delete").' </a>');
|
||||
} else {
|
||||
$t->set_var("row_delete"," ");
|
||||
}
|
||||
|
||||
$t->set_var("row_view",'<a href="' . $phpgw->link("viewaccount.php", "con="
|
||||
. $phpgw->db->f("con")) . '"> ' . lang_common("View") . ' </a>');
|
||||
|
||||
if ($phpgw->db->num_rows() != ++$i) {
|
||||
$t->parse("output","row",True);
|
||||
}
|
||||
|
||||
if ($phpgw->session->loginid != $phpgw->db->f("loginid"))
|
||||
echo "<td width=5%><a href=\"" . $phpgw->link("deleteaccount.php",
|
||||
"con=" . $phpgw->db->f("con")) . "\"> " . lang_common("Delete") . " </a></td>";
|
||||
else
|
||||
echo "<td width=5%> </td>";
|
||||
echo "<td width=5%><a href=\"" . $phpgw->link("viewaccount.php",
|
||||
"con=" . $phpgw->db->f("con")) . "\"> " . lang_common("View") . " </a> </td></tr>\n";
|
||||
}
|
||||
|
||||
echo "\n<form method=POST action=\"newaccount.php\">"
|
||||
. $phpgw->session->hidden_var() . "</table></center>"
|
||||
. "<table border=0 width=65% align=center><tr><td align=left><input type=\"submit\" "
|
||||
. "value=\"" . lang_common("Add") . "\"></form><form action=\"accounts.php\"></td>"
|
||||
. $phpgw->session->hidden_var() . "<td align=right>" . lang_common("search") . " "
|
||||
. "<input name=\"query\"></td></tr></form></table>";
|
||||
$t->set_var("hidden_vars",$phpgw->session->hidden_var());
|
||||
$t->set_var("lang_add",lang_common("add"));
|
||||
$t->set_var("lang_search",lang_common("search"));
|
||||
|
||||
$t->pparse("out","footer");
|
||||
|
||||
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");
|
||||
|
@ -90,7 +90,7 @@
|
||||
$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep
|
||||
. "users" . $sep;
|
||||
|
||||
if (! rename($basedir . $lid, $basedir . $n_loginid)) {
|
||||
if (! @rename($basedir . $lid, $basedir . $n_loginid)) {
|
||||
$cd = 35;
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@
|
||||
$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep
|
||||
. "users" . $sep;
|
||||
|
||||
if (!mkdir($basedir . $n_loginid, 0707)) {
|
||||
if (! @mkdir($basedir . $n_loginid, 0707)) {
|
||||
$cd = 36;
|
||||
} else {
|
||||
$cd = 28;
|
||||
|
@ -56,7 +56,7 @@
|
||||
|
||||
$cd = 31;
|
||||
|
||||
if (! mkdir ($basedir . $n_group, 0707)) $cd = 37;
|
||||
if (! @mkdir ($basedir . $n_group, 0707)) $cd = 37;
|
||||
|
||||
$phpgw->db->unlock();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user