Permalink
Browse files

Now group members are only included (backup and restore) if

we have selected to have users! Thanks to Etienne! Bug 2486
(http://moodle.org/bugs/bug.php?op=show&bugid=2486)
  • Loading branch information...
1 parent 80bdfe8 commit 20caf128b91628f94155c9f3d7de4bab5fbdb876 stronk7 committed Feb 4, 2005
Showing with 9 additions and 4 deletions.
  1. +4 −2 backup/backuplib.php
  2. +5 −2 backup/restorelib.php
View
@@ -1066,8 +1066,10 @@ function backup_groups_info($bf,$preferences) {
fwrite ($bf,full_tag("TIMECREATED",4,false,$group->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$group->timemodified));
- //Now, backup groups_members
- $status2 = backup_groups_members_info($bf,$preferences,$group->id);
+ //Now, backup groups_members, only if users are included
+ if ($preferences->backup_users != 2) {
+ $status2 = backup_groups_members_info($bf,$preferences,$group->id);
+ }
//End group tag
fwrite ($bf,end_tag("GROUP",3,true));
View
@@ -1111,8 +1111,11 @@ function restore_create_groups($restore,$xml_file) {
backup_putid($restore->backup_unique_code,"group",
$group->id, $newid);
}
- //Now restore members in the groups_members
- $status2 = restore_create_groups_members($newid,$info,$restore);
+ //Now restore members in the groups_members, only if
+ //users are included
+ if ($restore->users != 2) {
+ $status2 = restore_create_groups_members($newid,$info,$restore);
+ }
}
}
}

0 comments on commit 20caf12

Please sign in to comment.