What on earth are restricted users?

What on earth are restricted users?

Tim Hunt -
回帖数: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,
回复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.
回复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

回复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...
回复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?
回复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
回复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.
回复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 微笑