Skip to content
Snippets Groups Projects
Select Git revision
  • 84bd61aac16513f30b4ac0cd933c891a9f52c848
  • master default protected
  • pymilter-1.0.4
  • pymilter-1.0.3
  • pymilter-1.0.2
  • pymilter-1.0.1
  • pymilter-1_0
  • milter-0_8_18
  • pymilter-0_9_8
  • pymilter-0_9_7
  • pymilter-0_9_6
  • pymilter-0_9_5
  • pymilter-0_9_4
  • pymilter-0_9_2
  • pymilter-0_9_1
  • pymilter-0_9_0
  • pymilter-0_8_12
  • pymilter-0_8_11
  • pymilter-0_8_10
  • pymilter-0_8_9
  • milter-0_8_8
  • milter-0_8_7
22 results

__init__.py

Blame
  • settings.php 18.77 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" - Settings
     *
     * @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;
    
    if ($ADMIN->fulltree) {
    
        if (!function_exists('ldap_connect')) {
            $settings->add(new admin_setting_heading('auth_ldap_syncplus_noextension', '',
                    get_string('auth_ldap_noextension', 'auth_ldap')));
        } else {
    
            // We use a couple of custom admin settings since we need to massage the data before it is inserted into the DB.
            require_once($CFG->dirroot.'/auth/ldap/classes/admin_setting_special_lowercase_configtext.php');
            require_once($CFG->dirroot.'/auth/ldap/classes/admin_setting_special_contexts_configtext.php');
            require_once($CFG->dirroot.'/auth/ldap/classes/admin_setting_special_ntlm_configtext.php');
    
            // We need to use some of the Moodle LDAP constants / functions to create the list of options.
            require_once($CFG->dirroot.'/auth/ldap/auth.php');
    
            // We need to use some of the Moodle LDAP Syncplus constants / functions to create the list of options.
            require_once($CFG->dirroot.'/auth/ldap_syncplus/locallib.php');
    
            // Introductory explanation.
            $settings->add(new admin_setting_heading('auth_ldap_syncplus/pluginname', '',
                    new lang_string('auth_ldapdescription', 'auth_ldap')));
    
            // LDAP server settings.
            $settings->add(new admin_setting_heading('auth_ldap_syncplus/ldapserversettings',
                    new lang_string('auth_ldap_server_settings', 'auth_ldap'), ''));
    
            // Host.
            $settings->add(new admin_setting_configtext('auth_ldap_syncplus/host_url',
                    get_string('auth_ldap_host_url_key', 'auth_ldap'),
                    get_string('auth_ldap_host_url', 'auth_ldap'), '', PARAM_RAW_TRIMMED));
    
            // Version.
            $versions = array();
            $versions[2] = '2';
            $versions[3] = '3';
            $settings->add(new admin_setting_configselect('auth_ldap_syncplus/ldap_version',
                    new lang_string('auth_ldap_version_key', 'auth_ldap'),
                    new lang_string('auth_ldap_version', 'auth_ldap'), 3, $versions));
    
            // Start TLS.
            $yesno = array(
                new lang_string('no'),
                new lang_string('yes'),
            );