What on earth are restricted users?

What on earth are restricted users?

Tim Hunt གིས-
Number of replies: 8
Core developers གི་པར Documentation writers གི་པར Particularly helpful Moodlers གི་པར Peer reviewers གི་པར Plugin developers གི་པར
Actually, I have worked it out on my own: They are a bit of a hack.

See this comment in config-dist.php:

 
// Restrict certain usernames from doing things that may mess up a site
// This is especially useful for demonstration teacher accounts
// $CFG->restrictusers = 'teacher,fred,jim';


and the functions check_for_restricted_user() and is_restricted_user() in moodlelib.php.

Can this nastiness be removed as part of the roles and permissions work?

There are only two calls to is_restricted_user, and 11 calls to check_for_restricted_user in the codebase,
དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།: -
In reply to Tim Hunt

Re: What on earth are restricted users?

Martin Dougiamas གིས-
Core developers གི་པར Documentation writers གི་པར Moodle HQ གི་པར Particularly helpful Moodlers གི་པར Plugin developers གི་པར Testers གི་པར
It's now ancient history and gone from HEAD.

It was an old hack primarily for sites like moodle.org that used to have demo teacher accounts. Of course all that is now possible using Roles.
In reply to Martin Dougiamas

Re: What on earth are restricted users?

J. Chan གིས-

Hello everyone,

The restricted users at my site are first configured to disable their access to change passwords. (following the advice from http://moodle.org/mod/forum/discuss.php?d=10973#176076 )

However, I found out that courses (eg. Course A) that do not need a password to enrol refuse to accept the "restricted users" to enter. Moreover, even I gave the "restricted users" the enrollment keys to some other courses (e.g. Course B), the restricted users are not given a screen to key in password or "key". They are simply refused. I double check the situation by removing one student from the restricted user list, and he could then successfully enrol in Courses A and B.

The problem is : all the students at my site are "restricted users". They are NOT allowed to change their passwords. It's our policy. But this year, when we try not to enrol students manually (as such we did in the past) and let them enrol in some selective courses, all of them failed to do so.

Any ideas ?

James

In reply to Martin Dougiamas

Re: What on earth are restricted users?

Samuli Karevaara གིས-
"Of course all that is now possible using Roles"

For anyone finding this out the same way I did (the hard way): in 1.7 and 1.8 the restricted users config setting has been removed, but the roles implementation does not make it possible to simulate that. It looks like 1.9 is good for that.

But a small grunt: the setting should have been removed only after the roles implementation simulates it...
In reply to Samuli Karevaara

Re: What on earth are restricted users?

Martin Dougiamas གིས-
Core developers གི་པར Documentation writers གི་པར Moodle HQ གི་པར Particularly helpful Moodlers གི་པར Plugin developers གི་པར Testers གི་པར
Sorry ... can you be more specific? What wasn't possible in 1.7?
In reply to Martin Dougiamas

Re: What on earth are restricted users?

Séverin TERRIER གིས-
Documentation writers གི་པར Particularly helpful Moodlers གི་པར Testers གི་པར Translators གི་པར
Reading that, i mainly think at the capability moodle/user:editownprofile, available since Moodle 1.9.

Séverin
In reply to Séverin TERRIER

Re: What on earth are restricted users?

Martin Dougiamas གིས-
Core developers གི་པར Documentation writers གི་པར Moodle HQ གི་པར Particularly helpful Moodlers གི་པར Plugin developers གི་པར Testers གི་པར
Ah, yes, a bug. I remember wrongly assuming moodle/user:editprofile would be able to do the job.
In reply to Martin Dougiamas

Re: What on earth are restricted users?

Samuli Karevaara གིས-
Also, I made a silly mistake of not noticing that the bug about this that was fixed almost a year ago (last April) was marked fixed for 1.9 only. No biggie, but we did have a creative use of the demo account profile information by a prankster surprise Now we locked a bit more than was necessary and are waiting for the upgrade to 1.9 དགའ་འཛུམ་