@@ -23,7 +23,7 @@ function simplesamlphp_auth_install() {
$user_settings->set('register','admin_only');
$user_settings->save();
// Inform the user about disabling the open registration.
drupal_set_message(t('The SimpleSAMLphp Authentication module disabled the user registration. You can manually enable it again in the <a href=":user_settings_url">Account settings</a>.',[
\Drupal::messenger()->addMessage(t('The SimpleSAMLphp Authentication module disabled the user registration. You can manually enable it again in the <a href=":user_settings_url">Account settings</a>.',[
@@ -64,7 +64,7 @@ function simplesamlphp_auth_requirements($phase) {
'severity'=>REQUIREMENT_INFO,
'title'=>'simpleSAMLphp_auth',
'value'=>t('SimpleSAMLphp authentication is NOT activated'),
'description'=>t('It can be activated on the <a href=":config_page">configuration page</a>.',[':config_page'=>\Drupal::url('simplesamlphp_auth.admin_settings')]),
'description'=>t('It can be activated on the <a href=":config_page">configuration page</a>.',[':config_page'=>Url::fromRoute('simplesamlphp_auth.admin_settings')->toString()]),
@@ -127,7 +152,8 @@ class SimplesamlphpDrupalAuth {
// We're not allowed to register new users on the site through simpleSAML.
// We let the user know about this and redirect to the user/login page.
drupal_set_message(t("We are sorry. While you have successfully authenticated, you are not yet entitled to access this site. Please ask the site administrator to provision access for you."));
$this->messenger
->addMessage($this->t('We are sorry. While you have successfully authenticated, you are not yet entitled to access this site. Please ask the site administrator to provision access for you.'),'status');
$this->simplesamlAuth->logout(base_path());
returnFALSE;
@@ -157,7 +183,8 @@ class SimplesamlphpDrupalAuth {
}
// User is not permitted to login to Drupal via SAML.
// Log out of SAML and redirect to the front page.
drupal_set_message(t('We are sorry, your user account is not SAML enabled.'));
$this->messenger
->addMessage($this->t('We are sorry, your user account is not SAML enabled.'),'status');
$this->simplesamlAuth->logout(base_path());
returnFALSE;
}
@@ -169,8 +196,8 @@ class SimplesamlphpDrupalAuth {
// Allow other modules to decide if there is an existing Drupal user,
$this->logger->critical("Error on synchronizing name attribute for uid %new_uid: an account with the username %username and uid %existing_uid already exists.",['%username'=>$name,'%new_uid'=>$this->currentUser->id(),'%existing_uid'=>$existing_account->id()]);
drupal_set_message(t('Error synchronizing username: an account with this username already exists.'),'error');
$this->messenger->addMessage($this->t('Error synchronizing username: an account with this username already exists.'),'error');
}
}
@@ -234,7 +262,7 @@ class SimplesamlphpDrupalAuth {
}
else{
$this->logger->critical("Error on synchronizing name attribute: no username available for Drupal user %id.",['%id'=>$account->id()]);
drupal_set_message(t('Error synchronizing username: no username is provided by SAML.'),'error');
$this->messenger->addMessage($this->t('Error synchronizing username: no username is provided by SAML.'),'error');
}
}
@@ -245,7 +273,7 @@ class SimplesamlphpDrupalAuth {
}
else{
$this->logger->critical("Error on synchronizing mail attribute: no email address available for Drupal user %id.",['%id'=>$account->id()]);
drupal_set_message(t('Error synchronizing mail: no email address is provided by SAML.'),'error');
$this->messenger->addMessage($this->t('Error synchronizing mail: no email address is provided by SAML.'),'error');
}
}
@@ -308,7 +336,7 @@ class SimplesamlphpDrupalAuth {