dadamssg87 Posted December 18, 2011 Share Posted December 18, 2011 Can someone suggest a way i can incorporate an admin password to access all accounts of my app? I'm hardcoding it right now but i know thats a bad idea. Should i create a db table just for this? hardcode it another file and then include that file? Link to comment https://forums.phpfreaks.com/topic/253428-alternative-for-hardcoded-admin-password/ Share on other sites More sharing options...
scootstah Posted December 19, 2011 Share Posted December 19, 2011 Do you have or do you plan to have a user login system? If not, then there's nothing wrong with a hard coded password. Just make sure you have secure file permissions. Link to comment https://forums.phpfreaks.com/topic/253428-alternative-for-hardcoded-admin-password/#findComment-1299124 Share on other sites More sharing options...
dadamssg87 Posted December 19, 2011 Author Share Posted December 19, 2011 yes i have a user login system. Link to comment https://forums.phpfreaks.com/topic/253428-alternative-for-hardcoded-admin-password/#findComment-1299141 Share on other sites More sharing options...
scootstah Posted December 19, 2011 Share Posted December 19, 2011 Then why can't you use that? Link to comment https://forums.phpfreaks.com/topic/253428-alternative-for-hardcoded-admin-password/#findComment-1299142 Share on other sites More sharing options...
dadamssg87 Posted December 19, 2011 Author Share Posted December 19, 2011 i don't think i'm being clear enough. My users create accounts in my app. They all have their own password. I have a hardcoded admin password in my code. So if i, or anyone else, inputs the admin password for user's account i/they will gain access. This way i don't have to know all of my user's passwords. Since hardcoding passwords is generally a bad idea, i'm trying to figure out a good way to do this. Link to comment https://forums.phpfreaks.com/topic/253428-alternative-for-hardcoded-admin-password/#findComment-1299368 Share on other sites More sharing options...
Philip Posted December 19, 2011 Share Posted December 19, 2011 So, you basically have a master password that when entered will allow you to login to any account? I kinda think you're going about this wrong. Sure, that is one way of doing it, but personally I would leverage the database to do this. Setup your DB to have user levels/permissions. Once you do this, you can set it up to where your clients can only see their own account, but you can edit/access their account (for good purposes I'd hope.) Link to comment https://forums.phpfreaks.com/topic/253428-alternative-for-hardcoded-admin-password/#findComment-1299371 Share on other sites More sharing options...
scootstah Posted December 19, 2011 Share Posted December 19, 2011 Since hardcoding passwords is generally a bad idea I'd like to know your reasoning behind this. Link to comment https://forums.phpfreaks.com/topic/253428-alternative-for-hardcoded-admin-password/#findComment-1299379 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.