Initial commit
[2ch-be.git] / dev-test / old_dev / test / login.php
blob0d520010ef9a54223a28f5bbffff0ec1e7eaba9f
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="Shift_JIS">
5 </head>
6 <body>
7 <?php
8 include('../encrypt.php');
9 $g = $_POST;
10 if(count($g)>1){
11 $err = false;
12 if (isset($g['m']) && !empty($g['m']) && !empty($g['p'])) {
13 $email = filter_var($g['m'], FILTER_SANITIZE_EMAIL);
14 if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
15 exit;
17 $pass = filter_var($g['p'], FILTER_SANITIZE_STRING);
18 $email = strip_tags(addslashes($email));
19 $pass = strip_tags(addslashes($pass));
21 $fdir = substr($email, 0, 1);
22 $sdir = substr($email, 1, 1);
23 $data = @file(DB_PATH."$fdir/$sdir/$email");
25 if(count($data)>3) {
26 for ($i=0; $i < count($data); $i++) {
27 $data[$i] = trim($data[$i]);
29 $inputpass = md5($pass."kahitanupo");
30 if ($inputpass != $data[2]) {
31 $inputpass = hash("sha256", $pass."kahitanupo");
32 if ($inputpass != $data[2]) {
33 $err = true;
35 //echo "Invalid Password";
37 if($err == false) {
38 foreach($_COOKIE as $ky => $vl){
39 setcookie($ky,"",time()-3600);
42 $DMDM = Encrypt($email,KEY);
43 $MDMD = Encrypt($pass,KEY);
44 if($_SERVER['SERVER_NAME'] == "be.2ch.net") {
45 setcookie('DMDM',$DMDM,0,'/',".2ch.net"); //
46 setcookie('MDMD',$MDMD,0,'/',".2ch.net"); //
47 } elseif ($_SERVER['SERVER_NAME'] == "be.bbspink.com") {
48 setcookie('DMDM',$DMDM,0,'/',".bbspink.com"); //
49 setcookie('MDMD',$MDMD,0,'/',".bbspink.com"); //
51 } else {
52 echo "–³Œø‚ȃpƒXƒ��[ƒh";
54 } else {
55 echo "ƒ†�[ƒU�[‚Í‘¶�Ý‚µ‚Ü‚¹‚ñ";
57 } else {
58 echo "‚±‚±‚ÅŒ©‚é‚à‚͉̂½‚à‚È‚¢";
62 </body>
63 </html>