DemoTiger Posted January 29, 2018 Share Posted January 29, 2018 Hello, I wish to add admin password verification which will required to enter admin password on a page to access addon page like mycustomaddon.php in admin area. Same as we enter password verification in "Admin >> Configuration". Which code I need to use in my addon to do this? Please help. WHMCS 7.x Thanks, Kunnu Link to comment Share on other sites More sharing options...
sentq Posted January 29, 2018 Share Posted January 29, 2018 use this API function to decrypt admin password saved into database, then compare it with the entered password 1 Link to comment Share on other sites More sharing options...
twhiting9275 Posted January 29, 2018 Share Posted January 29, 2018 (edited) Alternatively, you can just verify if the browser is an admin. This is a less intrusive approach. The only time you really want to verify the admin password is if you're changing global, or user settings. Here's how you can do this, pretty simple, with php $isadmin = $_SESSION['adminid']; if (empty($isadmin)) { $msg = "You're no administrative user"; die($msg); } Edited January 29, 2018 by twhiting9275 1 Link to comment Share on other sites More sharing options...
Recommended Posts