Fixed a problem with user not being added to the groups properly and the directorys wheren't being deleted

This commit is contained in:
jengo 2000-08-19 02:32:35 +00:00
parent e39c2e8843
commit 34b5e461ae
2 changed files with 8 additions and 5 deletions

View File

@ -73,8 +73,8 @@
$sep = $phpgw->common->filesystem_sepeartor(); $sep = $phpgw->common->filesystem_sepeartor();
$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep . "users" $basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep
. $sep; . "groups" . $sep;
if (! @rmdir($basedir . $group_name)) { if (! @rmdir($basedir . $group_name)) {
$cd = 38; $cd = 38;

View File

@ -27,17 +27,20 @@
} }
if (! $error) { if (! $error) {
$phpgw->db->lock(array("accounts","groups")); //$phpgw->db->lock(array("accounts","groups"));
$phpgw->db->query("INSERT INTO groups (group_name,group_apps) VALUES " $phpgw->db->query("INSERT INTO groups (group_name,group_apps) VALUES "
. "('$n_group','" . "('$n_group','"
. $phpgw->groups->array_to_string("none",$n_group_permissions) . "') "); . $phpgw->groups->array_to_string("none",$n_group_permissions) . "') ");
$phpgw->db->query("SELECT group_id FROM groups WHERE group_name='$n_group'"); $phpgw->db->query("SELECT group_id FROM groups WHERE group_name='$n_group'");
$groups_con = $phpgw->db->f("group_id"); $phpgw->db->next_record();
$group_con = $phpgw->db->f("group_id");
for ($i=0; $i<count($n_users);$i++) { for ($i=0; $i<count($n_users);$i++) {
$phpgw->db->query("SELECT groups FROM accounts WHERE con=".$n_users[$i]); $phpgw->db->query("SELECT groups FROM accounts WHERE con=".$n_users[$i]);
$phpgw->db->next_record();
$user_groups = $phpgw->db->f("groups") . ",$group_con,"; $user_groups = $phpgw->db->f("groups") . ",$group_con,";
$user_groups = ereg_replace(",,",",",$user_groups); $user_groups = ereg_replace(",,",",",$user_groups);
$phpgw->db->query("UPDATE accounts SET groups='$user_groups' WHERE con=" $phpgw->db->query("UPDATE accounts SET groups='$user_groups' WHERE con="
. $n_users[$i]); . $n_users[$i]);
@ -52,7 +55,7 @@
if (! mkdir ($basedir . $n_group, 0707)) $cd = 37; if (! mkdir ($basedir . $n_group, 0707)) $cd = 37;
$phpgw->db->unlock(); //$phpgw->db->unlock();
Header("Location: " . $phpgw->link("groups.php","cd=$cd")); Header("Location: " . $phpgw->link("groups.php","cd=$cd"));
exit; exit;