当前位置: 首页>>代码示例>>PHP>>正文


PHP uu_supported_auths函数代码示例

本文整理汇总了PHP中uu_supported_auths函数的典型用法代码示例。如果您正苦于以下问题:PHP uu_supported_auths函数的具体用法?PHP uu_supported_auths怎么用?PHP uu_supported_auths使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了uu_supported_auths函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 $userserrors = 0;
 $deletes = 0;
 $deleteerrors = 0;
 $renames = 0;
 $renameerrors = 0;
 $usersskipped = 0;
 $weakpasswords = 0;
 // caches
 $ccache = array();
 // course cache - do not fetch all courses here, we  will not probably use them all anyway!
 $cohorts = array();
 $rolecache = uu_allowed_roles_cache();
 // roles lookup cache
 $manualcache = array();
 // cache of used manual enrol plugins in each course
 $supportedauths = uu_supported_auths();
 // officially supported plugins that are enabled
 // we use only manual enrol plugin here, if it is disabled no enrol is done
 if (enrol_is_enabled('manual')) {
     $manual = enrol_get_plugin('manual');
 } else {
     $manual = NULL;
 }
 // clear bulk selection
 if ($bulk) {
     $SESSION->bulk_users = array();
 }
 // init csv import helper
 $cir->init();
 $linenum = 1;
 //column header is first line
开发者ID:richheath,项目名称:moodle,代码行数:31,代码来源:uploaduser.php

示例2: raise_memory_limit

require_once $CFG->dirroot . '/user/profile/lib.php';
require_once $CFG->dirroot . '/user/lib.php';
require_once $CFG->dirroot . '/group/lib.php';
require_once $CFG->dirroot . '/cohort/lib.php';
require_once $CFG->dirroot . '/admin/tool/uploaduser/locallib.php';
core_php_time_limit::raise(60 * 60 * 24);
// 24 hours should be enough
raise_memory_limit(MEMORY_HUGE);
// Standard csv fields.
$UUC_STD_FIELDS = array('id', 'username', 'email', 'city', 'country', 'lang', 'timezone', 'mailformat', 'firstname', 'maildisplay', 'maildigest', 'htmleditor', 'autosubscribe', 'institution', 'department', 'idnumber', 'skype', 'lastname', 'msn', 'aim', 'yahoo', 'icq', 'phone1', 'phone2', 'address', 'url', 'description', 'descriptionformat', 'password', 'auth', 'oldusername', 'suspended', 'deleted', 'mnethostid');
// Profile fields.
$UUC_PRF_FIELDS = array();
// Default values.
$UUC_DEFAULTS = array('lang' => 'en', 'auth' => 'manual', 'maildigest' => '0', 'maildisplay' => '1', 'mailformat' => '1');
// Supported authentication plugins.
$UUC_SUPPORTEDAUTHS = uu_supported_auths();
// Now get cli options.
list($options, $unrecognized) = cli_get_params(array('help' => false, 'mode' => '', 'updatemode' => 'nothing', 'passwordmode' => 'generate', 'file' => '', 'delimiter' => 'comma', 'encoding' => 'UTF-8', 'updatepassword' => false, 'allowdeletes' => false, 'allowrenames' => false, 'allowsuspends' => true, 'noemailduplicates' => true, 'standardise' => true, 'forcepasswordchange' => 'none'), array('h' => 'help', 'm' => 'mode', 'u' => 'updatemode', 'f' => 'file', 'd' => 'delimiter', 'e' => 'encoding', 'p' => 'passwordmode'));
$help = "Execute User Upload.\n\nOptions:\n-h, --help                 Print out this help\n-m, --mode                 Import mode: createnew, createall, createorupdate, update\n-u, --updatemode           Update mode: nothing (default), dataonly, dataordefaults¸ missingonly\n-f, --file                 CSV file\n-d, --delimiter            CSV delimiter: colon, semicolon, tab, cfg, comma (default)\n-e, --encoding             CSV file encoding: utf8 (default), ... etc\n-p, --passwordmode         Password creation mode: generate (default), field\n--allowdeletes             Allow users to be deleted: true or false (default)\n--allowrenames             Allow users to be renamed: true or false (default)\n--standardise              Standardise user names: true (default) or false\n--updatepassword           Update existing user password: false (default) or true\n--allowsuspends            Allow suspending or activating of accounts: true (default) false\n--noemailduplicates        Do not allow duplicate email addresses: true (default) or false\n--forcepasswordchange      Force users to reset their passwords: none (default), weak, all\n\nExample:\n\$sudo -u www-data /usr/bin/php admin/tool/uploaduser/cli/uploaduser.php --mode=createnew \\\n       --file=./users.csv --delimiter=comma\n";
if ($unrecognized) {
    $unrecognized = implode("\n  ", $unrecognized);
    cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
    echo $help;
    die;
}
//echo "Moodle user uploader running ...\n\n";
// Get all the possible user name fields.
$UUC_STD_FIELDS = array_merge($UUC_STD_FIELDS, get_all_user_name_fields());
// Get profile fields.
开发者ID:alexandru-elisei,项目名称:moodle-tool_uploadusercli,代码行数:31,代码来源:uploadusercli.php

示例3: definition


//.........这里部分代码省略.........
                     $mform->setDefault('uulegacy2', $role->id);
                     break;
                 }
             }
             unset($editteacherroles);
         }
         $mform->addElement('select', 'uulegacy3', get_string('uulegacy3role', 'tool_uploaduser'), $choices);
         if ($teacherroles = get_archetype_roles('teacher')) {
             foreach ($teacherroles as $role) {
                 if (isset($choices[$role->id])) {
                     $mform->setDefault('uulegacy3', $role->id);
                     break;
                 }
             }
             unset($teacherroles);
         }
     }
     // default values
     $mform->addElement('header', 'defaultheader', get_string('defaultvalues', 'tool_uploaduser'));
     $mform->addElement('text', 'username', get_string('uuusernametemplate', 'tool_uploaduser'), 'size="20"');
     $mform->setType('username', PARAM_RAW);
     // No cleaning here. The process verifies it later.
     $mform->addRule('username', get_string('requiredtemplate', 'tool_uploaduser'), 'required', null, 'client');
     $mform->disabledIf('username', 'uutype', 'eq', UU_USER_ADD_UPDATE);
     $mform->disabledIf('username', 'uutype', 'eq', UU_USER_UPDATE);
     $mform->setForceLtr('username');
     $mform->addElement('text', 'email', get_string('email'), 'maxlength="100" size="30"');
     $mform->setType('email', PARAM_RAW);
     // No cleaning here. The process verifies it later.
     $mform->disabledIf('email', 'uutype', 'eq', UU_USER_ADD_UPDATE);
     $mform->disabledIf('email', 'uutype', 'eq', UU_USER_UPDATE);
     $mform->setForceLtr('email');
     // only enabled and known to work plugins
     $choices = uu_supported_auths();
     $mform->addElement('select', 'auth', get_string('chooseauthmethod', 'auth'), $choices);
     $mform->setDefault('auth', 'manual');
     // manual is a sensible backwards compatible default
     $mform->addHelpButton('auth', 'chooseauthmethod', 'auth');
     $mform->setAdvanced('auth');
     $choices = array(0 => get_string('emaildisplayno'), 1 => get_string('emaildisplayyes'), 2 => get_string('emaildisplaycourse'));
     $mform->addElement('select', 'maildisplay', get_string('emaildisplay'), $choices);
     $mform->setDefault('maildisplay', core_user::get_property_default('maildisplay'));
     $choices = array(0 => get_string('textformat'), 1 => get_string('htmlformat'));
     $mform->addElement('select', 'mailformat', get_string('emailformat'), $choices);
     $mform->setDefault('mailformat', core_user::get_property_default('mailformat'));
     $mform->setAdvanced('mailformat');
     $choices = array(0 => get_string('emaildigestoff'), 1 => get_string('emaildigestcomplete'), 2 => get_string('emaildigestsubjects'));
     $mform->addElement('select', 'maildigest', get_string('emaildigest'), $choices);
     $mform->setDefault('maildigest', core_user::get_property_default('maildigest'));
     $mform->setAdvanced('maildigest');
     $choices = array(1 => get_string('autosubscribeyes'), 0 => get_string('autosubscribeno'));
     $mform->addElement('select', 'autosubscribe', get_string('autosubscribe'), $choices);
     $mform->setDefault('autosubscribe', core_user::get_property_default('autosubscribe'));
     $mform->addElement('text', 'city', get_string('city'), 'maxlength="120" size="25"');
     $mform->setType('city', PARAM_TEXT);
     if (empty($CFG->defaultcity)) {
         $mform->setDefault('city', $templateuser->city);
     } else {
         $mform->setDefault('city', core_user::get_property_default('city'));
     }
     $choices = get_string_manager()->get_list_of_countries();
     $choices = array('' => get_string('selectacountry') . '...') + $choices;
     $mform->addElement('select', 'country', get_string('selectacountry'), $choices);
     if (empty($CFG->country)) {
         $mform->setDefault('country', $templateuser->country);
     } else {
开发者ID:janeklb,项目名称:moodle,代码行数:67,代码来源:user_form.php

示例4: array

    $usersnew      = 0;
    $usersupdated  = 0;
    $usersuptodate = 0; //not printed yet anywhere
    $userserrors   = 0;
    $deletes       = 0;
    $deleteerrors  = 0;
    $renames       = 0;
    $renameerrors  = 0;
    $usersskipped  = 0;
    $weakpasswords = 0;

    // caches
    $ccache         = array(); // course cache - do not fetch all courses here, we  will not probably use them all anyway!
    $rolecache      = uu_allowed_roles_cache(); // roles lookup cache
    $manualcache    = array(); // cache of used manual enrol plugins in each course
    $supportedauths = uu_supported_auths(); // officially supported plugins that are enabled

    // we use only manual enrol plugin here, if it is disabled no enrol is done
    if (enrol_is_enabled('manual')) {
        $manual = enrol_get_plugin('manual');
    } else {
        $manual = NULL;
    }

    // clear bulk selection
    if ($bulk) {
        $SESSION->bulk_users = array();
    }

    // init csv import helper
    $cir->init();
开发者ID:nottmoo,项目名称:moodle,代码行数:31,代码来源:uploaduser.php


注:本文中的uu_supported_auths函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。