Merge branch 'MDL-35147_22' of git://github.com/timhunt/moodle into MOODLE_22_STABLE
[moodle.git] / auth / nologin / auth.php
blob72f5fa85753d402dcadc38772fa13841441a951c
1 <?php
3 /**
4 * @author Petr Skoda
5 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
6 * @package moodle multiauth
8 * Authentication Plugin: No Authentication
10 * No authentication at all. This method approves everything!
12 * 2007-02-18 File created.
15 if (!defined('MOODLE_INTERNAL')) {
16 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
19 require_once($CFG->libdir.'/authlib.php');
21 /**
22 * Plugin for no authentication - disabled user.
24 class auth_plugin_nologin extends auth_plugin_base {
27 /**
28 * Constructor.
30 function auth_plugin_nologin() {
31 $this->authtype = 'nologin';
34 /**
35 * Do not allow any login.
38 function user_login($username, $password) {
39 return false;
42 /**
43 * No password updates.
45 function user_update_password($user, $newpassword) {
46 return false;
49 function prevent_local_passwords() {
50 // just in case, we do not want to loose the passwords
51 return false;
54 /**
55 * No external data sync.
57 * @return bool
59 function is_internal() {
60 //we do not know if it was internal or external originally
61 return true;
64 /**
65 * No changing of password.
67 * @return bool
69 function can_change_password() {
70 return false;
73 /**
74 * No password resetting.
76 function can_reset_password() {
77 return false;