Jump to content

Set up logins


xionhack

Recommended Posts

Hello. I have a little coding dilema. I am making an application, but i think i better explain by an example.

 

I have to make different logins for people at my job. Lets say "login 1", "login 2", "login 3", "login 4" and "login 5". Not everybody needs those logins, some people only need "login 1" or "login 2" and "login 3".

 

There is one person that says the name of the employee and which logins he needs. Another person sets up the logins.  I have a form for the first person where he can write the name of the person and have 5 checkboxes for the different logins. The second person would get the name of the person and the id and password box for every login.

 

The way I have it set up right now is that the table has the following:

 

id

employee_name

needs_login1

login_1_id

login_1_ps

needs_login2

login_2_id

login_2_ps

needs_login3

login_3_id

login_3_ps

needs_login4

login_4_id

login_4_ps

needs_login5

login_5_id

login_5_ps

 

Meaning, if needs_login1 is equal to 1 then show the boxes for login_1_id and login_1_ps. It does that through a couple of if statements. I find my way very messy. What would be the best way to do this? let me know if you dont understand. Thank you.

 

 

Link to comment
https://forums.phpfreaks.com/topic/207843-set-up-logins/
Share on other sites

No, its not really set permissions. Lets say, I have to set up accounts for hotmail, gmail, yahoo for everybody. Then I just want to store them in the database. One person would say "this employee needs hotmail" the other person will set up the hotmail account and store the credentials there. But I want that if the person to be set up only needs hotmail, that the person that is setting him up only has the input boxes for the hotmail credentials.

Link to comment
https://forums.phpfreaks.com/topic/207843-set-up-logins/#findComment-1086530
Share on other sites

thats about the easiest thing you can do then as far as i can tell. but if you wanted you could get rid of all the columns that are telling if they active or not and just do error checking to see if like hotmail has anything in it and yahoo. and if they are blank then exclude them from being posted. other than that i think you got it pretty good.

Link to comment
https://forums.phpfreaks.com/topic/207843-set-up-logins/#findComment-1086563
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.