This topic is locked
[SOLVED]

 Registration

12/15/2010 8:05:15 PM
PHPRunner General questions
V
vettold author

I have a registration form but I cannot figure out how to restrict a successful registrant from seeing and editing only their records. I assume I will need a field that is unique to only their records, such as account number and last name. Right now if they enter a username, password, last name, email and customer number into the registration form and they enter the wrong customer number they will be allowed to view and edit the records of the wrong customer number. So I guess what I am looking for is a way to settle this during registration. Maybe if there is a way to code the registration form so that the customer number and the last name associated with it are correct? Great program. I am not good at code but without this program I am dead in the water. Thanks

Sergey Kornilov admin 12/16/2010

I would suggest to add a new field to registration table (INT, AUTOINCREMENT) and make it a primary key. Do not add this field to the registration form, database will fill this field automatically when new users registers.
Use this field as an OwnerID when you setup 'Users can see and edit their own data only'. Since users are not able to control this field your system is going to be perfectly secure.

V
vettold author 12/16/2010

I am starting to understand, I will give you my senario.
I have a customer table with 1000 customers with 10 fields which hold their personal data.

I have a users table with the following fields:
1.username

2. password

3.customer number

4.last name

5.zipcode

6.email
the reason for so many is that i was trying to figure out a way to restrict them from access to other customers account info.

I would prefer to have just the following. I guess what my problem is i do not understand how autoincrement will keep one user from seeing another users info if they enter the wrong customer number.
1.username

2.password

3.email

4.customer number
If a user puts in the wrong customer number what stops him from seeing that customers info? Thanks

Sergey Kornilov admin 12/16/2010

The point is to use that new AUTOINCREMENT field as an OwnerID. User cannot change or enter the value of this field manually and cannot see other users data.
There is another thing that I don't understand. If you saying you already have a table with customers data - why do you need them to register?

V
vettold author 12/17/2010

I am getting closer with the viewing of the online tutorial re: setting up security.
Maybe this will shed some light on what I am doing.
You get a new discover card and the bank has info on your acct such as name, address, account number, social security etc.
Now you want to sign up for online banking.
You cannot register unless you give them your correct account number and social security number etc.
That is what I am trying to do with my company. I have a database with all of their info and I want them to be able to go online and register, but they must provide me with a correct customer number, and lets say last name and then i also want their email address. then when they login they see their info only.
right now with what I have accomplished I can register and then login to anyones account, using anyones customer number. I do not quite get how to make the registration process let a customer register for only their acct.
thanks in advance!

Sergey Kornilov admin 12/17/2010

Here is how I see it.
Since you already have your database with customers you can get away dropping registration page all together. Use Customers table as a Login table, Lastname/CustomerNo as username/password. To prevent malicious users from brutforcing possible customer number and last names turn on 'Block IP address after three unsuccessful login attempts' option. You may want to add an email address field to Customers table so users can fill it.
More advanced option. Create a separate login table with fields like email address, first name, last name, customer number, zipcode etc. Once user registers you can automatically verify all data against Customers table and if it matches "unlock" user account.
This scenario requires a bit of coding to prevent "locked" users from logging in.

V
vettold author 12/18/2010

Thanks for the help, your first suggestion in your last post will work. I have it implemented and working just fine. thanks again.