mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-17 05:48:43 +02:00
Changes to comply with codechecker.
This commit is contained in:
73
auth.php
73
auth.php
@@ -35,18 +35,13 @@ require_once($CFG->libdir . '/authlib.php');
|
||||
*/
|
||||
class auth_plugin_outage extends auth_plugin_base
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
$this->pluginconfig = 'auth_outage';
|
||||
$this->authtype = 'outage';
|
||||
$this->roleauth = 'auth_outage';
|
||||
$this->component = 'auth_outage';
|
||||
$this->errorlogtag = '[AUTH_OUTAGE]';
|
||||
$this->config = get_config('auth_outage');
|
||||
|
||||
// Set to defaults if undefined.
|
||||
//$this->config = $this->set_defaults($this->config);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,70 +59,8 @@ class auth_plugin_outage extends auth_plugin_base
|
||||
*
|
||||
* @return bool Authentication success or failure.
|
||||
*/
|
||||
function user_login($username, $password)
|
||||
{
|
||||
// do not authenticate users
|
||||
public function user_login($username, $password) {
|
||||
// Do not authenticate users.
|
||||
return false;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Prints a form for configuring this authentication plugin.
|
||||
// *
|
||||
// * This function is called from admin/auth.php, and outputs a full page with
|
||||
// * a form for configuring this plugin.
|
||||
// *
|
||||
// * @param object $config
|
||||
// * @param object $err
|
||||
// * @param array $user_fields
|
||||
// */
|
||||
// function config_form($config, $err, $user_fields)
|
||||
// {
|
||||
// require('config.php');
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * A chance to validate form data, and last chance to
|
||||
// * do stuff before it is inserted in config_plugin
|
||||
// * @param object object with submitted configuration settings (without system magic quotes)
|
||||
// * @param array $err array of error messages
|
||||
// */
|
||||
// function validate_form($form, &$err)
|
||||
// {
|
||||
// if (strlen(trim($form->default_warning_message)) == 0) {
|
||||
// $err['invalid_message'] = 'Please provide a descriptive message.';
|
||||
// }
|
||||
//
|
||||
// $starts = DateTime::createFromFormat('Y-m-d\\TH:i', $form->starts);
|
||||
// if ($starts === false) {
|
||||
// $err['invalid_start'] = 'Invalid start date.';
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Processes and stores configuration data for this authentication plugin.
|
||||
// *
|
||||
// * @param object object with submitted configuration settings (without system magic quotes)
|
||||
// */
|
||||
// function process_config($config)
|
||||
// {
|
||||
// if (!isset($config->active)) {
|
||||
// $config->active = 'N';
|
||||
// }
|
||||
// if (!isset($config->message)) {
|
||||
// $config->message = 'Maintenance scheduled from %s to %s.';
|
||||
// }
|
||||
// if (!isset($config->starts)) {
|
||||
// $config->starts = '';
|
||||
// }
|
||||
// if (!isset($config->ends)) {
|
||||
// $config->ends = '';
|
||||
// }
|
||||
//
|
||||
// set_config('active', ($config->active == 'Y' ? 'Y' : 'N'), $this->pluginconfig);
|
||||
// set_config('message', trim($config->message), $this->pluginconfig);
|
||||
// set_config('starts', $config->starts, $this->pluginconfig);
|
||||
// set_config('ends', $config->ends, $this->pluginconfig);
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'auth_outage', language 'en'.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user