Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.0
    • Component/s: Enrolments
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      This is one of the simplest plugins, it should be very easy to upgrade it...

        Gliffy Diagrams

        1. flatfile_plugin_20100709.patch
          35 kB
          Eugene Venter
        2. flatfile_plugin_20100712.patch
          34 kB
          Eugene Venter

          Activity

          Hide
          dougiamas Martin Dougiamas added a comment -

          Hi Aaron! This one should be pretty straightforward.

          This module lets the user specify a "flatfile" (CSV) containing enrolment information. On a regular cron cycle, the file is parsed and then deleted. The expectation is that some external process will be regularly dumping updates in this location.

          Look at enrol/database for a good example of the required structure, and the old enrol/flatfile for the logic.

          Note these rules for plugin file names:

          lib.php - the main class (interface)
          locallib.php - any local internal functions never to be used outside of your module
          settings.php - all the settings, to appear in the admin menus in the settings block

          Show
          dougiamas Martin Dougiamas added a comment - Hi Aaron! This one should be pretty straightforward. This module lets the user specify a "flatfile" (CSV) containing enrolment information. On a regular cron cycle, the file is parsed and then deleted. The expectation is that some external process will be regularly dumping updates in this location. Look at enrol/database for a good example of the required structure, and the old enrol/flatfile for the logic. Note these rules for plugin file names: lib.php - the main class (interface) locallib.php - any local internal functions never to be used outside of your module settings.php - all the settings, to appear in the admin menus in the settings block
          Hide
          binare Eugene Venter added a comment -

          Hi Petr,

          I am Eugene and I am helping Aaron out on this.

          I think I have finished the necessary changes for the flatfile plugin upgrade; I just need someone to review what I've done, just to make sure that I am on the right track and that I am doing the enrollments right, etc.
          So, please see the attached patchfile and let me know if and where I am going/doing wrong.

          Thanks!

          Show
          binare Eugene Venter added a comment - Hi Petr, I am Eugene and I am helping Aaron out on this. I think I have finished the necessary changes for the flatfile plugin upgrade; I just need someone to review what I've done, just to make sure that I am on the right track and that I am doing the enrollments right, etc. So, please see the attached patchfile and let me know if and where I am going/doing wrong. Thanks!
          Hide
          binare Eugene Venter added a comment -

          a patch for the flatfile plugin upgrade to 2.0

          Show
          binare Eugene Venter added a comment - a patch for the flatfile plugin upgrade to 2.0
          Hide
          skodak Petr Skoda added a comment -

          1/ you forgot to change the copyright :-D
          2/ unenrol_user() instance check is mandatory - it detects dev bugs and enforces good coding style
          3/ $filename = "$CFG->dataroot/1/enrolments.txt"; - hmm, was this always in a public area? If yes, the we should fix it as a security bug in 1.9 and skip migration of this file to new file storage
          4/ unenrolment from all instances is very wrong, you must not touch enrolments of other plugins - never, just your own; alternatively you could "abuse" manual enrolment plugin and let it do the enrolment/unenrolment work
          5/ $roles = $DB->get_records('role', null, '', 'id, name, shortname'); in settings can be used only if roles already set-up

          ciao and thanks

          Show
          skodak Petr Skoda added a comment - 1/ you forgot to change the copyright :-D 2/ unenrol_user() instance check is mandatory - it detects dev bugs and enforces good coding style 3/ $filename = "$CFG->dataroot/1/enrolments.txt"; - hmm, was this always in a public area? If yes, the we should fix it as a security bug in 1.9 and skip migration of this file to new file storage 4/ unenrolment from all instances is very wrong, you must not touch enrolments of other plugins - never, just your own; alternatively you could "abuse" manual enrolment plugin and let it do the enrolment/unenrolment work 5/ $roles = $DB->get_records('role', null, '', 'id, name, shortname'); in settings can be used only if roles already set-up ciao and thanks
          Hide
          skodak Petr Skoda added a comment -

          hmm, you could unenrol from enrol instances that allow manual unenrolment (enrol/manual, enrol/self); the enrolment should be definitely done via enrol/flatfile or enrol/manual

          if you unenrol from or ldap, database the enrolment gets back immediately and you loose some user data (grades, groups, etc.)

          Show
          skodak Petr Skoda added a comment - hmm, you could unenrol from enrol instances that allow manual unenrolment (enrol/manual, enrol/self); the enrolment should be definitely done via enrol/flatfile or enrol/manual if you unenrol from or ldap, database the enrolment gets back immediately and you loose some user data (grades, groups, etc.)
          Hide
          binare Eugene Venter added a comment -

          Hi Petr,

          Thanks for your feedback, I have made changes accordingly . In response to point 3, yes, the default file location was like this. I just left this for now.

          I have attached a new patch for you to have a look at.

          hope this helps and thanks again!

          Show
          binare Eugene Venter added a comment - Hi Petr, Thanks for your feedback, I have made changes accordingly . In response to point 3, yes, the default file location was like this. I just left this for now. I have attached a new patch for you to have a look at. hope this helps and thanks again!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10