Moodle
  1. Moodle
  2. MDL-16061

Remove 'username' from the $moodleattributes array

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.6, 1.9.2, 2.0
    • Fix Version/s: 1.8.6, 1.9.2, 2.0
    • Component/s: Authentication
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
    • Rank:
      24354

      Description

      It doesn't make sense at all (username is not part of the externally mapped fields) and produces a notice that breaks HTTP headers with debugging enabled.

      So simply remove it.

      Saludos. Iñaki.

        Activity

        Hide
        Iñaki Arenaza added a comment -

        Fixed in CVS for 1.8, 1.9 and HEAD.

        Saludos. Iñaki

        Show
        Iñaki Arenaza added a comment - Fixed in CVS for 1.8, 1.9 and HEAD. Saludos. Iñaki
        Hide
        Dongsheng Cai added a comment -

        Closing, Thanks

        Show
        Dongsheng Cai added a comment - Closing, Thanks
        Hide
        Iñaki Arenaza added a comment -

        I'm really sorry, but the fix is wrong, as it breaks auth_db_sync_users.php and auth_ldap_sync_users.php at least. No new users are added to Moodle, as the username is missing from the new user info record.

        I'm going to fix update_user_record() in lib/moodlelib.php to make it skip the 'username' key, as we really need get_userinfo() to return the username as part of the user info array.

        Saludos. Iñaki.

        Show
        Iñaki Arenaza added a comment - I'm really sorry, but the fix is wrong, as it breaks auth_db_sync_users.php and auth_ldap_sync_users.php at least. No new users are added to Moodle, as the username is missing from the new user info record. I'm going to fix update_user_record() in lib/moodlelib.php to make it skip the 'username' key, as we really need get_userinfo() to return the username as part of the user info array. Saludos. Iñaki.
        Hide
        Iñaki Arenaza added a comment -

        Fixed in CVS for 1.8, 1.9 and HEAD.

        Sorry for the previous incorrect fix.

        Saludos. Iñaki.

        Show
        Iñaki Arenaza added a comment - Fixed in CVS for 1.8, 1.9 and HEAD. Sorry for the previous incorrect fix. Saludos. Iñaki.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Thanks Iñaki,

        when I saw this original commit I thought "uhm... why are we injecting that "username" in all get_userinfo() auth implementations but wasn't able to find any use, so I stop researching.

        Obviously, you've found it now (sync scripts). Great!

        Closing this as fixed, thanks and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Thanks Iñaki, when I saw this original commit I thought "uhm... why are we injecting that "username" in all get_userinfo() auth implementations but wasn't able to find any use, so I stop researching. Obviously, you've found it now (sync scripts). Great! Closing this as fixed, thanks and ciao

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: