@@ -25,7 +25,7 @@ class UwAddUsersForm extends FormBase {
...
@@ -25,7 +25,7 @@ class UwAddUsersForm extends FormBase {
// The list of users from this form.
// The list of users from this form.
$form['users']=[
$form['users']=[
'#title'=>$this->t('WatIAM user ID(s): (maximum 8 characters per ID)'),
'#title'=>$this->t('WatIAM user ID(s): (maximum 8 characters per ID)'),
'#description'=>$this->t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line. All letters will be converted to lower case. Duplicates will be ignored.<br>You can use <a href="https://idm.uwaterloo.ca/search/" target="_blank">authenticated WatIAM search</a> if you don\'t know their user ID (will open a new window).'),
'#description'=>$this->t('Enter a single WatIAM user ID, or multiple WatIAM user IDs, one per line. All letters will be converted to lower case. Duplicates will be ignored.<br>You can use <a href="https://iamtools.uwaterloo.ca/directory/" target="_blank">authenticated campus people directory</a> if you don\'t know their user ID (will open a new window).'),
'#type'=>'textarea',
'#type'=>'textarea',
'#required'=>TRUE,
'#required'=>TRUE,
];
];
...
@@ -68,13 +68,13 @@ class UwAddUsersForm extends FormBase {
...
@@ -68,13 +68,13 @@ class UwAddUsersForm extends FormBase {
// Don't process long user IDs.
// Don't process long user IDs.
if(strlen($user)>8){
if(strlen($user)>8){
$this->messenger()->addError($this->t('The user ID <em>@user</em> is too long and was skipped.',['@user'=>$user]));
$this->messenger()->addError($this->t('The user ID <em>@user</em> is too long and was skipped.',['@user'=>$user]));
continue;
continue;
}
}
// Don't process user IDs with invalid characters.
// Don't process user IDs with invalid characters.
if(!preg_match('/^[a-z0-9]+$/',$user)){
if(!preg_match('/^[a-z0-9]+$/',$user)){
$this->messenger()->addError($this->t('The user ID <em>@user</em> contains invalid characters and was skipped.',['@user'=>$user]));
$this->messenger()->addError($this->t('The user ID <em>@user</em> contains invalid characters and was skipped.',['@user'=>$user]));
continue;
continue;
}
}
...
@@ -110,7 +110,7 @@ class UwAddUsersForm extends FormBase {
...
@@ -110,7 +110,7 @@ class UwAddUsersForm extends FormBase {