MDL-51723 enrol_ldap: Normalise user objectclass in dn
[moodle.git] / auth / nologin / auth.php
blob9a80a02d404a17b291c2b3a73db672f30b787e98
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 /**
18 * Nologin authentication login - prevents user login.
20 * @package auth_nologin
21 * @author Petr Skoda
22 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
25 defined('MOODLE_INTERNAL') || die();
27 require_once($CFG->libdir.'/authlib.php');
29 /**
30 * Plugin for no authentication - disabled user.
32 class auth_plugin_nologin extends auth_plugin_base {
35 /**
36 * Constructor.
38 public function __construct() {
39 $this->authtype = 'nologin';
42 /**
43 * Old syntax of class constructor for backward compatibility.
45 public function auth_plugin_nologin() {
46 self::__construct();
49 /**
50 * Do not allow any login.
53 function user_login($username, $password) {
54 return false;
57 /**
58 * No password updates.
60 function user_update_password($user, $newpassword) {
61 return false;
64 function prevent_local_passwords() {
65 // just in case, we do not want to loose the passwords
66 return false;
69 /**
70 * No external data sync.
72 * @return bool
74 function is_internal() {
75 //we do not know if it was internal or external originally
76 return true;
79 /**
80 * No changing of password.
82 * @return bool
84 function can_change_password() {
85 return false;
88 /**
89 * No password resetting.
91 function can_reset_password() {
92 return false;
95 /**
96 * Returns true if plugin can be manually set.
98 * @return bool
100 function can_be_manually_set() {
101 return true;