$stremailduplicate = get_string('useremailduplicate', 'error');
$strinvalidpasswordpolicy = get_string('invalidpasswordpolicy', 'error');
+$strinvalidtheme = get_string('invalidtheme', 'error');
+
$errorstr = get_string('error');
$stryes = get_string('yes');
'auth', // watch out when changing auth type or using external auth plugins!
'oldusername', // use when renaming users - this is the original username
'suspended', // 1 means suspend user account, 0 means activate user account, nothing means keep as is for existing users
+ 'theme', // Define a theme for user when 'allowuserthemes' is enabled.
'deleted', // 1 means delete user
'mnethostid', // Can not be used for adding, updating or deleting of users - only for enrolments, groups, cohorts and suspending.
'interests',
$cir->init();
$linenum = 1; //column header is first line
+ $themes = get_list_of_themes();
+
// init upload progress tracker
$upt = new uu_progress_tracker();
$upt->start(); // start table
$upt->track('username', s($user->username), 'normal', false);
}
+ // Validate theme.
+ if (!$CFG->allowuserthemes) {
+ $upt->track('status', get_string('invalidtheme', 'error', 'theme'), 'error');
+ $upt->track('theme', $errorstr, 'error');
+ $userserrors++;
+ continue;
+ }
+
+ if (isset($user->theme)) {
+ if (!isset($themes[$user->theme])) {
+ $user->theme = '';
+ $upt->track('status', get_string('invalidfieldvalue', 'error', 'theme'), 'error');
+ $upt->track('theme', $errorstr, 'error');
+ $userserrors++;
+ continue;
+ }
+ }
+
// add default values for remaining fields
$formdefaults = array();
if (!$existinguser || ($updatetype != UU_UPDATE_FILEOVERRIDE && $updatetype != UU_UPDATE_NOCHANGES)) {
}
echo $OUTPUT->footer();
die;
-
*/
class uu_progress_tracker {
private $_row;
- public $columns = array('status', 'line', 'id', 'username', 'firstname', 'lastname', 'email', 'password', 'auth', 'enrolments', 'suspended', 'deleted');
+
+ /**
+ * The columns shown on the table.
+ * @var array
+ */
+ public $columns = array('status', 'line', 'id', 'username', 'firstname', 'lastname', 'email',
+ 'password', 'auth', 'enrolments', 'suspended', 'theme', 'deleted');
/**
* Print table header.
echo '<th class="header c'.$ci++.'" scope="col">'.get_string('authentication').'</th>';
echo '<th class="header c'.$ci++.'" scope="col">'.get_string('enrolments', 'enrol').'</th>';
echo '<th class="header c'.$ci++.'" scope="col">'.get_string('suspended', 'auth').'</th>';
+ echo '<th class="header c'.$ci++.'" scope="col">'.get_string('theme').'</th>';
echo '<th class="header c'.$ci++.'" scope="col">'.get_string('delete').'</th>';
echo '</tr>';
$this->_row = null;
$string['invalidevent'] = 'Invalid event';
$string['invalidfieldname'] = '"{$a}" is not a valid field name';
$string['invalidfiletype'] = '"{$a}" is not a valid file type';
+$string['invalidfieldvalue'] = 'Field "{$a}" has an invalid value';
$string['invalidformatpara'] = 'Incorrect format for choose parameter';
$string['invalidformdata'] = 'Incorrect form data';
$string['invalidfunction'] = 'Incorrect function';
$string['invalidshortname'] = 'That\'s an invalid short course name';
$string['invalidstatedetected'] = 'Something has gone wrong: {$a}. This should never normally happen.';
$string['invalidsourcefield'] = 'Draft file\'s source field is invalid';
+$string['invalidtheme'] = 'Invalid theme column found. User themes are disabled.';
$string['invalidurl'] = 'Invalid URL';
$string['invaliduser'] = 'Invalid user';
$string['invaliduserid'] = 'Invalid user id';