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? Quote 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. Quote 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. Quote 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? Quote 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. Quote 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.) Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.