SAML system role enrolment

Re: SAML system role enrolment

by Franco Pantoja -
Number of replies: 0
Picture of Particularly helpful Moodlers
Hi

We could do it using the hook in the plugin

function saml_hook_post_user_created($user, $saml_attributes = []) {

$inspector = $saml_attributes[esPAS][0];  //  from saml
if ($inspector == '1') {    //  is user inspector
$context = context_system::instance();
$userid = $user->id;
$roleid = 1;  
  role_assign($roleid, $userid, $context->id);

}
}

But when we upload to PRE we find
simpleSAMLphp lib loader file does not exist: /var/www/html/idp/lib/_autoload.php


Any idea?

Thanks very much