Jeg vil gerne sikre min admin, så jeg har brugt følgende kode:
Quick Setup of Admin Authentication.
// Open /admin/includes/application_top.php add the following code in
// include authentication user/password of administration
require(DIR_WS_INCLUDES . 'authen.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;
}
}
?>
Problemet er bare at jeg ikke kan logge på, jeg har ændret admin og mypasword teksten med det jeg vil bruge men det virker ikk. Er der andet i teksten jeg skal ændre?
Hilsen
Schellerup