takes into account having 0 apps enabled for the group

This commit is contained in:
skeeter 2001-02-10 19:54:32 +00:00
parent cf3564035a
commit 49d927b96a

View File

@ -49,6 +49,9 @@
$apps = CreateObject('phpgwapi.applications',intval($group_id));
$apps_before = $apps->read_account_specific();
$apps->update_data(Array());
$new_apps = Array();
if(isset($n_group_permissions)) {
reset($n_group_permissions);
while($app = each($n_group_permissions)) {
if($app[1]) {
$apps->add($app[0]);
@ -57,6 +60,7 @@
}
}
}
}
$apps->save_repository();
if($old_group_name <> $n_group) {
@ -75,15 +79,16 @@
$acl->add_repository('phpgw_group',$group_id,$n_users[$i],1);
// If the user is logged in, it will force a refresh of the session_info
$phpgw->db->query("update phpgw_sessions set session_info='' "
$phpgw->db->query("update phpgw_sessions set session_action='' "
."where session_lid='" . $phpgw->accounts->id2name(intval($n_users[$i])) . "@" . $phpgw_info["user"]["domain"] . "'",__LINE__,__FILE__);
// The following sets any default preferences needed for new applications..
// This is smart enough to know if previous preferences were selected, use them.
$docommit = False;
if($new_apps) {
$pref = CreateObject('phpgwapi.preferences',intval($n_users[$i]));
$t = $pref->read_repository();
$docommit = False;
for ($j=1;$j<count($new_apps) - 1;$j++) {
if($new_apps[$j]=='admin') {
$check = 'common';
@ -95,6 +100,7 @@
$docommit = True;
}
}
}
if ($docommit) {
$pref->save_repository();
}