Uploaded image for project: 'Moodle QA'
  1. Moodle QA
  2. MDLQA-17933 Moodle 4.3 QA
  3. MDLQA-18266

CLONE - A PDO-compatible DB server may be used for external DB authentication and enrolment

XMLWordPrintable

      Pre-requisite: PDO-compatible DB server; PHP compiled with a PDO DB extension

      1. Go to Authentication / Manage authentication and enable External Database authentication
      2. Set the following value for the following fields:
        1. Host : pgsql:host=localhost;port=5432;dbname=externaldb
        2. Database: pdo
        3. User/Password: to your user / password for postgres connexion
        4. Table: authtable
        5. Username field: username
        6. Password field: password
        7. Data mapping (First name) : firstname
        8. Data mapping (Surname) : lastname
      3. Go to the Manage enrol plugins page and enable  External database enrolment:
      4. Set the following value for the following fields:
        1. Database driver: pdo
        2. Database host: pgsql:host=localhost;port=5432;dbname=externaldb
        3. User/Password: to your user / password for postgres connexion
        4. Local course field: idnumber
        5. Local user field: username
        6. Local role field: shortname
        7. Local category field: id
        8. Remote user enrolment table: enroltable
        9. Remote course field: courseid
        10. Remote user field: userid
        11. Remote role field: role
        12. Remote new courses table: coursetable
        13. New course full name field: fullname
        14. New course short name field: shortname
        15. New course ID number field: idnumber
      • Setup a course with:
        • MDLQA-XXXX as Course ID number
        • Ensure you can log in with "myuser" as username and "pw" as password. 

      External database example attached to this (you will need to change the MDLQA-XXX reference in the data).

      Test steps:

      • Run the cron or  
        php admin/cli/scheduled_task.php --execute='\enrol_database\task\sync_enrolments'

       

      • Check the logs of the cron to see if the user has been enroled and new course created

      Check that:

      • A new user  called "myuser" has been created
      • A new course called MDLQA-17174-autocreate has been created
      • That the user myuser is enrolled into the MDLQA-17174 course

        1. MDLQA-17174.sql
          4 kB
        2. qa18266_auth_enrolment.png
          qa18266_auth_enrolment.png
          503 kB
        3. qa18266_auth_externaldb.png
          qa18266_auth_externaldb.png
          521 kB
        4. qa18266_courses.png
          qa18266_courses.png
          29 kB
        5. qa18266_cron_datasync.png
          qa18266_cron_datasync.png
          41 kB
        6. qa18266_external_db_tables.png
          qa18266_external_db_tables.png
          25 kB
        7. qa18266_user_enrolled.png
          qa18266_user_enrolled.png
          45 kB

            meirza.arson@moodle.com Meirza
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.