Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions classes/plugininfo/factor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

namespace tool_mfa\plugininfo;

use core\setting\part\page;
use core\setting\part\part_of_admin_tree;

/**
* Subplugin info class.
*
Expand Down Expand Up @@ -242,11 +245,11 @@ public function get_settings_section_name() {
* This function usually includes settings.php file in plugins folder.
* Alternatively it can create a link to some settings page (instance of admin_externalpage)
*
* @param \part_of_admin_tree $adminroot
* @param part_of_admin_tree $adminroot
* @param string $parentnodename
* @param bool $hassiteconfig whether the current user has moodle/site:config capability
*/
public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) {
public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) {

if (!$this->is_installed_and_upgraded()) {
return;
Expand All @@ -258,7 +261,7 @@ public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $

$section = $this->get_settings_section_name();

$settings = new \admin_settingpage($section, $this->displayname, 'moodle/site:config', $this->is_enabled() === false);
$settings = new page($section, $this->displayname, 'moodle/site:config', $this->is_enabled() === false);

if ($adminroot->fulltree) {
include($this->full_path('settings.php'));
Expand Down
12 changes: 8 additions & 4 deletions factor/sms/classes/local/smsgateway/aws_sns.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

namespace factor_sms\local\smsgateway;

use core\setting\heading;
use core\setting\type\checkbox;
use core\setting\type\password_unmask;
use core\setting\type\text;
use factor_sms\event\sms_sent;

/**
Expand Down Expand Up @@ -124,18 +128,18 @@ public static function add_settings($settings) {

if (!$reqs) {
$warning = $OUTPUT->notification(get_string('awssdkrequired', 'factor_sms'), 'notifyerror');
$settings->add(new \admin_setting_heading('factor_sms/awssdkwarning', '', $warning));
$settings->add(new heading('factor_sms/awssdkwarning', '', $warning));
} else {
$settings->add(new \admin_setting_configcheckbox('factor_sms/usecredchain',
$settings->add(new checkbox('factor_sms/usecredchain',
get_string('settings:aws:usecredchain', 'factor_sms'), '', 0));

if (!get_config('factor_sms', 'usecredchain')) {
// AWS Settings.
$settings->add(new \admin_setting_configtext('factor_sms/api_key',
$settings->add(new text('factor_sms/api_key',
get_string('settings:aws:key', 'factor_sms'),
get_string('settings:aws:key_help', 'factor_sms'), ''));

$settings->add(new \admin_setting_configpasswordunmask('factor_sms/api_secret',
$settings->add(new password_unmask('factor_sms/api_secret',
get_string('settings:aws:secret', 'factor_sms'),
get_string('settings:aws:secret_help', 'factor_sms'), ''));
}
Expand Down