aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/auth_plugins/StudipAuthSSO.php
blob: 2cb0e146ae91000244b1ceabcc42a6607686721e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
# Lifter007: TODO
# Lifter003: TODO
# Lifter010: TODO
/*
 * StudipAuthSSO.php - abstract base class for SSO auth plugins
 * Copyright (c) 2007  Elmar Ludwig, Universitaet Osnabrueck
 *
 * This program 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 2 of
 * the License, or (at your option) any later version.
 */

/*
 * Abstract base class for SSO authentication plugins.
 */
abstract class StudipAuthSSO extends StudipAuthAbstract
{
    /**
     * @var string the descriptive name of the authentication plugin
     */
    public $plugin_fullname;

    /**
     * @var string a short description, when present it is shown on the login page
     */
    public $login_description;

    /**
     * Return the current username.
     */
    abstract function getUser ();

    /**
     * Check whether this user can be authenticated. The default
     * implementation just checks whether $username is not empty.
     */
    public function isAuthenticated ($username, $password)
    {
        return !empty($username);
    }

    /**
     * SSO auth plugins cannot determine if a username is used.
     */
    public function isUsedUsername ($username)
    {
        return false;
    }

    /**
     * Use this to log out the user
     */
    public function logout(): void
    {
    }
}