fix for preferences

This commit is contained in:
skeeter 2001-01-10 05:01:56 +00:00
parent 8ee04f6ca4
commit 124c09cf2d
4 changed files with 16 additions and 17 deletions

View File

@ -93,15 +93,15 @@
$t = $pref->get_preferences(); $t = $pref->get_preferences();
$docommit = False; $docommit = False;
$after_apps = explode(':',$apps_after);
while(list($key,$value) = each($phpgw_info["user"]["app_perms"])) { for($i=1;$i<count($after_apps) - 1;$i++) {
if($value=="admin") { if($after_apps[$i]=="admin") {
$check = "common"; $check = "common";
} else { } else {
$check = $value; $check = $after_apps[$i];
} }
if (!count($t["$check"])) { if (!$t["$check"]) {
$phpgw->common->hook_single("add_def_pref", $value); $phpgw->common->hook_single("add_def_pref", $after_apps[$i]);
$docommit = True; $docommit = True;
} }
} }

View File

@ -66,12 +66,12 @@
$t = $pref->get_preferences(); $t = $pref->get_preferences();
$docommit = False; $docommit = False;
for ($j=1;$j<=count($apps_after);$j++) { for ($j=1;$j<count($apps_after) - 1;$j++) {
if($apps_after[$j]=="admin") if($apps_after[$j]=="admin")
$check = "common"; $check = "common";
else else
$check = $apps_after[$j]; $check = $apps_after[$j];
if (!count($t["$check"])) { if (!$t["$check"]) {
$phpgw->common->hook_single("add_def_pref", $apps_after[$j]); $phpgw->common->hook_single("add_def_pref", $apps_after[$j]);
$docommit = True; $docommit = True;
} }

View File

@ -69,8 +69,8 @@
$pref = new preferences(intval($phpgw->db->f("account_id"))); $pref = new preferences(intval($phpgw->db->f("account_id")));
$phpgw->common->hook_single("add_def_pref", "admin"); $phpgw->common->hook_single("add_def_pref", "admin");
for ($i=1;$i<sizeof($apps) - 1;$i++) { for ($i=1;$i<sizeof($apps) - 1;$i++) {
if($apps[$i]<>"admin") if($apps[$i]<>"admin")
$phpgw->common->hook_single("add_def_pref", $apps[$i]); $phpgw->common->hook_single("add_def_pref", $apps[$i]);
} }
$pref->commit(); $pref->commit();

View File

@ -43,14 +43,13 @@
$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'");
$phpgw->db->next_record(); $phpgw->db->next_record();
$group_con = $phpgw->db->f("group_id"); $group_con = $phpgw->db->f("group_id");
$after_apps = explode(":",$apps); $after_apps = explode(":",$apps);
for ($i=1;$i<=count($after_apps);$i++) { for ($i=1;$i<count($after_apps) - 1;$i++) {
$new_apps[] = $after_apps[$i]; $new_apps[] = $after_apps[$i];
} }
for ($i=0; $i<count($n_users);$i++) { for ($i=0; $i<count($n_users);$i++) {
$phpgw->db->query("SELECT account_groups FROM accounts WHERE account_id=".$n_users[$i]); $phpgw->db->query("SELECT account_groups FROM accounts WHERE account_id=".$n_users[$i]);
$phpgw->db->next_record(); $phpgw->db->next_record();
$user_groups = $phpgw->db->f("account_groups") . ",$group_con:0,"; $user_groups = $phpgw->db->f("account_groups") . ",$group_con:0,";
$user_groups = ereg_replace(",,",",",$user_groups); $user_groups = ereg_replace(",,",",",$user_groups);
@ -65,7 +64,7 @@
$check = "common"; $check = "common";
else else
$check = $new_apps[$j]; $check = $new_apps[$j];
if (!count($t["$check"])) { if (!$t["$check"]) {
$phpgw->common->hook_single("add_def_pref", $new_apps[$j]); $phpgw->common->hook_single("add_def_pref", $new_apps[$j]);
$docommit = True; $docommit = True;
} }