Registering via sql

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
User avatar
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: Registering via sql

Post by espicom » Fri Dec 26, 2008 5:14 pm

Did you, by chance, remember to increase the size of the user name box on your forms to match the length of email addresses? Your user that was inserted earlier has the address 'loiretemploi@loiretemploi.com', while the query is looking for the address 'loiretemploi@loiretemploi'... missing the .com portion of the address. These won't find each other...

'loiretemploi@loiretemploi' happens to be 25 characters long, which is the maximum length for a user name in the database, and some templates will not allow the entry of more than 25 characters in that field.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

vince_45
Registered User
Posts: 11
Joined: Thu Jun 05, 2008 9:10 pm

Re: Registering via sql

Post by vince_45 » Sat Dec 27, 2008 6:22 pm

Hello !

It seems to be the answer to my issue, thank you very much !
I have modified the email address to shorter it under 25 characters and I succeded in connecting !

I am not able to modify my code right now today but think I will juste change the : size="" parameter of the username field.
Do you know the value I have to seize ? I assume it is the user_password length in the database ?
And what about the maxlength parmeter for the username field ? Why isn't it 25 as the size ? Is there a reason ?

Code: Select all

<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
  <tr>
	<th height="25" class="thHead" nowrap><font color="#FF7800">Veuillez entrer votre nom d'utilisateur et votre mot de passe pour vous connecter.</font></th>
  </tr>
  <tr>
	<td class="row1"><table border="0" cellpadding="3" cellspacing="1" width="100%">
		  <tr>
			<td colspan="2" align="center">&nbsp;</td>
		  </tr>
		  <tr>
			<td width="45%" align="right"><span class="gen"><font color="#656551">Nom d'utilisateur:</font></span></td>
			<td>
			  <input type="text" class="post" name="username" size="25" maxlength="40" value="" />
			</td>
		  </tr>
Thank you very much again !

Vince

User avatar
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: Registering via sql

Post by espicom » Sat Dec 27, 2008 8:43 pm

The maxlen field should match the length assigned to the user_email field, allowing for any special character encodings. That means 255 characters should be allowed.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

vince_45
Registered User
Posts: 11
Joined: Thu Jun 05, 2008 9:10 pm

Re: Registering via sql

Post by vince_45 » Mon Dec 29, 2008 10:45 am

Hello,

I changed the size parameter to 50 instead of 25 in the login_body.tpl file :

Code: Select all

<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
  <tr> 
	<th height="25" class="thHead" nowrap><font color="#FF7800">{L_ENTER_PASSWORD}</font></th>
  </tr>
  <tr> 
	<td class="row1"><table border="0" cellpadding="3" cellspacing="1" width="100%">
		  <tr> 
			<td colspan="2" align="center">&nbsp;</td>
		  </tr>
		  <tr> 
			<td width="45%" align="right"><span class="gen"><font color="#656551">{L_USERNAME}:</font></span></td>
			<td> 
			  <input type="text" class="post" name="username" size="50" maxlength="40" value="{USERNAME}" />
			</td>
		  </tr>
		  <tr> 
But it seems that the length is limited somewhere else aslo..

See the debbug report hereunder (after setting the size at 50 of course) :

Code: Select all

'cpoligny@yahoo.fr' / 'xxxxxx' 
'SELECT user_id, user_email, user_password, user_active, user_level, user_login_tries, user_last_login_try
			FROM phpbb_users
			WHERE user_email = 'cpoligny@yahoo.fr''
Array
(
    [user_id] => 4
    [user_email] => cpoligny@yahoo.fr
    [user_password] => aade86c627bef71f7c0ea9991e5aa268
    [user_active] => 1
    [user_level] => 0
    [user_login_tries] => 0
    [user_last_login_try] => 0
)

'loiretemploi@loiretemploi' / 'xxxxxx' 
'SELECT user_id, user_email, user_password, user_active, user_level, user_login_tries, user_last_login_try
			FROM phpbb_users
			WHERE user_email = 'loiretemploi@loiretemploi''

Do you know where I have to make this modification too ?

Thank you very much,

Vince
Last edited by Brf on Sat Jan 03, 2009 1:23 pm, edited 1 time in total.
Reason: Removed passwords

User avatar
espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: Registering via sql

Post by espicom » Mon Dec 29, 2008 5:23 pm

in includes/functions.php, the function phpbb_clean_username() truncates the username to 25 characters, so you'll want to expand that, too.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

vince_45
Registered User
Posts: 11
Joined: Thu Jun 05, 2008 9:10 pm

Re: Registering via sql

Post by vince_45 » Mon Dec 29, 2008 5:39 pm

Just working perfectly now !

Thank you so much again for your time and "commitment" !

Vince

Locked

Return to “2.0.x Support Forum”

Who is online

Users browsing this forum: No registered users and 27 guests