Fix: Always allow changing of username in backend

17 years 8 months ago #18369 by euro22
I do not want users to change their username in the frontend but the admin should ALWAYS be able to change a username in the backend:

Patch cb.core.php line 169 from

[code:1] IF(($ueConfig["usernameedit"]==1) or ($user->username==""«»)) {
$return .= "<input class=\"inputbox\" type=\"text\" size=\"40\" name=\"username\" value=\"".htmlspecialchars($user->username)."\" />";
$return .= getFieldIcons($ui, true,($ueConfig["name_format"]!=1),sprintf( _VALID_AZ09, _UE_UNAME, 2 ) , _UE_UNAME.":"«»);
} else {
$return .= $user->username;
$return .= "<input class=\"inputbox\" type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($user->username)."\" />";
}
[/code:1]

to

[code:1] IF(($ueConfig["usernameedit"]==1) or ($user->username==""«») or ($ui==2)) {
$return .= "<input class=\"inputbox\" type=\"text\" size=\"40\" name=\"username\" value=\"".htmlspecialchars($user->username)."\" />";
$return .= getFieldIcons($ui, true,($ueConfig["name_format"]!=1),sprintf( _VALID_AZ09, _UE_UNAME, 2 ) , _UE_UNAME.":"«»);
} else {
$return .= $user->username;
$return .= "<input class=\"inputbox\" type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($user->username)."\" />";
}
[/code:1]

That's all...

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.141 seconds

Facebook Twitter LinkedIn