Joomla 2.5 Development

Well, I was a little surprised today when I learned that Joomla 2.5 does not allow for users to change their own usernames (I'm sure there's a valid reason for it, but at the same time I have a valid need to allow it). 

Since I've allowed my support system to automatically create accounts it does so in a way that adds a lot of random numbers to the end of the username it creates for a user. Now if I were in my user's shoes and I saw that, I'd most likely want to go in and edit my username right away to something I could actually remember (even though I've already added the option of users to be able to use their emails instead using Michael Richey's useful authentication plugin).

So, here's what you do if you want to enable your users to be able to change their username in Joomla 2.5:

  1. First, open up components/com_users/models/forms/profile.xml go to line 28 and change where it says:
    readonly="true"
    So that it says:
    readonly="false"
  2. Second, open up components/com_users/models/profile.php go to line 230 and comment out this line:
    unset($data['username']); 
    By adding two forward slashes to the beginning of that line:
    //unset($data['username']); 

Here are a few screenshots demonstrating the corrected files:

01 allow username changes in joomla
Step 1 - Change username readonly attribute to false

02 allow username changes in joomla
Step 2 - Comment out line which disables username changes