mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Issue #22 - Added setting and implemented removing elements by basic CSS selector (only simple .class and #id can be used as of now).
This commit is contained in:
11
settings.php
11
settings.php
@@ -90,11 +90,9 @@ if ($hassiteconfig && is_enabled_auth('outage')) {
|
||||
// Create 'Allowed IPs' settings.
|
||||
$allowedips = outagelib::get_config()->allowedips;
|
||||
$description = '';
|
||||
|
||||
if (!isset($CFG->auth_outage_check) || !$CFG->auth_outage_check) {
|
||||
$description .= $OUTPUT->notification(get_string('allowedipsnoconfig', 'auth_outage'), 'notifyfailure');
|
||||
}
|
||||
|
||||
if (trim($allowedips) == '') {
|
||||
$message = 'allowedipsempty';
|
||||
$type = 'notifymessage';
|
||||
@@ -108,7 +106,6 @@ if ($hassiteconfig && is_enabled_auth('outage')) {
|
||||
$description .= $OUTPUT->notification(get_string($message, 'auth_outage', ['ip' => getremoteaddr()]), $type);
|
||||
|
||||
$description .= '<p>'.get_string('ipblockersyntax', 'admin').'</p>';
|
||||
|
||||
$settings->add(new admin_setting_configiplist(
|
||||
'auth_outage/allowedips',
|
||||
get_string('allowediplist', 'admin'),
|
||||
@@ -116,6 +113,14 @@ if ($hassiteconfig && is_enabled_auth('outage')) {
|
||||
$defaults['allowedips']
|
||||
));
|
||||
|
||||
// Create 'Static Page - Elements to Remove' settings.
|
||||
$settings->add(new admin_setting_configtextarea(
|
||||
'auth_outage/remove_selectors',
|
||||
get_string('removeselectors', 'auth_outage'),
|
||||
get_string('removeselectorsdescription', 'auth_outage'),
|
||||
$defaults['remove_selectors']
|
||||
));
|
||||
|
||||
// Create category for Outage.
|
||||
$ADMIN->add('authsettings', new admin_category('auth_outage', get_string('pluginname', 'auth_outage')));
|
||||
// Add settings page toconfigure defaults.
|
||||
|
||||
Reference in New Issue
Block a user