Merge branch 'MDL-25881' of git://git.luns.net.uk/moodle
[moodle.git] / auth / nologin / auth.php
CommitLineData
139ebfdb 1<?php
2
3/**
08103c93 4 * @author Petr Skoda
139ebfdb 5 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
6 * @package moodle multiauth
7 *
8 * Authentication Plugin: No Authentication
9 *
10 * No authentication at all. This method approves everything!
11 *
12 * 2007-02-18 File created.
13 */
14
15if (!defined('MOODLE_INTERNAL')) {
16 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
17}
18
6bc1e5d5 19require_once($CFG->libdir.'/authlib.php');
20
139ebfdb 21/**
08103c93 22 * Plugin for no authentication - disabled user.
139ebfdb 23 */
6bc1e5d5 24class auth_plugin_nologin extends auth_plugin_base {
139ebfdb 25
26
27 /**
28 * Constructor.
29 */
30 function auth_plugin_nologin() {
6bc1e5d5 31 $this->authtype = 'nologin';
139ebfdb 32 }
33
34 /**
08103c93 35 * Do not allow any login.
139ebfdb 36 *
37 */
08103c93 38 function user_login($username, $password) {
139ebfdb 39 return false;
40 }
41
42 /**
43 * No password updates.
44 */
45 function user_update_password($user, $newpassword) {
46 return false;
47 }
48
edb5da83
PS
49 function prevent_local_passwords() {
50 // just in case, we do not want to loose the passwords
51 return false;
52 }
53
139ebfdb 54 /**
08103c93 55 * No external data sync.
139ebfdb 56 *
57 * @return bool
58 */
59 function is_internal() {
60 //we do not know if it was internal or external originally
08103c93 61 return true;
139ebfdb 62 }
63
64 /**
08103c93 65 * No changing of password.
139ebfdb 66 *
67 * @return bool
68 */
69 function can_change_password() {
70 return false;
71 }
72
139ebfdb 73 /**
08103c93 74 * No password resetting.
139ebfdb 75 */
08103c93
ML
76 function can_reset_password() {
77 return false;
139ebfdb 78 }
79
80}
81
5117d598 82