BOTは登録やログイン出来ないように

このコミットが含まれているのは:
テクニカル諏訪子 2021-07-15 11:04:09 +09:00
コミット 1ad6c5f353
2個のファイルの変更22行の追加0行の削除

ファイルの表示

@ -20,6 +20,17 @@ class Login {
}
public function login (Request $r) {
$banned = DB::table('blg_blacklist')->get();
foreach ($banned as $b) {
$ip = explode('.', getIp());
$ban = explode('.', $b->ipaddress);
if (
($ban[0] == $ip[0] && $ban[1] == $ip[1] && $ban[2] == $ip[2] && $ban[3] == $ip[3]) ||
($ban[0] == $ip[0] && $ban[1] == $ip[1] && $ban[2] == $ip[2] && $ban[3] == '*') ||
($ban[0] == $ip[0] && $ban[1] == $ip[1] && $ban[2] == '*' && $ban[3] == '*')
) return redirect('/bot-trap/');
}
if (!empty($r)) {
$checkName = DB::table('users')->where('username', $r->username)->first();

ファイルの表示

@ -26,6 +26,17 @@ class Register {
public function register (Request $r) {
$ip = $_SERVER['REMOTE_ADDR'];
$banned = DB::table('blg_blacklist')->get();
foreach ($banned as $b) {
$ip = explode('.', $ip);
$ban = explode('.', $b->ipaddress);
if (
($ban[0] == $ip[0] && $ban[1] == $ip[1] && $ban[2] == $ip[2] && $ban[3] == $ip[3]) ||
($ban[0] == $ip[0] && $ban[1] == $ip[1] && $ban[2] == $ip[2] && $ban[3] == '*') ||
($ban[0] == $ip[0] && $ban[1] == $ip[1] && $ban[2] == '*' && $ban[3] == '*')
) return redirect('/bot-trap/');
}
if (!empty($r)) {
$existUser = DB::table('users')->select('id')->where('username', $r->username)->count();
if ($existUser != 0) return array('err' => 'ユーザ名は既に登録しています。');