forked from extern/egroupware
possible fix for warnings for preferences
This commit is contained in:
parent
71a0a698c9
commit
8c49050e33
@ -26,17 +26,17 @@
|
|||||||
$phpgw->db->next_record();
|
$phpgw->db->next_record();
|
||||||
|
|
||||||
if ($phpgw->db->f(0) != 0) {
|
if ($phpgw->db->f(0) != 0) {
|
||||||
$error = "<br>" . lang("Sorry, that group name has already been taking.");
|
$error = "<br>" . lang("Sorry, that group name has already been taken.");
|
||||||
}
|
}
|
||||||
if (! $n_group) {
|
if (! $n_group) {
|
||||||
$error = "<br>" . lang("You must enter a group name.");
|
$error = "<br>" . lang("You must enter a group name.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$phpgw->db->lock(array("accounts","groups"));
|
$phpgw->db->lock(array("accounts","groups","preferences"));
|
||||||
|
|
||||||
$phpgw->accounts->add_app($n_group_permissions);
|
$phpgw->accounts->add_app($n_group_permissions);
|
||||||
$apps = $phpgw->accounts->add_app("",True);
|
$apps = $phpgw->accounts->add_app("",True);
|
||||||
$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','"
|
||||||
. $apps . "')");
|
. $apps . "')");
|
||||||
@ -48,30 +48,31 @@
|
|||||||
$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);
|
||||||
$phpgw->db->query("UPDATE accounts SET account_groups='$user_groups' WHERE account_id=".$n_users[$i]);
|
$phpgw->db->query("UPDATE accounts SET account_groups='$user_groups' WHERE account_id=".$n_users[$i]);
|
||||||
|
|
||||||
$pref = CreateObject('phpgwapi.preferences',intval($n_users[$i]));
|
$pref = CreateObject('phpgwapi.preferences',intval($n_users[$i]));
|
||||||
$t = $pref->get_preferences();
|
$t = $pref->get_preferences();
|
||||||
|
|
||||||
$docommit = False;
|
$docommit = False;
|
||||||
for ($j=0;$j<count($new_apps);$j++) {
|
for ($j=0;$j<count($new_apps);$j++) {
|
||||||
if($new_apps[$j]=="admin")
|
if($new_apps[$j]=="admin") {
|
||||||
$check = "common";
|
$check = "common";
|
||||||
else
|
} else {
|
||||||
$check = $new_apps[$j];
|
$check = $new_apps[$j];
|
||||||
if (!$t["$check"]) {
|
}
|
||||||
$phpgw->common->hook_single("add_def_pref", $new_apps[$j]);
|
if (!$t["$check"]) {
|
||||||
$docommit = True;
|
$phpgw->common->hook_single("add_def_pref", $new_apps[$j]);
|
||||||
}
|
$docommit = True;
|
||||||
}
|
}
|
||||||
if ($docommit) {
|
}
|
||||||
$pref->commit();
|
if ($docommit) {
|
||||||
}
|
$pref->commit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sep = $phpgw->common->filesystem_separator();
|
$sep = $phpgw->common->filesystem_separator();
|
||||||
|
Loading…
Reference in New Issue
Block a user