Assigned user and permissions

Assigned user and permissions

by Lavanya Manne -
Number of replies: 1
Picture of Plugin developers

Trying to assign a role when user is confirmed. On testing, user is successfully assigned to a role. When I login as that user, I could see administrator homepage. 

If not wrong, I guess there is no role for frontpage assigned, in moodle.

$context = context_system::instance();
if ($DB->record_exists("user", array('id' => $USER->id, 'confirmed' => '1' ))) {
      role_assign($roleid, $USER->id, $context->id); 

Appreciate your suggestions!

Average of ratings: -
In reply to Lavanya Manne

Re: Assigned user and permissions

by Lavanya Manne -
Picture of Plugin developers
The discussion was closed. The key answer is required to make the front page settings for the assigned role user.