|
аутентификация - Помогите люди добрые, Help, SOS!
|
|||
---|---|---|---|
#18+
Есть классный скрипт аутентификации пользователя для страницы, работает чудесно, но вот заставить работать его с паролями из MySQL у меня не получилось. Помогите люди добрые, Help, SOS! Как его заставить обрабатывать пароли из MySQL? --------------------------------------------------------------- <?php $selfSecure = 1; $shellUser = 'test'; $shellPswd = '123'; $adminEmail = "etw@mail.ru"; $fromEmail = $HTTP_SERVER_VARS["localhost"]; $Version = "Your details here (for example The Webmaster - etw@mail.ru)"; if($selfSecure){ if (($PHP_AUTH_USER!=$shellUser)||($PHP_AUTH_PW!=$shellPswd)) { Header('WWW-Authenticate: Basic realm="MCE Web ADMIN only!"'); Header('HTTP/1.0 401 Unauthorized'); echo "<html> <head> <title>Error - Access Denied</title> </head> <h1>Access denied</h1> A warning message has been sent to the webmaster. Your IP address has also been recorded <hr> <em>$Version</em>"; if(isset($PHP_AUTH_USER)){ $warnMsg =" Somebody tried to access the script on: http://".$HTTP_SERVER_VARS["HTTP_HOST"]."$PHP_SELF using the wrong username or password: Date: ".date("Y-m-d H:i:s")." IP: ".$HTTP_SERVER_VARS["REMOTE_ADDR"]." User Agent: ".$HTTP_SERVER_VARS["HTTP_USER_AGENT"]." username used: $PHP_AUTH_USER password used: $PHP_AUTH_PW "; mail($adminEmail,"Unauthorized Access",$warnMsg, "From: $fromEmail\nX-Mailer:$Version AutoWarn System"); } exit; } } if(!$oCols)$oCols=$termCols; if(!$oRows)$oRows=$termRows; ?> ... |
|||
:
Нравится:
Не нравится:
|
|||
11.10.2003, 21:42 |
|
|
start [/forum/topic.php?fid=23&fpage=525&tid=1480322]: |
0ms |
get settings: |
8ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
71ms |
get topic data: |
12ms |
get forum data: |
2ms |
get page messages: |
35ms |
get tp. blocked users: |
2ms |
others: | 13ms |
total: | 161ms |
0 / 0 |