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";
|
$phpgw_flags["currentapp"] = "admin";
|
||||||
include("../header.inc.php");
|
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)
|
if (! $start)
|
||||||
$start = 0;
|
$start = 0;
|
||||||
|
|
||||||
@ -36,25 +43,28 @@
|
|||||||
$total = $phpgw->db->f(0);
|
$total = $phpgw->db->f(0);
|
||||||
$limit = $phpgw->nextmatchs->sql_limit($start);
|
$limit = $phpgw->nextmatchs->sql_limit($start);
|
||||||
|
|
||||||
echo '<p><table border="0" width="65%" align="center"><tr bgcolor="'
|
$t->set_var("bg_color",$phpgw_info["theme"]["bg_color"]);
|
||||||
. $phpgw_info["theme"][bg_color] . '">'
|
$t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
||||||
. '<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>';
|
|
||||||
|
|
||||||
echo "<center><table border=0 width=65%>"
|
$t->set_var("left_next_matchs",$phpgw->nextmatchs->left("accounts.php",$start,$total));
|
||||||
. "<tr bgcolor=" . $phpgw_info["theme"]["th_bg"] . "><td>"
|
$t->set_var("lang_user_accounts",lang_admin("user accounts"));
|
||||||
. $phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"accounts.php",lang_common("last name")) . "</td><td>"
|
$t->set_var("right_next_matchs",$phpgw->nextmatchs->right("accounts.php",$start,$total));
|
||||||
. $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> "
|
$t->set_var("lang_lastname",$phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"accounts.php",lang_common("last name")));
|
||||||
. lang_common("View") . " </td></tr>\n";
|
$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 "
|
$phpgw->db->query("select con,firstname,lastname,loginid from accounts $querymethod "
|
||||||
. "$ordermethod limit $limit");
|
. "$ordermethod limit $limit");
|
||||||
|
|
||||||
while ($phpgw->db->next_record()) {
|
while ($phpgw->db->next_record()) {
|
||||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||||
|
$t->set_var("tr_color",$tr_color);
|
||||||
|
|
||||||
$lastname = $phpgw->db->f("lastname");
|
$lastname = $phpgw->db->f("lastname");
|
||||||
$firstname = $phpgw->db->f("firstname");
|
$firstname = $phpgw->db->f("firstname");
|
||||||
@ -62,24 +72,31 @@
|
|||||||
if (! $lastname) $lastname = ' ';
|
if (! $lastname) $lastname = ' ';
|
||||||
if (! $firstname) $firstname = ' ';
|
if (! $firstname) $firstname = ' ';
|
||||||
|
|
||||||
echo "<tr bgcolor=$tr_color><td>$lastname</td><td>$firstname</td>"
|
$t->set_var("row_firstname",$firstname);
|
||||||
. "<td width=5%><a href=\"" . $phpgw->link("editaccount.php",
|
$t->set_var("row_lastname",$lastname);
|
||||||
"con=" . $phpgw->db->f("con")) . "\"> " . lang_common("Edit") . " </a></td>";
|
$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"))
|
if ($phpgw->session->loginid != $phpgw->db->f("loginid")) {
|
||||||
echo "<td width=5%><a href=\"" . $phpgw->link("deleteaccount.php",
|
$t->set_var("row_delete",'<a href="' . $phpgw->link("deleteaccount.php",'con='
|
||||||
"con=" . $phpgw->db->f("con")) . "\"> " . lang_common("Delete") . " </a></td>";
|
. $phpgw->db->f("con")) . '"> '.lang_common("Delete").' </a>');
|
||||||
else
|
} else {
|
||||||
echo "<td width=5%> </td>";
|
$t->set_var("row_delete"," ");
|
||||||
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\">"
|
$t->set_var("row_view",'<a href="' . $phpgw->link("viewaccount.php", "con="
|
||||||
. $phpgw->session->hidden_var() . "</table></center>"
|
. $phpgw->db->f("con")) . '"> ' . lang_common("View") . ' </a>');
|
||||||
. "<table border=0 width=65% align=center><tr><td align=left><input type=\"submit\" "
|
|
||||||
. "value=\"" . lang_common("Add") . "\"></form><form action=\"accounts.php\"></td>"
|
if ($phpgw->db->num_rows() != ++$i) {
|
||||||
. $phpgw->session->hidden_var() . "<td align=right>" . lang_common("search") . " "
|
$t->parse("output","row",True);
|
||||||
. "<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");
|
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep
|
$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep
|
||||||
. "users" . $sep;
|
. "users" . $sep;
|
||||||
|
|
||||||
if (! rename($basedir . $lid, $basedir . $n_loginid)) {
|
if (! @rename($basedir . $lid, $basedir . $n_loginid)) {
|
||||||
$cd = 35;
|
$cd = 35;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep
|
$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep
|
||||||
. "users" . $sep;
|
. "users" . $sep;
|
||||||
|
|
||||||
if (!mkdir($basedir . $n_loginid, 0707)) {
|
if (! @mkdir($basedir . $n_loginid, 0707)) {
|
||||||
$cd = 36;
|
$cd = 36;
|
||||||
} else {
|
} else {
|
||||||
$cd = 28;
|
$cd = 28;
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
$cd = 31;
|
$cd = 31;
|
||||||
|
|
||||||
if (! mkdir ($basedir . $n_group, 0707)) $cd = 37;
|
if (! @mkdir ($basedir . $n_group, 0707)) $cd = 37;
|
||||||
|
|
||||||
$phpgw->db->unlock();
|
$phpgw->db->unlock();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user