Commit e8b578c8 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1720237: adding default username to use in registration"

parents 491bb57f 1af48e44
......@@ -1804,6 +1804,9 @@ function load_user_institutions($userid) {
* @param string $maxlen Maximum length of desired username
function get_new_username($desired, $maxlen=30) {
if (empty($desired)) {
$desired = 'user';
if (function_exists('mb_strtolower')) {
$desired = mb_strtolower(mb_substr($desired, 0, $maxlen, 'UTF-8'), 'UTF-8');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment