xref: /plugin/authskautis/auth.php (revision a4ff4e44207e9306c12af697ef6ae58715b7e500)
1<?php
2
3/**
4 * DokuWiki Plugin skautis (Auth Component)
5 *
6 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
7 * @author  Jiri Dorazil <alex@skaut.cz>
8 */
9
10// must be run within Dokuwiki
11if(!defined('DOKU_INC')) die();
12define('SKAUTIS_LIBS_DIR', dirname(__FILE__).'/libs/');
13require_once SKAUTIS_LIBS_DIR. 'skautis-minify.php';
14
15global $conf;
16
17class auth_plugin_authskautis extends auth_plugin_authplain {
18
19
20    /**
21     * Constructor.
22     */
23    /*public function __construct() {
24        global $config_cascade;
25        parent::__construct(); // for compatibility
26
27        // FIXME intialize your auth system and set success to true, if successful
28        $this->success = true;
29        // FIXME set capabilities accordingly
30        /*$this->cando['addUser']     = false; // can Users be created?
31        $this->cando['delUser']     = false; // can Users be deleted?
32        $this->cando['modLogin']    = false; // can login names be changed?
33        $this->cando['modPass']     = false; // can passwords be changed?
34        $this->cando['modName']     = false; // can real names be changed?
35        $this->cando['modMail']     = false; // can emails be changed?
36        $this->cando['modGroups']   = false; // can groups be changed?
37        $this->cando['getUsers']    = false; // can a (filtered) list of users be retrieved?
38        $this->cando['getUserCount']= false; // can the number of users be retrieved?
39        $this->cando['getGroups']   = false; // can a list of available groups be retrieved?*/
40       // $this->cando['external']    = true; // does the module do external auth checking?
41       // $this->cando['logout']      = true; // can the user logout again? (eg. not possible with HTTP auth)
42
43   // }
44
45
46    /**
47     * Log off the current user [ OPTIONAL ]
48     */
49    //public function logOff() {
50    //}
51
52    /**
53     * Do all authentication [ OPTIONAL ]
54     *
55     * @param   string  $user    Username
56     * @param   string  $pass    Cleartext Password
57     * @param   bool    $sticky  Cookie should not expire
58     * @return  bool             true on successful auth
59     */
60    /*public function trustExternal($user, $pass, $sticky = false) {
61        /* some example:
62
63        global $USERINFO;
64        global $conf;
65        //$sticky ? $sticky = true : $sticky = false; //sanity check
66
67        // do the checking here
68
69        // set the globals if authed
70        $USERINFO['name'] = 'alex';
71        $USERINFO['mail'] = 'alex@skaut.cz';
72        //$USERINFO['grps'] = array('FIXME');
73        $USERINFO['grps'] = array('admin');
74        $_SERVER['REMOTE_USER'] = $user;
75        //$_SESSION[DOKU_COOKIE]['auth']['user'] = $user;
76        //$_SESSION[DOKU_COOKIE]['auth']['pass'] = $pass;
77        //$_SESSION[DOKU_COOKIE]['auth']['info'] = $USERINFO;
78        return true;
79
80    }*/
81
82}