]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-8666, groups import broken
authortoyomoyo <toyomoyo>
Tue, 27 Feb 2007 05:42:15 +0000 (05:42 +0000)
committertoyomoyo <toyomoyo>
Tue, 27 Feb 2007 05:42:15 +0000 (05:42 +0000)
course/import/groups/index.php

index 7e2219fe034273c43d186f403ed7bae7fa0432ca..d66c570488ae0f507841888b002928a7bc1e6ea9 100755 (executable)
                     $newgrpcoursecontext = get_context_instance(CONTEXT_COURSE, $newgroup->courseid);
                     
                     ///Users cannot upload groups in courses they cannot update.
-                    if (has_capability('moodle/course:update', $newgrpcoursecontext)){
+                    if (!has_capability('moodle/course:update', $newgrpcoursecontext)){
                         notify("$newgroup->name ".get_string('notaddedto').$newgroup->coursename.get_string('notinyourcapacity'));
-                    }
-                    
-                    else {
+                    } else {
                         if (get_record("groups","name",$groupname,"courseid",$newgroup->courseid) || !($newgroup->id = insert_record("groups", $newgroup))) {
     
                             //Record not added - probably because group is already registered