Initial commit
[2ch-be.git] / dev-test / old / test / login.php
blobd542e45e72e9c16b6699c73a83514fba81508411
1 <?php
2 include('../encrypt.php');
3 $g = $_POST;
4 if(count($g)>1){
5 if (isset($g['m']) && !empty($g['m']) && !empty($g['p'])) {
6 $email = filter_var($g['m'], FILTER_SANITIZE_EMAIL);
7 if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
8 exit;
10 $pass = filter_var($g['p'], FILTER_SANITIZE_STRING);
12 $email = strip_tags(addslashes($email));
13 $pass = strip_tags(addslashes($pass));
15 $fdir = substr($email, 0, 1);
16 $sdir = substr($email, 1, 1);
17 $data = @file(DB_PATH."$fdir/$sdir/$email");
19 if(count($data)>3) {
20 for ($i=0; $i < count($data); $i++) {
21 $data[$i] = trim($data[$i]);
23 $inputpass = md5($pass."kahitanupo");
24 if ($inputpass != $data[2]) {
25 echo "Invalid Password";
26 } else {
28 foreach($_COOKIE as $ky => $vl){
29 setcookie($ky,"",time()-3600);
32 $DMDM = Encrypt($email,KEY);
33 $MDMD = Encrypt($pass,KEY);
34 setcookie('DMDM',$DMDM,0,'/',".2ch.net");
35 setcookie('MDMD',$MDMD,0,'/',".2ch.net");
36 //header('location:status.php');
38 } else {
39 echo "ユーザーは存在しません";
42 } else {
43 echo "無効な詳細";