davidbkoi Posted November 30, 2004 Share Posted November 30, 2004 Hi, I am trying to password my admin area. My ISP has told me I cannot use the .htaccess route as I am using SSL. I am using one of the contributions which gave me the instructions below. When I try and access the admin area, a dialog box promts me for a password, which I enter, but it just returns back to the empty dialog box 3 times then gives a no authorisation message. Any Ideas what I am doing wrong? Quick Setup of Admin Authentication. // Open /admin/includes/application_top.php add the following code in // include authentication user/password of administration $include_file = DIR_WS_INCLUDES . 'authen.php'; include(DIR_WS_INCLUDES . 'include_once.php'); // Open /admin/includes/configure.php and add the following code in // define admin user/password define('ADMIN_USERNAME', 'admin'); define('ADMIN_PASSWORD', 'mypasword'); // Save the following PHP codes as authen.php in /admin/includes/authen.php <?php if(!isset($PHP_AUTH_USER)) { header('WWW-Authenticate: Basic realm="' . TITLE . '"'); header('HTTP/1.0 401 Unauthorized'); echo $SERVER_NAME . ' Authorization Required.'; exit; } else { if (($PHP_AUTH_USER != ADMIN_USERNAME) || ($PHP_AUTH_PW != ADMIN_PASSWORD)) { header('WWW-Authenticate: Basic realm="' . TITLE. '"'); header('HTTP/1.0 401 Unauthorized'); echo $SERVER_NAME . ' Authorization Required.'; exit; } } ?> Link to comment Share on other sites More sharing options...
Guest Posted November 30, 2004 Share Posted November 30, 2004 hmmmmmm, if your host says you cant use htaccess, then it is time to change hosts as they dont know their heads from . .. . anyway you can try the admin access with levels, available in the contribution area. first search on administration in contributions, see if you get what you like Link to comment Share on other sites More sharing options...
Sivik Posted November 30, 2004 Share Posted November 30, 2004 hmmmmmm, if your host says you cant use htaccess, then it is time to change hosts as they dont know their heads from . .. . May be this is windows hosting with IIS instead Apache... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.