Skip to content
Snippets Groups Projects
Select Git revision
  • 764db39e095d9ffedd834ba278e6446dcdc1c923
  • master default protected
  • more_logging
  • MDL-58395
  • accountexpires
  • hsh_3.10
  • v3.10-r1
  • v3.9-r2
  • v3.9-r1
  • v3.8-r1
  • v3.7-r1
  • v3.6-r1
  • v3.5-r2
  • v3.5-r1
  • v3.4-r4
  • v3.4-r3
  • v3.4-r2
  • v3.4-r1
  • v3.3-r1
  • v3.2-r4
  • v3.2-r3
  • v3.2-r2
  • v3.2-r1
  • v3.1-r1
  • v3.0-r3
  • v3.0-r2
26 results

auth.php

Blame
  • auth.php 26.72 KiB
    <?php
    // This file is part of Moodle - http://moodle.org/
    //
    // Moodle 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 3 of the License, or
    // (at your option) any later version.
    //
    // Moodle is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
    //
    // You should have received a copy of the GNU General Public License
    // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
    
    /**
     * Auth plugin "LDAP SyncPlus"
     *
     * @package    auth_ldap_syncplus
     * @copyright  2014 Alexander Bias, Ulm University <alexander.bias@uni-ulm.de>
     * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
     */
    
    defined('MOODLE_INTERNAL') || die;
    
    // @codingStandardsIgnoreFile
    // Let codechecker ignore this file. This code mostly re-used from auth_ldap and the problems are already there and not made by us.
    
    global $CFG;
    
    require_once($CFG->libdir.'/authlib.php');
    require_once($CFG->libdir.'/ldaplib.php');
    require_once($CFG->dirroot.'/user/lib.php');
    require_once(__DIR__.'/../ldap/auth.php');
    require_once(__DIR__.'/locallib.php');
    
    class auth_plugin_ldap_syncplus extends auth_plugin_ldap {
    
        /**
         * Constructor with initialisation.
         */
        public function __construct() {
            $this->authtype = 'ldap_syncplus';
            $this->roleauth = 'auth_ldap';
            $this->errorlogtag = '[AUTH LDAP SYNCPLUS] ';
            $this->init_plugin($this->authtype);
        }
    
        /**
         * Old syntax of class constructor. Deprecated in PHP7.
         *
         * @deprecated since Moodle 3.1
         */
        public function auth_plugin_ldap_syncplus() {
            debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
            self::__construct();
        }
    
    
        /**
         * Syncronizes user fron external LDAP server to moodle user table
         *
         * Sync is now using username attribute.
         *
         * Syncing users removes or suspends users that dont exists anymore in external LDAP.
         * Creates new users and updates coursecreator status of users.
         *
         * @param bool $do_updates will do pull in data updates from LDAP if relevant
         */