2 include('encrypt.php');
7 if (isset($g['mail']) && !empty($g['mail']) && !empty($g['pass'])) {
9 $email = filter_var($g['mail'], FILTER_SANITIZE_EMAIL
);
10 if (!filter_var($email, FILTER_VALIDATE_EMAIL
)) {
11 //echo "Invalid email";
14 $pass = filter_var($g['pass'], FILTER_SANITIZE_STRING
);
16 $email = strip_tags(addslashes($email));
17 $pass = strip_tags(addslashes($pass));
19 if(!preg_match("/[a-z0-9 \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\]\^\_\{\}\|\~]{4,32}+/i",$pass)) {
24 $fdir = substr($email, 0, 1);
25 $sdir = substr($email, 1, 1);
26 $data = @file
(DB_PATH
."$fdir/$sdir/$email");
29 for ($i=0; $i < count($data); $i++
) {
30 $data[$i] = trim($data[$i]);
32 $inputpass = md5($pass."kahitanupo");
33 if ($inputpass != $data[2]) {
34 $inputpass = hash("sha256", $pass."kahitanupo");
35 if ($inputpass != $data[2]) {
41 if (isset($data[count($data)-1]) && $data[count($data)-1]== FORGOT
) {
42 unset($data[count($data)-1]);
43 $writeData = implode("\n", $data);
44 //$writeData = $data[0]."\n".$data[1]."\n".$data[2]."\n".$data[3]."\n".$data[4]."\n".$data[5]."\n";
45 file_put_contents(DB_PATH
."$fdir/$sdir/$email", $writeData);
47 foreach($_COOKIE as $ky => $vl){
48 setcookie($ky,"",time()-3600);
50 $DMDM = Encrypt($email,KEY
);
51 $MDMD = Encrypt($pass,KEY
);
53 echo "DMDM=" . $DMDM . ";MDMD=" . $MDMD;
54 // setcookie('DMDM',$DMDM,0,'/',".2ch.net");
55 // setcookie('MDMD',$MDMD,0,'/',".2ch.net");
56 $_SESSION['sLoggedDir'] = loggedEmail($email, MDB_PATH
);
63 // echo "ユーザーは存在しません";