Commit 2c15de2f authored by Robert Lyon's avatar Robert Lyon
Browse files

Fix bug in xmlrpc + $cfg->usersuniquebyusername

Bug 1556692: When used together, these can cause problems when
the ID field from Moodle gets truncated to the default
get_new_username() length of "30", when being inserted into
usr.username in Mahara.

behatnotneeded: Can't test Mnet in Behat

Change-Id: Icdeb78b5298e7d63a0610987b0d8fad34e58d036
parent 2148c340
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ class AuthXmlrpc extends Auth {
            $user->authinstance       = empty($this->config['parent']) ? $this->instanceid : $this->parent;

            db_begin();
            $user->username           = get_new_username($remoteuser->username);
            $user->username           = get_new_username($remoteuser->username, 200);

            $user->id = create_user($user, array(), $this->institution, $this, $remoteuser->username);