User upload - standardise usernames

User upload - standardise usernames

deur Carlotta Hampson -
Getal antwoorde: 4

Hi,

I am trying to get used to 2.1 - so far so good. Where I work, we upload users so have been looking at the upload pages to see if anything has changed and have found a setting called "standardise usernames".

Can anyone shed any light on what it does?

All I can find is one entry in the tracker ironically saying that there is no documentation for it!! glimlag

Carlotta

Gemiddeld van beoordelings: -
In antwoord op Carlotta Hampson

Re: User upload - standardise usernames

deur Howard Miller -
Prentjie van Core developers Prentjie van Documentation writers Prentjie van Particularly helpful Moodlers Prentjie van Peer reviewers Prentjie van Plugin developers
I've only had a very quick look but it 'cleans' the usernames. The comment for that is....

"Clean username to only contains allowed characters. This is to be used ONLY when manually creating user accounts, do NOT use when syncing with external systems!!"

The code is this...


$param = str_replace(" " , "", $param);
$param = moodle_strtolower($param); // Convert uppercase to lowercase MDL-16919
if (empty($CFG->extendedusernamechars)) {
// regular expression, eliminate all chars EXCEPT:
// alphanum, dash (-), underscore (_), at sign (@) and period (.) characters.
$param = preg_replace('/[^-\.@_a-z0-9]/', '', $param);
}
return $param;




Gemiddeld van beoordelings:Useful (1)
In antwoord op Howard Miller

Re: User upload - standardise usernames

deur Anthony Borrow -
Prentjie van Core developers Prentjie van Plugin developers Prentjie van Testers

Just to clarify - it ensures that usernames that are imported are cleaned to conform with the requirements of usernames that are manually entered. Namely, that they be lowercase and if extended characters are not allowed that they be removed. It also removes any spaces in the username. Perhaps someone could clarify this in the Docs. Peace - Anthony

p.s. - see Upload users in Moodle Docs for more information.

Gemiddeld van beoordelings:Useful (1)
In antwoord op Howard Miller

Re: User upload - standardise usernames

deur chinh pham -
hi, which file these content included? please show me the file name and path? thanks you
Gemiddeld van beoordelings: -