xionhack Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
unlishema.wolf Posted July 15, 2010 Share Posted July 15, 2010 are you trying to like set permissions or something close to that. if so you should just have 1 login per person and then set a var that defines their rights/permission. Link to comment https://forums.phpfreaks.com/topic/207843-set-up-logins/#findComment-1086527 Share on other sites More sharing options...
xionhack Posted July 15, 2010 Author Share Posted July 15, 2010 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 More sharing options...
unlishema.wolf Posted July 15, 2010 Share Posted July 15, 2010 ok so what is this website supposed to do now? let them login to their hotmail/yahoo/gmail? Link to comment https://forums.phpfreaks.com/topic/207843-set-up-logins/#findComment-1086548 Share on other sites More sharing options...
xionhack Posted July 15, 2010 Author Share Posted July 15, 2010 No, just store the credentials. Its in two parts. One page to select which credentials the employee needs, and the other page is to write the credentials that were chosen in the first page. Different people will use the different pages. Link to comment https://forums.phpfreaks.com/topic/207843-set-up-logins/#findComment-1086550 Share on other sites More sharing options...
unlishema.wolf Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.