Enrolment: Enrol by user profile fields

enrol_attributes
Maintained by Picture of Nicolas Dunand Nicolas Dunand
This plugin allows users to be enrolled according to any value stored in their user profile.
570 sites
490 downloads
39 fans

This plugin allows users to be enrolled according to any value stored in their user profile. If you use an external authentication scheme (LDAP, Shibboleth), you can store values in hidden user fields of the users' Moodle profile, and then use these values to automatically enrol users if some courses.

Screenshots

Screenshot #0

Contributors

Picture of Nicolas Dunand
Nicolas Dunand (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Nicolas Dunand
    Wed, 19 Jul 2017, 2:23 PM
    HI Ray,

    Thanks for reporting this problem. First, can you confirm you have the latest version of this plugin ?

    Then, does this error appear as you're trying to create a new enrolment method ? Or when displaying an existing one ?
  • Picture of ray cheng
    Wed, 19 Jul 2017, 10:13 PM
    Hi Nicolas,

    Thanks for your prompt reply.

    My installed plugin version is 2017050100. And the error appears when displaying an existing one.
  • Picture of Nicolas Dunand
    Thu, 20 Jul 2017, 4:33 PM
    Hi Ray,
    This looks like what would happen is the rule set is completely empty (see "customtext1=" at the beginning of your debugging messages). There should be something there, not just nothing. Have you set up a rule ? If you reload the page with JavaScript turned off, you should see the code (JSON) for the rule, e.g. "{"rules":[{"param":"paramname","value":"somevalue"}]}". is that the case?
  • Picture of Francesco Di Pascasio
    Thu, 27 Jul 2017, 10:04 PM
    Hi Nicolas,

    I've installed your -really very useful, thank you very much indeed!- plugin on Moodle 3.2.1+ (Build: 20170223) and got it working on a development site here at La Sapienza University in Rome.

    Nevertheless at the bottom of the edit page (/enrol/attributes/edit.php?courseid=XYZ&id=ZX) I read:

    customtext1= stdClass Object ( [rules] => Array ( [0] => stdClass Object ( [param] => CODCDL [value] => 14493 ) [1] => stdClass Object ( [param] => CODCDL [value] => 14494 [cond_op] => or ) ) )
    line 112 of /enrol/attributes/edit.php: call to debugging()

    fieldsandrules= Array ( [customuserfields] => Array ( [2] => CODCDL ) [rules] => Array ( [0] => stdClass Object ( [param] => CODCDL [value] => 14493 ) [1] => stdClass Object ( [param] => CODCDL [value] => 14494 [cond_op] => or ) ) )
    line 114 of /enrol/attributes/edit.php: call to debugging()

    arraysql= Array ( [select] => RIGHT JOIN {user_info_data} d1 ON d1.userid = u.id AND d1.fieldid = 2 RIGHT JOIN {user_info_data} d2 ON d2.userid = u.id AND d2.fieldid = 2 [where] => (d1.data = ? OR d1.data LIKE ? COLLATE utf8_bin ESCAPE '\\' OR d1.data LIKE ? COLLATE utf8_bin ESCAPE '\\' OR d1.data LIKE ? COLLATE utf8_bin ESCAPE '\\') OR (d2.data = ? OR d2.data LIKE ? COLLATE utf8_bin ESCAPE '\\' OR d2.data LIKE ? COLLATE utf8_bin ESCAPE '\\' OR d2.data LIKE ? COLLATE utf8_bin ESCAPE '\\') [params] => Array ( [0] => 14493 [1] => %;14493 [2] => 14493;% [3] => %;14493;% [4] => 14494 [5] => %;14494 [6] => 14494;% [7] => %;14494;% ) )
    line 116 of /enrol/attributes/edit.php: call to debugging()

    sqlquery= SELECT DISTINCT u.id FROM {user} u RIGHT JOIN {user_info_data} d1 ON d1.userid = u.id AND d1.fieldid = 2 RIGHT JOIN {user_info_data} d2 ON d2.userid = u.id AND d2.fieldid = 2 WHERE (d1.data = ? OR d1.data LIKE ? COLLATE utf8_bin ESCAPE '\\' OR d1.data LIKE ? COLLATE utf8_bin ESCAPE '\\' OR d1.data LIKE ? COLLATE utf8_bin ESCAPE '\\') OR (d2.data = ? OR d2.data LIKE ? COLLATE utf8_bin ESCAPE '\\' OR d2.data LIKE ? COLLATE utf8_bin ESCAPE '\\' OR d2.data LIKE ? COLLATE utf8_bin ESCAPE '\\')
    line 119 of /enrol/attributes/edit.php: call to debugging()

    countusers= 0
    line 121 of /enrol/attributes/edit.php: call to debugging()

    If I disable Javascript I see in the rule box:

    {"rules":[{"param":"CODCDL","value":"14493"},{"param":"CODCDL","value":"14494","cond_op":"or"}]}

    As I miss the meaning and wonder if it is dangerous, any suggestion is really appreciated.

    Thank you for your time.

    Have a wonderful day.

    Ciao,

    Francesco
  • Picture of Nicolas Dunand
    Thu, 27 Jul 2017, 10:27 PM
    Ciao Francesco and thanks for your concern. This only displays if your site has debugging activated (and on display) OR if you are an administrator.
  • Picture of Francesco Di Pascasio
    Thu, 27 Jul 2017, 10:47 PM
    Ciao Nicolas, so I guess I don't have to worry about it... thanks again and Grazie for your excellent work.
  • Picture of Romel Hernandez
    Sat, 29 Jul 2017, 6:46 PM
    I did all the chances and possibilities to have this plugin fixed on my system. But I never had the result to get this plugin work properly. I did reinstall the Enrolment Plugin on my system, have the other enrolment plugins reviewed, and eventually put this Plugin on the top of the Enrollment Stack.
  • Picture of Oguzhan Ahiskali
    Wed, 9 Aug 2017, 2:33 AM
    I want to teach those who are unequal.

    Please help me!
  • Picture of Sandeep Nehra
    Tue, 15 Aug 2017, 2:03 PM
    We are using Moodle 3.3 and want to use existing profile fields to enroll users like department, team and others instead of custom user fields. How I can do that?
  • Picture of Rolf Petersen
    Sun, 3 Sep 2017, 12:11 AM
    Hello, this sounds to be a usefull Plugin for me. BUT I cannot get that work. Using M3.3 on Win-Server Installation is without failure. I can setup Default-role for example. I Activated this enrolement-Plugin but it does nor show up in enrolement-methods for any cours I have. Have restarted my moodle already with no effect. What may be wrong??? Thanks! Rolf
  • Picture of Daniel Celestino
    Sat, 7 Oct 2017, 12:25 AM
    Hi nicolas,
    I´m testing your plugin and i´m having a problem that I cound not revolve.
    When a user signs up (using no authentication method), i cannot access the course that I have previously configure for the custom field. I have to log off and log on an when I log in again, I can access to the course. If I click "force enrollment" while the user is logging in, refresh the page and it´s works. But, I need that after the user "sign up", the user has access to the course.
    Do you know how to resolve it?
    Thanks!
  • Picture of Francesco Gabenzini
    Fri, 13 Oct 2017, 4:43 PM
    Hi Nicolas,
    I'm Francesco...I've a Moodle 3.1.6...I've installed the plugin version 2.4.2.
    The installation has been successful.
    The problem is that the "Enrol by user profile fields" method does not appear in Enrolment Methods, even if it is enabled between plugins.
    Do you know how to resolve it?
    Thanks!
  • Picture of Nelson Moller
    Fri, 27 Oct 2017, 4:33 AM
    Hi Francesco, we had the same issue and it was corrected by saving the setting in the plugin enrollment configuration. The value was empty in the table mdl_config_plugin even if we saw the correct field in the configuration.
  • Picture of Nicolas Dunand
    Fri, 27 Oct 2017, 4:35 PM
    Hi Nelson,
    How did you solve the issue? did you update the database table manually?
    I would like to fix the plugin but was never able to reproduce the problem.
  • Picture of Renato Araujo
    Mon, 6 Nov 2017, 11:49 PM
    Hi, Nicolas.
    I'm having this issue. The method is still not appearing in the Enrolment Methods of any course.
    However, installation was successful; Moodle is not showing any debug error messages; and the 3 fields in the database are not empty (version, default_roleid and lastcron).
    Should I have anything else in the database (mdl_config_plugins)?
    Thanks.
1 2 3 4 5 6 7 8 9 10 11 12
Please login to post comments