I decided to move this back to this post in case anyone else runs across this problem. Thus far we've found no problems in the code and have tried running a variable test to see what's being passed for the username.
So I added the following to admin_users.php:
Code: Select all
define('IN_PHPBB', 1);
if ( ( isset($HTTP_POST_VARS['user_name']) ) & ( !isset($HTTP_POST_VARS['username']) ) )
{
$HTTP_POST_VARS['username'] = $HTTP_POST_VARS['user_name'];
}
// testing the username variables
echo ("user_name: " . $HTTP_POST_VARS['user_name'] . "; username: " . $HTTP_POST_VARS['username']);
No matter what mode was set to (whether I was editing, saving or whatever), both of these variables came back blank.
So I thought perhaps it would be a good idea to try something a little different and added some javascript to send the value of $user_name to $username in the template:
Code: Select all
<script language="jscript" type="text/jscript">
<!--
function getUserName() {
form.username.value = form.user_name.value;
}
//-->
</script>
<form action="{S_PROFILE_ACTION}" {S_FORM_ENCTYPE} method="post" onsubmit="getUserName()"><table width="98%" cellspacing="1" cellpadding="4" border="0" align="center" class="forumline">
<tr>
<th class="thHead" colspan="2">{L_REGISTRATION_INFO}</th>
</tr>
<tr>
<td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
</tr>
<tr>
<td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
<td class="row2">
<input class="post" type="text" name="user_name" size="35" maxlength="40" value="{USERNAME}" />
<input type="hidden" name="username" value="" />
I now get an error that this username is already taken. As I'm writing this, I'm thinking that this has been something discussed already in this thread, so I'll go back and investigate. But there's the latest.
EDIT: I think I know why I'm getting that error. It could be because it's not properly setting the "username" field with what's in "user_name", so it's sending the $username variable as being empty. Since I'm completely behind in my JavaScript (prolly been about 6 years since I've last used it) I can't think of anything else to do.