매우 기밀 한 사이트에 로그인 할 수있는 매우 기밀 한 사이트가 있습니다. 사용자가 3 회 로그인 시도를했는지 확인하려면 어떻게해야합니까? 내 디렉토리에서 전체 디렉토리가 삭제됩니다. 이 일을하기가 어렵습니까?로그인 시도가 최대에 도달하면 전체 사이트 디렉토리를 삭제하는 방법
여기 내 로그인 페이지입니다 :
<?php
require_once('scripts/user_authentication.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href='http://fonts.googleapis.com/css?family=Inder' rel='stylesheet' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Access login</title>
<link href="../styles/users.css" rel="stylesheet" type="text/css" />
<style>
span {font-family: 'Inder', sans-serif; color: #369; font-style: italic;}
#login {width: 400px; margin: 60px auto 0 auto; padding: 20px; text-align: center;
box-shadow: 0px 9px 21px rgba(0, 0, 0, 0.63);
-moz-box-shadow: 0px 9px 21px rgba(0, 0, 0, 0.63);
-webkit-box-shadow: 0px 9px 21px rgba(0, 0, 0, 0.63);
}
#login p {text-align: left;}
form {padding: 0; margin: 0; }
input {margin: 0; padding: 0;}
h1 { margin: 0 0 20px 0; padding: 0;}
</style>
</head>
<body>
<div id="login">
<h1><span>p*******</span> Partners Only</h1>
<div id="inner">
<?php if ($failed) { ?>
<p class="warning">Login failed. Try Again. Please contact ******* ***** if you do not know your access information. After multiple attempts this site will self destruct. Thank you for your cooperation.</p>
<?php } ?>
<form id="form1" name="form1" method="POST">
<p>
<label for="username">Username:</label>
<input type="text" name="username" id="username" />
</p>
<p>
<label for="password">Password:</label>
<input type="password" name="password" id="password" />
</p>
<p>
<input type="submit" name="signin" id="signin" value="Sign in" />
</p>
</form>
</div>
</div>
</body>
</html>
여기 user_authentication : 그것은 매우 위험 코멘트에 언급 된 사람들이 그 일을
<?php
$failed = FALSE;
if ($_POST) {
if (empty($_POST['username']) || empty($_POST['password'])) {
$failed = TRUE;
} else {
require_once('library.php');
// check the user's credentials
try {
$auth = Zend_Auth::getInstance();
$adapter = new Zend_Auth_Adapter_DbTable($dbRead, 'users', 'first_name', 'family_name', 'password' 'sha1(?)');
$adapter->setIdentity($_POST['username']);
$adapter->setCredential($_POST['password']);
$result = $auth->authenticate($adapter);
if ($result->isValid()) {
$storage = $auth->getStorage();
$storage->write($adapter->getResultRowObject(array(
'username', 'first_name', 'family_name')));
header('Location: members_only.php');
exit;
} else {
$failed = TRUE;
}
} catch (Exception $e) {
echo $e->getMessage();
}
}
}
if (isset($_GET['logout'])) {
require_once('library.php');
try {
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
} catch (Exception $e) {
echo $e->getMessage();
}
}
왜 당신이 디렉토리를 삭제할 것 액세스 할 계정을 잠그고 실제 사용자에 대한 보안 절차를 대답해야? 사용자가 비밀번호를 잊어 버린 경우 또는 다른 사용자가 사용자 이름을 사용하여 페이지에 액세스하려고한다면 어떻게해야합니까? – Virendra
이것은 매우 위험한 접근 방법입니다. 공격자가 서버에서 물건을 삭제하면 실제 사용자가 액세스 할 수 없게됩니다. –
URL을 게시하면 다른 사람들이 테스트 해 줄 것이라고 확신합니다.) – Ram