mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-03 17:41:27 +01:00
Added error checking for adding/editing an account with no permissions. Also fixed a database locking problem.
This commit is contained in:
parent
108c265fb5
commit
3ccd788493
@ -32,8 +32,6 @@
|
|||||||
$phpgw->db->next_record();
|
$phpgw->db->next_record();
|
||||||
$lid = $phpgw->db->f("loginid");
|
$lid = $phpgw->db->f("loginid");
|
||||||
|
|
||||||
$phpgw->db->lock(array('accounts','preferences','sessions'));
|
|
||||||
|
|
||||||
if ($n_passwd || $n_passwd_2) {
|
if ($n_passwd || $n_passwd_2) {
|
||||||
if ($n_passwd != $n_passwd_2)
|
if ($n_passwd != $n_passwd_2)
|
||||||
$error .= lang_admin("The two passwords are not the same");
|
$error .= lang_admin("The two passwords are not the same");
|
||||||
@ -49,7 +47,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count($new_permissions) == 0)
|
||||||
|
$error .= "<br>" . lang_admin("You must add at least 1 permission to this account");
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
|
$phpgw->db->lock(array('accounts','preferences','sessions'));
|
||||||
if ($n_passwd) {
|
if ($n_passwd) {
|
||||||
$phpgw->db->query("update accounts set passwd='" . md5($n_passwd) . "', "
|
$phpgw->db->query("update accounts set passwd='" . md5($n_passwd) . "', "
|
||||||
. "lastpasswd_change='" . time() . "' where loginid='"
|
. "lastpasswd_change='" . time() . "' where loginid='"
|
||||||
@ -101,8 +103,8 @@
|
|||||||
. "$n_account_status', groups='"
|
. "$n_account_status', groups='"
|
||||||
. $phpgw->groups->array_to_string("none",$n_groups)
|
. $phpgw->groups->array_to_string("none",$n_groups)
|
||||||
. "' where loginid='$n_loginid'");
|
. "' where loginid='$n_loginid'");
|
||||||
$phpgw->db->unlock();
|
|
||||||
|
|
||||||
|
$phpgw->db->unlock();
|
||||||
Header("Location: " . $phpgw->link("accounts.php", "cd=$cd"));
|
Header("Location: " . $phpgw->link("accounts.php", "cd=$cd"));
|
||||||
exit;
|
exit;
|
||||||
} // if ! $error
|
} // if ! $error
|
||||||
|
@ -43,6 +43,9 @@
|
|||||||
case "edit group": $s = "Edit Group"; break;
|
case "edit group": $s = "Edit Group"; break;
|
||||||
case "submit changes": $s = "Submit Changes"; break;
|
case "submit changes": $s = "Submit Changes"; break;
|
||||||
|
|
||||||
|
case "you must add at least 1 permission to this account":
|
||||||
|
$s = "You must add at least 1 permission to this account"; break;
|
||||||
|
|
||||||
case "installed applications":
|
case "installed applications":
|
||||||
$s = "Installed applications"; break;
|
$s = "Installed applications"; break;
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
if ($n_passwd != $n_passwd_2)
|
if ($n_passwd != $n_passwd_2)
|
||||||
$error .= "<br>" . lang_admin("The two passwords are not the same");
|
$error .= "<br>" . lang_admin("The two passwords are not the same");
|
||||||
|
|
||||||
|
if (count($new_permissions) == 0)
|
||||||
|
$error .= "<br>" . lang_admin("You must add at least 1 permission to this account");
|
||||||
|
|
||||||
$phpgw->db->query("select loginid from accounts where loginid='$n_loginid'");
|
$phpgw->db->query("select loginid from accounts where loginid='$n_loginid'");
|
||||||
$phpgw->db->next_record();
|
$phpgw->db->next_record();
|
||||||
if ($phpgw->db->f("loginid"))
|
if ($phpgw->db->f("loginid"))
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
- on group creation the files directory tried to be created in
|
- on group creation the files directory tried to be created in
|
||||||
"filemanager/groups/" instead of in "files/groups/" - fixed.
|
"filemanager/groups/" instead of in "files/groups/" - fixed.
|
||||||
Same for the user directory.
|
Same for the user directory.
|
||||||
|
- Added error checking for creating/editing an account with no permissions.
|
||||||
|
- Fixed a db->unlock() issue in editaccount.php
|
||||||
|
|
||||||
[08212000] - removed db_lock() and db_unlock() I changed the phpgw_db_* to use them
|
[08212000] - removed db_lock() and db_unlock() I changed the phpgw_db_* to use them
|
||||||
properly
|
properly
|
||||||
|
Loading…
Reference in New Issue
Block a user