mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 08:19:45 +01:00
Fixed a problem with the sorting in the current users section and cleaned up some of the error reporting
This commit is contained in:
parent
9625d6582f
commit
3e3f04a137
@ -37,13 +37,13 @@
|
|||||||
$t->set_var("right_next_matchs",$phpgw->nextmatchs->right("currentusers.php",$start,$total));
|
$t->set_var("right_next_matchs",$phpgw->nextmatchs->right("currentusers.php",$start,$total));
|
||||||
$t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
$t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
||||||
|
|
||||||
$t->set_var("sort_loginid",$phpgw->nextmatchs->show_sort_order($sort,"loginid",$order,
|
$t->set_var("sort_loginid",$phpgw->nextmatchs->show_sort_order($sort,"session_lid",$order,
|
||||||
"currentusers.php",lang("LoginID")));
|
"currentusers.php",lang("LoginID")));
|
||||||
$t->set_var("sort_ip",$phpgw->nextmatchs->show_sort_order($sort,"ip",$order,
|
$t->set_var("sort_ip",$phpgw->nextmatchs->show_sort_order($sort,"session_ip",$order,
|
||||||
"currentusers.php",lang("IP")));
|
"currentusers.php",lang("IP")));
|
||||||
$t->set_var("sort_login_time",$phpgw->nextmatchs->show_sort_order($sort,"logintime",$order,
|
$t->set_var("sort_login_time",$phpgw->nextmatchs->show_sort_order($sort,"session_logintime",$order,
|
||||||
"currentusers.php",lang("Login Time")));
|
"currentusers.php",lang("Login Time")));
|
||||||
$t->set_var("sort_idle",$phpgw->nextmatchs->show_sort_order($sort,"dla",$order,
|
$t->set_var("sort_idle",$phpgw->nextmatchs->show_sort_order($sort,"session_dla",$order,
|
||||||
"currentusers.php",lang("idle")));
|
"currentusers.php",lang("idle")));
|
||||||
$t->set_var("lang_kill",lang("Kill"));
|
$t->set_var("lang_kill",lang("Kill"));
|
||||||
|
|
||||||
|
@ -43,8 +43,9 @@
|
|||||||
|
|
||||||
$group_name = $phpgw->db->f("group_name");
|
$group_name = $phpgw->db->f("group_name");
|
||||||
|
|
||||||
$phpgw->db->query("select account_id,account_lid from accounts where account_groups like '%$group_id%'");
|
$phpgw->db->query("select count(*) from accounts where account_groups like '%$group_id%'");
|
||||||
if ($phpgw->db->num_rows()) {
|
$phpgw->db->next_record();
|
||||||
|
if ($phpgw->db->f(0) != 0) {
|
||||||
$phpgw->common->phpgw_header();
|
$phpgw->common->phpgw_header();
|
||||||
$phpgw->common->navbar();
|
$phpgw->common->navbar();
|
||||||
|
|
||||||
@ -55,6 +56,7 @@
|
|||||||
|
|
||||||
echo '<table border="0"><tr><td>';
|
echo '<table border="0"><tr><td>';
|
||||||
|
|
||||||
|
$phpgw->db->query("select account_id,account_lid from accounts where account_groups like '%$group_id%'");
|
||||||
while ($phpgw->db->next_record()) {
|
while ($phpgw->db->next_record()) {
|
||||||
echo '<tr><td><a href="' . $phpgw->link("editaccount.php","account_=" . $phpgw->db->f("account_id")) . '">' . $phpgw->db->f("loginid") . '</a></tr></td>';
|
echo '<tr><td><a href="' . $phpgw->link("editaccount.php","account_=" . $phpgw->db->f("account_id")) . '">' . $phpgw->db->f("loginid") . '</a></tr></td>';
|
||||||
}
|
}
|
||||||
|
@ -18,25 +18,30 @@
|
|||||||
$phpgw_info["flags"]["currentapp"] = "admin";
|
$phpgw_info["flags"]["currentapp"] = "admin";
|
||||||
include("../header.inc.php");
|
include("../header.inc.php");
|
||||||
if ($submit) {
|
if ($submit) {
|
||||||
|
$totalerrors = 0;
|
||||||
|
|
||||||
if (! $n_loginid)
|
if (! $n_loginid)
|
||||||
$error = "<br>" . lang("You must enter a loginid");
|
$error[$totalerrors++] = lang("You must enter a loginid");
|
||||||
|
|
||||||
if (! $n_passwd)
|
if (! $n_passwd)
|
||||||
$error .= "<br>" . lang("You must enter a password");
|
$error[$totalerrors++] = lang("You must enter a password");
|
||||||
|
|
||||||
if ($n_passwd == $n_loginid)
|
if ($n_passwd == $n_loginid)
|
||||||
$error = "<br>" . lang("The login and password can not be the same");
|
$error[$totalerrors++] = lang("The login and password can not be the same");
|
||||||
|
|
||||||
if ($n_passwd != $n_passwd_2)
|
if ($n_passwd != $n_passwd_2)
|
||||||
$error .= "<br>" . lang("The two passwords are not the same");
|
$error[$totalerrors++] = lang("The two passwords are not the same");
|
||||||
|
|
||||||
if (count($new_permissions) == 0)
|
if (count($new_permissions) == 0)
|
||||||
$error .= "<br>" . lang("You must add at least 1 permission to this account");
|
$error[$totalerrors++] = lang("You must add at least 1 permission to this account");
|
||||||
|
|
||||||
|
if (count($n_groups) == 0)
|
||||||
|
$error[$totalerrors++] = lang("Account must belong to at least 1 group");
|
||||||
|
|
||||||
$phpgw->db->query("select account_lid from accounts where account_lid='$n_loginid'");
|
$phpgw->db->query("select count(*) from accounts where account_lid='$n_loginid'");
|
||||||
$phpgw->db->next_record();
|
$phpgw->db->next_record();
|
||||||
if ($phpgw->db->f("loginid"))
|
if ($phpgw->db->f(0) != 0)
|
||||||
$error .= "<br>" . lang("That loginid has already been taken");
|
$error[$totalerrors++] = lang("That loginid has already been taken");
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$phpgw->db->lock(array("accounts","preferences"));
|
$phpgw->db->lock(array("accounts","preferences"));
|
||||||
@ -63,45 +68,42 @@
|
|||||||
$phpgw->accounts->add_app($permission[0]);
|
$phpgw->accounts->add_app($permission[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//$phpgw->permissions->add("hr");
|
|
||||||
|
|
||||||
if ($n_anonymous && ! $n_admin)
|
$sql = "insert into accounts (account_lid,account_pwd,account_firstname,account_lastname,"
|
||||||
$phpgwpermissions->add("anonymous");
|
. "account_permissions,account_groups,account_status,account_lastpwd_change) values ('$n_loginid'"
|
||||||
|
. ",'" . md5($n_passwd) . "','" . addslashes($n_firstname) . "','"
|
||||||
|
. addslashes($n_lastname) . "','" . $phpgw->accounts->add_app("",True)
|
||||||
|
. "','" . $phpgw->accounts->array_to_string("none",$n_groups) . "','A',0)";
|
||||||
|
|
||||||
$sql = "insert into accounts (account_lid,account_pwd,account_firstname,account_lastname,"
|
$phpgw->db->query($sql);
|
||||||
. "account_permissions,account_groups,account_status,account_lastpwd_change) values ('$n_loginid'"
|
$phpgw->db->unlock();
|
||||||
. ",'" . md5($n_passwd) . "','" . addslashes($n_firstname) . "','"
|
|
||||||
. addslashes($n_lastname) . "','" . $phpgw->accounts->add_app("",True)
|
|
||||||
. "','" . $phpgw->accounts->array_to_string("none",$n_groups) . "','A',0)";
|
|
||||||
|
|
||||||
$phpgw->db->query($sql);
|
$sep = $phpgw->common->filesystem_separator();
|
||||||
$phpgw->db->unlock();
|
|
||||||
|
|
||||||
$sep = $phpgw->common->filesystem_separator();
|
$basedir = $phpgw_info["server"]["files_dir"] . $sep . "users" . $sep;
|
||||||
|
|
||||||
$basedir = $phpgw_info["server"]["files_dir"] . $sep . "users" . $sep;
|
if (! @mkdir($basedir . $n_loginid, 0707)) {
|
||||||
|
// $cd = 36;
|
||||||
|
} else {
|
||||||
|
$cd = 28;
|
||||||
|
}
|
||||||
|
|
||||||
umask(000);
|
Header("Location: " . $phpgw->link("accounts.php","cd=$cd"));
|
||||||
if (! @mkdir($basedir . $n_loginid, 0707)) {
|
exit;
|
||||||
// $cd = 36;
|
|
||||||
} else {
|
|
||||||
$cd = 28;
|
|
||||||
}
|
|
||||||
|
|
||||||
Header("Location: " . $phpgw->link("accounts.php","cd=$cd"));
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpgw->common->phpgw_header();
|
$phpgw->common->phpgw_header();
|
||||||
$phpgw->common->navbar();
|
$phpgw->common->navbar();
|
||||||
?>
|
|
||||||
|
echo "<p><b>" . lang("Add new account") . "</b><hr><br>";
|
||||||
|
|
||||||
|
if ($totalerrors) {
|
||||||
|
echo "<center>" . $phpgw->common->error_list($error) . "</center>";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
<form method="POST" action="<?php echo $phpgw->link("newaccount.php"); ?>">
|
<form method="POST" action="<?php echo $phpgw->link("newaccount.php"); ?>">
|
||||||
<?php
|
|
||||||
if ($error) {
|
|
||||||
echo "<center>" . lang("Error") . ":$error</center>";
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<center>
|
<center>
|
||||||
<table border=0 width=65%>
|
<table border=0 width=65%>
|
||||||
<tr>
|
<tr>
|
||||||
@ -173,16 +175,6 @@
|
|||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// Just until we can get thing the $phpgw_info["apps"] then figured out
|
|
||||||
echo "<tr><td>" . lang("Anonymous user") . "</td> <td><input type=\""
|
|
||||||
. "checkbox\" name=\"new_permissions[anonymous]\" value=\"Y\"></td>";
|
|
||||||
|
|
||||||
echo "<td>" . lang("Manager") . "</td> <td><input type=\""
|
|
||||||
. "checkbox\" name=\"new_permissions[manager]\" value=\"Y\"></td></tr>";
|
|
||||||
*/
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=2>
|
<td colspan=2>
|
||||||
|
Loading…
Reference in New Issue
Block a user