Skip to content

Commit

Permalink
fixup! MDL-81732 smsgateway_aws: Add hooks for SMS gateway management
Browse files Browse the repository at this point in the history
  • Loading branch information
mickhawkins committed Aug 26, 2024
1 parent da7f392 commit 696c798
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 6 additions & 1 deletion sms/gateway/aws/classes/hook_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,21 @@ public static function set_form_definition_for_aws_sms_gateway(after_sms_gateway
'maxlength="255" size="20"',
);
$mform->setType('api_key', PARAM_TEXT);
$mform->addRule('api_key', get_string('required'), 'required', null, 'client');
$mform->addRule('api_key', get_string('maximumchars', '', 255), 'maxlength', 255);
$mform->setDefault(
elementName: 'api_key',
defaultValue: '',
);

$mform->addElement(
'passwordunmask',
'api_secret',
get_string('api_secret', 'smsgateway_aws'),
'maxlength="255" size="20"',
);
$mform->setType('api_secret', PARAM_TEXT);
$mform->addRule('api_secret', get_string('required'), 'required', null, 'client');
$mform->addRule('api_secret', get_string('maximumchars', '', 255), 'maxlength', 255);
$mform->setDefault(
elementName: 'api_secret',
defaultValue: '',
Expand All @@ -99,6 +102,8 @@ public static function set_form_definition_for_aws_sms_gateway(after_sms_gateway
'maxlength="255" size="20"',
);
$mform->setType('api_region', PARAM_TEXT);
$mform->addRule('api_region', get_string('required'), 'required', null, 'client');
$mform->addRule('api_region', get_string('maximumchars', '', 255), 'maxlength', 255);
$mform->setDefault(
elementName: 'api_region',
defaultValue: 'ap-southeast-2',
Expand Down
4 changes: 1 addition & 3 deletions sms/gateway/aws/lang/en/smsgateway_aws.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@
$string['aws_information'] = 'Complete the following fields using the information provided by AWS';
$string['pluginname'] = 'AWS';
$string['privacy:metadata'] = 'The AWS SMS gateway plugin does not store any personal data.';
$string['usecredchain'] = 'Find AWS credentials using the default credential provider chain';


$string['usecredchain'] = 'Find AWS credentials using the default provider chain';

0 comments on commit 696c798

Please sign in to comment.