]> git.mjollnir.org Git - moodle.git/commitdiff
fixing wrong capability check
authortoyomoyo <toyomoyo>
Tue, 27 Feb 2007 05:48:05 +0000 (05:48 +0000)
committertoyomoyo <toyomoyo>
Tue, 27 Feb 2007 05:48:05 +0000 (05:48 +0000)
course/import/groups/index.php

index d66c570488ae0f507841888b002928a7bc1e6ea9..3d32f2445e81d45555e5a5e8c2e52b5116a2b7b4 100755 (executable)
                 //if courseid is set
                 if (isset($newgroup->courseid)){
                                                             
-                       $newgroup->timecreated = time();
+                    $newgroup->timecreated = time();
                     $linenum++;
                     $groupname = $newgroup->name;
                     $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:managegroups', $newgrpcoursecontext)){
                         notify("$newgroup->name ".get_string('notaddedto').$newgroup->coursename.get_string('notinyourcapacity'));
                     } else {
                         if (get_record("groups","name",$groupname,"courseid",$newgroup->courseid) || !($newgroup->id = insert_record("groups", $newgroup))) {