Assign Roles to user in Manual accounts Register

Assign Roles to user in Manual accounts Register

by محمدحامد مهدیان -
Number of replies: 1

hello

I want do a work when a register user in http://mood/user/editadvanced.php?id=-1 

i coud Assign a role to user.

and iwant to delete E-mail feild in http://mood/user/editadvanced.php?id=-1 .please help me 

my english is veri bad.

tnx

Average of ratings: -
In reply to محمدحامد مهدیان

Re: Assign Roles to user in Manual accounts Register

by John White -
Hi,

Changing the code in editadvanced.php to try to enrol a new user in courses while id==-1 would give trouble, because if id = -1 you do not have a user id to put into the enrolment!

Getting rid of the email field will also give trouble.

But if you want more than one student to be allowed use the same email address, you might edit both files:
user/edit_form.php,
...to changed...
$errors['email'] = get_string('emailexists');
...to read...
// $errors['email'] = get_string('emailexists');

and,
user/editadvanced_form.php
...to changed...
$err['email'] = get_string('emailexists');
...to read...
// $err['email'] = get_string('emailexists');

...so that no action is taken when two email addresses are the same.

Regards,

John