Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
Joined: Feb 2003
Posts: 64
I recently converted my vBulletin board to UBBT successfully, but now I'm running into a minor, but annoying issue.

vBulletin allowed usernames with whitespace in them, UBBT does not. All of my vBulletin users were inserted into my UBBT boards, even the ones with whitespace in their usernames, but now those members (the ones with whitespace in their usernames) are unable to login. I've been fixing this on a case-by-case basis through phpmyadmin (going into the db and removing the whitespace) but it's starting to spiral out of control.

My question is: is there a way to run a query on the database that will look for whitespace in a username and remove it (just putting the two words together, i.e. joe smith to joesmith)? This way I can just send out a mass email letting everyone know that if their username contained a whitespace, it no longer does.

Any help would be apprectiated.

JL

Sponsored Links
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
I don't think you can do that with a single query. It would probably require a short PHP script.

I don't understand why you're having this problem. When I imported from UBB.classic, there were lots of usernames with whitespace, and that didn't cause any login problems. As far as I know, the syntax checking on usernames is only done when a new user registers, or when an existing user edits his profile and changes his display name.

I've since hacked my board to allow whitespace in usernames, but that's a different issue.

Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
Joined: Feb 2003
Posts: 64
I had just assumed that this was the issue becuase I've only received login problem emails from users with whitespace in their names. Then once I remove the whitespace, they don't have problems logging in.

Can you tell me how to hack the board to allow whitespace in usernames? Maybe that will solve the issue.

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Here's my modified syntax checking in adduser.php. There's a similar change in changebasic.php for editing display names.

Code
$bad_name_message = 'Your name may contain only letters (A-Z, a-z),<br />   numbers (0-9), underscore (_), period (.), hyphen (-) and space ( ).<br />   The first and last character must be a letter or number.';<br /><br />preg_replace('/ {2,}/', ' ', $Loginname); // squash spaces<br />if (!preg_match("/^[A-Za-z0-9][\w .-]*[A-Za-z0-9]$/",$Loginname)) {<br />   $html -> not_right($bad_name_message,$Cat);<br />} <br /><br />preg_replace('/ {2,}/', ' ', $Displayname); // squash spaces<br />if (!preg_match("/^[A-Za-z0-9][\w .-]*[A-Za-z0-9]$/",$Displayname)) {<br />   $html -> not_right($bad_name_message,$Cat);<br />}


But this has nothing to do with logging in, so I'd be surprised if it solved your problem. Is it possible that the vB imported messed up something else? Or could it be a cookie problem?

Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
Is 6.2 completely using user numbers now in all tables?

I'd only suggest trying this if no one finds a flaw in this suggestion and you have a test board setup to test this on first.

This should show you people that have spaces:

select U_Username, U_LoginName from w3t_Users where U_Username LIKE "% %" OR U_LoginName LIKE "% %"

This should show you the results of replacing:

select U_Username, U_LoginName, REPLACE(U_LoginName," ","") as Changed_LoginName, REPLACE(U_Username," ","") as Changed_Username from w3t_Users where U_Username LIKE "% %" OR U_LoginName LIKE "% %"

This would execute the update to replace login names:
(Assuming the above queries replace names correctly)

update w3t_Users set U_LoginName=REPLACE(U_LoginName," ","") where U_LoginName LIKE "% %"

You would repeat that for U_Username too.

I used a similar update to replace the image path used in uploaded avatars, and just copied that over here. If usernames are still used in other tables then this would cause problems.

Sponsored Links
Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
Joined: Feb 2003
Posts: 64
I don't think that I'm even going to mess with this. I thought that there might be some easy workaround, but it's gettting a little too complex for me (plus, I'd rather deal with it on a case-by-case basis than crash my whole db).

Dave, you may be right that the import messed something up or it could be a cookie problem. I'll investigate a little further into both of these items.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Do you have the option to "allow special characters" turned on in the config file? If that were off... it might be messing up folks logging in.

Joined: Feb 2003
Posts: 64
Power User
Power User
Offline
Joined: Feb 2003
Posts: 64
Actually, Josh, no I didn't have it turned on. Thanks for bringing it to my attention. I just enabled it, so I'll see how it goes.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)