BOTは登録やログイン出来ないように
このコミットが含まれているのは:
コミット
1ad6c5f353
|
@ -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' => 'ユーザ名は既に登録しています。');
|
||||
|
|
新しいイシューから参照