From 1b7610c3b386d6256353578fea4847c4f057e5db Mon Sep 17 00:00:00 2001 From: Marcus Boon <(none)> Date: Mon, 22 Aug 2016 16:25:11 +1000 Subject: [PATCH] WR#259574: Initial auth_outage class structure --- auth.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 auth.php diff --git a/auth.php b/auth.php new file mode 100644 index 0000000..3791216 --- /dev/null +++ b/auth.php @@ -0,0 +1,47 @@ +. + +/** + * This plugin allows for an outage window to be configured + * and then optionally allows only a subset of IPs to connect, + * it also shows an outage notification to users. + * + * @package auth + * @subpackage outage + * @author Marcus Boon + * @license http://www.gnu.org/copyleft/gpl.html GNU Public License + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); // It must be included from a Moodle page. +} + +require_once($CFG->libdir.'/authlib.php'); + +class auth_plugin_outage extends auth_plugin_base { + + public function __construct() { + + $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); + } +}