Small upgrade to fix some guest->mnethostid. MDL-10375
[pfb-moodle.git] / admin / uploaduser_form.php
blob075baf4ddb2a0c3c8ec3371d4a28249fa30279b5
1 <?php // $Id$
2 require_once $CFG->libdir.'/formslib.php';
4 class admin_uploaduser_form extends moodleform {
5 function definition (){
6 $mform =& $this->_form;
8 $mform->addElement('file', 'userfile', get_string('file'));
9 $mform->addRule('userfile', null, 'required');
11 $mform->addElement('header', 'settingsheader', get_string('settings'));
13 $passwordopts = array( 0 => get_string('infilefield', 'auth'),
14 1 => get_string('createpasswordifneeded', 'auth'),
17 $mform->addElement('select', 'createpassword', get_string('passwordhandling', 'auth'), $passwordopts);
19 $mform->addElement('selectyesno', 'updateaccounts', get_string('updateaccounts', 'admin'));
20 $mform->addElement('selectyesno', 'allowrenames', get_string('allowrenames', 'admin'));
22 $this->add_action_buttons(false, get_string('uploadusers'));
25 function get_userfile_name(){
26 if ($this->is_submitted() and $this->is_validated()) {
27 // return the temporary filename to process
28 return $this->_upload_manager->files['userfile']['tmp_name'];
29 }else{
30 return NULL;