2 include('encrypt_artist.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
);
15 $email = strip_tags(addslashes($email));
16 $pass = strip_tags(addslashes($pass));
18 if(!preg_match("/[a-z0-9 \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\]\^\_\{\}\|\~]{4,32}+/i",$pass)) {
19 //echo "Invalid password!";
23 $fdir = substr($email, 0, 1);
24 $sdir = substr($email, 1, 1);
25 $data = @file
(ADBD_PATH
."$fdir/$sdir/$email/info.txt");
26 /*echo ADBD_PATH."$fdir/$sdir/$email/info.txt<br>";
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]) {
36 $incpa = "Wrong Password!";
41 if (isset($data[count($data)-1]) && $data[count($data)-1]== FORGOT
) {
42 unset($data[count($data)-1]);
43 $writeData = implode("\n", $data);
44 file_put_contents(ADBD_PATH
."$fdir/$sdir/$email/info.txt", $writeData);
46 foreach($_COOKIE as $ky => $vl){
47 setcookie($ky,"",time()-3600);
49 $ADMDM = Encrypt($email,AKEY
);
50 $AMDMD = Encrypt($pass,AKEY
);
51 if($_SERVER['SERVER_NAME'] == "be.2ch.net") {
52 setcookie('ADMDM',$ADMDM,0,'/',".2ch.net"); //
53 setcookie('AMDMD',$AMDMD,0,'/',".2ch.net"); //
54 } elseif ($_SERVER['SERVER_NAME'] == "be.bbspink.com") {
55 setcookie('ADMDM',$ADMDM,0,'/',".bbspink.com"); //
56 setcookie('AMDMD',$AMDMD,0,'/',".bbspink.com"); //
58 /*$_SESSION['sLoggedDir'] = loggedEmail($email, MDB_PATH);*/
59 $_SESSION['utype'] = trim($data[3]);
60 $_SESSION['artistid'] = trim($data[0]);
61 $_SESSION['aname'] = trim($data[1]);
64 header('location:artist.php');
67 echo "Error: User Doesn't Exists!";