PDA

View Full Version : Checking Vbulletin username for db access


ixian
02-21-2002, 04:40 AM
Howdy,

First of all, my license information is stored in my profile and I am a fully paid up and legal user. I see requests for this all the time so I thought I'd mention it:)

Here's what I'd like to do:

I am so-so at mySQL and PHP. I have created a separate database called adminmod for game server authentication, and a php page where users can enter their information so it gets stored in said database.

First off, I want to restrict this page so ONLY registered forum members can read it. This part is no problem - I already know the php code ( if ($bbyuserinfo[' userid'] - etc, etc) that restricts access that way. I got that down and use that for other areas of my site already.

Here's where it gets tricky.

Once a registered member enters their information on the page, I don't want them to be able to come back willy-nilly and keep adding in more usernames. They get one game server registration per forum membership. So I need to do more than simply verify they are members.

I was thinking that if, when someone registered (there are three fields in the table - username, wonid, and clan), the page automatically grabbed their forum username and insterted it into a row in the same table in the adminmod database, then if that same person tried to register again, I could do a db lookup that saw that FORUM username was already in the database and deny registration.

I imagine this would work - but I am too much of a n00b to figure it out:) Through lots of reseach and flipping through manuals I managed to get this far, but now I am stuck.

Could any mySQL/php guru's out there help me? I'd even be willing to pay cash for your time, or buy you an Amazon gift certificate or something. I need the actual syntax that I can put in the php page that:

grabs forum username (without user intervention - obviously, some fine folks would enter in different names to bypass the system if they had the option)
checks to see if it's in specified table/row in db
denies submission if it is
inserts it into specified table/row in db if it isn't

Any takers?

Thanks!

ixian
02-22-2002, 03:44 PM
**edited**

Ok, let's try this. Instead of me trying to be super-clever, I have gone to the basics.

Rather than create a whole new database, I've simply added some new tables to the vbulletin one to store the extra information I need. This, I found, makes intergrating it into the rest of my site much easier, among other things.

So here's what I need to know how to do:

On my game registration page, I have it set to check and make sure the person trying to access it is already a registered member of the site (they get the error_noregistration template if not). If they are, they are allowed to fill out the form with their game nickname, clan tag, etc. This then goes into the new tables I made and all is well.

What I need to do now is figure out how to stop them from registering if they have already done so. I figure - and I could be wrong here - that if I can set some sort of flag that tags a FORUM username as having already entered information into the game server table, I am set. Maybe a row in, say, the game server username table I created for the above that holds a bit - 0 for forum user has not entered information, 1 for they have - and it checks it before submission is allowed....?

Any ideas?

Thanks!