Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-4057

User newer can enrol themselves in metacourse!

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: None
    • Component/s: Enrolments
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_15_STABLE

      Description

      Index: course/enrol.php

      ===================================================================

      RCS file: /cvsroot/moodle/moodle/course/enrol.php,v

      retrieving revision 1.32

      diff -u -r1.32 enrol.php

      — course/enrol.php 16 May 2005 19:36:51 -0000 1.32

      +++ course/enrol.php 11 Sep 2005 18:10:36 -0000

      @@ -19,9 +19,14 @@

      error(Could not find a site!);

      }

      + // User newer can enrol themselves in metacourse! (dlnsk)

      + if ($course->metacourse)

      { + error('Only teacher can enrol you in this course!'); // will should be add to language file + }

      +

      check_for_restricted_user($USER->username);

      • $enrol = new enrolment_plugin();

      + $enrol = new enrolment_plugin();

      /// Refreshing enrolment data in the USER session

      $enrol->get_student_courses($USER);

        Gliffy Diagrams

          Activity

          Hide
          dougiamas Martin Dougiamas added a comment -

          From Dmitry Pupinin (dlnsk at nspu.ru) Monday, 12 September 2005, 07:02 PM:

          ...and unenrol manualy!

          Index: blocks/admin/block_admin.php

          ===================================================================

          RCS file: /cvsroot/moodle/moodle/blocks/admin/block_admin.php,v

          retrieving revision 1.28.2.1

          diff -u -r1.28.2.1 block_admin.php

          — blocks/admin/block_admin.php 24 May 2005 16:55:37 -0000 1.28.2.1

          +++ blocks/admin/block_admin.php 1 Sep 2005 18:35:33 -0000

          @@ -189,7 +189,7 @@

          $this->content->items[]='<a href='.$CFG->changepassword.'>'.get_string('changepassword').'</a>';

          $this->content->icons[]='<img src='.$CFG->pixpath.'/i/user.gif height=16 width=16 alt= />';

          }

          • if ($CFG->allowunenroll) {

          + if ($CFG->allowunenroll and !$course->metacourse)

          { // user can't unenrol manualy from meta-course $this->content->items[]='<a href=unenrol.php?id='.$this->instance->pageid.'>'.get_string('unenrolme', '', $course->shortname).'</a>'; $this->content->icons[]='<img src='.$CFG->pixpath.'/i/user.gif height=16 width=16 alt= />'; }

          From Dmitry Pupinin (dlnsk at nspu.ru) Thursday, 6 October 2005, 02:41 PM:

          And one else...

          Index: course/unenrol.php

          ===================================================================

          RCS file: /cvsroot/moodle/moodle/course/unenrol.php,v

          retrieving revision 1.18

          diff -u -r1.18 unenrol.php

          — course/unenrol.php 17 Mar 2005 15:12:01 -0000 1.18

          +++ course/unenrol.php 6 Oct 2005 06:32:19 -0000

          @@ -24,6 +24,10 @@

          error(You must be a teacher with editing rights to do this);

          }

          + if ($course->metacourse)

          { + error(You can't unenrol one student from metacourse. Only full group!); + }

          +

          if ($user->id == $USER->id and !$CFG->allowunenroll)

          { error(You are not allowed to unenroll); }

          From Dmitry Pupinin (dlnsk at nspu.ru) Wednesday, 2 November 2005, 08:39 PM:

          ...but teacher should to be able add students in his course.

          Index: course/importstudents.php

          ===================================================================

          RCS file: /cvsroot/moodle/moodle/course/importstudents.php,v

          retrieving revision 1.10

          diff -u -r1.10 importstudents.php

          — course/importstudents.php 16 May 2005 19:36:51 -0000 1.10

          +++ course/importstudents.php 2 Nov 2005 12:37:15 -0000

          @@ -27,11 +27,10 @@

          redirect($CFG->wwwroot/course/student.php?id=$course->id);

          }

          • if (!isadmin()) {
          • error(You must be an admin);

          + if (!isteacheredit($course->id))

          { + error(You need to be a teacher or an admin to use this page); }

          -

          $strassigncourses = get_string('metaassigncourses');

          $stralreadycourses = get_string('metaalreadycourses');

          $strnoalreadycourses = get_string('metanoalreadycourses');

          From Patrick Li (patrick at catalyst.net.nz) Wednesday, 16 November 2005, 05:55 AM:

          Thank you for your patch. They are subimted into moodle CVS.

          Show
          dougiamas Martin Dougiamas added a comment - From Dmitry Pupinin (dlnsk at nspu.ru) Monday, 12 September 2005, 07:02 PM: ...and unenrol manualy! Index: blocks/admin/block_admin.php =================================================================== RCS file: /cvsroot/moodle/moodle/blocks/admin/block_admin.php,v retrieving revision 1.28.2.1 diff -u -r1.28.2.1 block_admin.php — blocks/admin/block_admin.php 24 May 2005 16:55:37 -0000 1.28.2.1 +++ blocks/admin/block_admin.php 1 Sep 2005 18:35:33 -0000 @@ -189,7 +189,7 @@ $this->content->items[]='<a href='.$CFG->changepassword.'>'.get_string('changepassword').'</a>'; $this->content->icons[]='<img src='.$CFG->pixpath.'/i/user.gif height=16 width=16 alt= />'; } if ($CFG->allowunenroll) { + if ($CFG->allowunenroll and !$course->metacourse) { // user can't unenrol manualy from meta-course $this->content->items[]='<a href=unenrol.php?id='.$this->instance->pageid.'>'.get_string('unenrolme', '', $course->shortname).'</a>'; $this->content->icons[]='<img src='.$CFG->pixpath.'/i/user.gif height=16 width=16 alt= />'; } From Dmitry Pupinin (dlnsk at nspu.ru) Thursday, 6 October 2005, 02:41 PM: And one else... Index: course/unenrol.php =================================================================== RCS file: /cvsroot/moodle/moodle/course/unenrol.php,v retrieving revision 1.18 diff -u -r1.18 unenrol.php — course/unenrol.php 17 Mar 2005 15:12:01 -0000 1.18 +++ course/unenrol.php 6 Oct 2005 06:32:19 -0000 @@ -24,6 +24,10 @@ error(You must be a teacher with editing rights to do this); } + if ($course->metacourse) { + error(You can't unenrol one student from metacourse. Only full group!); + } + if ($user->id == $USER->id and !$CFG->allowunenroll) { error(You are not allowed to unenroll); } From Dmitry Pupinin (dlnsk at nspu.ru) Wednesday, 2 November 2005, 08:39 PM: ...but teacher should to be able add students in his course. Index: course/importstudents.php =================================================================== RCS file: /cvsroot/moodle/moodle/course/importstudents.php,v retrieving revision 1.10 diff -u -r1.10 importstudents.php — course/importstudents.php 16 May 2005 19:36:51 -0000 1.10 +++ course/importstudents.php 2 Nov 2005 12:37:15 -0000 @@ -27,11 +27,10 @@ redirect($CFG->wwwroot/course/student.php?id=$course->id); } if (!isadmin()) { error(You must be an admin); + if (!isteacheredit($course->id)) { + error(You need to be a teacher or an admin to use this page); } - $strassigncourses = get_string('metaassigncourses'); $stralreadycourses = get_string('metaalreadycourses'); $strnoalreadycourses = get_string('metanoalreadycourses'); From Patrick Li (patrick at catalyst.net.nz) Wednesday, 16 November 2005, 05:55 AM: Thank you for your patch. They are subimted into moodle CVS.
          Hide
          mblake Michael Blake added a comment -

          assign to a valid user

          Show
          mblake Michael Blake added a comment - assign to a valid user

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: