Initial commit
[2ch-be.git] / dev-test / reg.php
blob72cf7ace087a7bd5d05e0f47abe88257c8360686
1 <html lang="en">
2 <head>
3 <meta charset="Shift_JIS">
4 <title>ƒ�ƒOƒCƒ“</title>
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <meta name="description" content="">
7 <meta name="author" content="">
8 <link rel="stylesheet" type="text/css" href="css/style.css"/>
9 </head>
10 <body>
11 <?php
12 include('config.php');
14 function isSharingInfo($email) {
15 $email = trim($email); // in case there's any whitespace
16 return mb_substr($email, -18) === '@notsharingmy.info';
18 if(isSharingInfo($_POST['mail'])){
19 die("“dŽqƒ��[ƒ‹ƒAƒhƒŒƒX‚ª–³Œø‚Å‚·�B <a href='register.php'>�u‘k‚é�v</a>");
22 if (isset($_POST['mail']) && !empty($_POST['mail']) && !empty($_POST['pass']) && !empty($_POST['confpass'])) {
24 $email = trim($_POST['mail']);
25 $pass = trim($_POST['pass']);
26 $confpass= trim($_POST['confpass']);
28 $email = filter_var($email, FILTER_SANITIZE_EMAIL);
29 $pass = filter_var($pass, FILTER_SANITIZE_STRING);
30 $confpass = filter_var($confpass, FILTER_SANITIZE_STRING);
32 if (!filter_var($email, FILTER_VALIDATE_EMAIL)){
33 echo "bad"; exit;}
35 // Sanitize
36 $email = strip_tags(addslashes($email));
37 $pass = strip_tags(addslashes($pass));
38 $confpass = strip_tags(addslashes($confpass));
40 $fdir = substr($email, 0, 1);
41 $sdir = substr($email, 1, 1);
42 $f= array();
43 if(file_exists(DB_PATH."idlist.log")){
44 $f = file(DB_PATH."idlist.log");
46 $tid = rand(11,99).rand(11,99).rand(11,99).rand(11,99).rand(1,9);
47 $myemail="$tid<><>$email"; // NEW ADD
48 while (in_array($myemail, $f)) { // NEW CHANGE
49 $tid = rand(11,99).rand(11,99).rand(11,99).rand(11,99).rand(1,9);
50 $myemail="$tid<><>$email"; // NEW ADD
54 $id = sprintf("%1$09d",$tid);
56 if ($pass != $confpass) {
57 // echo "Error try again";
58 echo "ƒpƒXƒ��[ƒh‚ªˆê’v‚µ‚Ä‚¢‚Ü‚¹‚ñ�B<a href='register.php'>�u‘k‚é�v</a>";
59 exit;
60 }else{
61 if(!preg_match("/[a-z0-9 \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\]\^\_\{\}\|\~]{4,32}+/i",$pass))
62 die("–³Œø‚ȃpƒXƒ��[ƒh! <a href='register.php'>�u‘k‚é�v</a>");
65 // /var/www/db
66 if (!file_exists(DB_PATH."$fdir/$sdir")) {
67 @mkdir(DB_PATH."$fdir");
68 mkdir(DB_PATH."$fdir/$sdir");
71 if (file_exists(DB_PATH."$fdir/$sdir/$email")) {
72 echo "ƒ†�[ƒU�[–¼‚ÍŠù‚É‘¶�Ý‚µ‚Ä‚¢‚Ü‚·�B<a href='register.php'>�u‘k‚é�v</a>";
73 exit;
76 $pass = hash("sha256", $pass."kahitanupo");
77 $writeData = "$id\n$email\n$pass\n0\n0\nnida.gif";
78 file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
79 if (file_exists(DB_PATH."$fdir/$sdir/$email")) {
80 $return = file_get_contents("http://207.29.229.25/zz.php?usname={$email}&npass={$pass}&tkn=gokp5WATBYOovz2S4LKo");
81 if ($return == '1') {
82 $ff = fopen(DB_PATH."idlist.log", "a+");
83 fwrite($ff, $id."<><>".$email."\n"); // NEW CHANGE
84 fclose($ff);
85 echo "BEƒAƒJƒEƒ“ƒg‚Ì“o˜^‚ªŠ®—¹‚µ‚Ü‚µ‚½�B‚ ‚肪‚Æ‚¤‚²‚´‚¢‚Ü‚·�B <a href='index.php'> ‚±‚±‚Ń�ƒOƒCƒ“ </a>";
90 /*if (file_exists(DB_PATH."$fdir/$sdir/$email")) {
91 // SEND MAIL HERE
92 $key = hash("sha256", $email.$pass);
94 $confUrl = urlencode($livesitePath."confirmation.php?e={$email}&k={$key}");
95 $return = file_get_contents("http://207.29.229.25/nmail.php?usname={$email}&npass={$pass}&curl={$confUrl}&tkn=gokp5WATBYOovz2S4LKo");
96 if ($return == '1') {
97 echo "“o˜^‚É�¬Œ÷�Iƒ��[ƒ‹‚ðƒ`ƒFƒbƒN‚µ�AŠm”FƒŠƒ“ƒN‚ðƒNƒŠƒbƒN‚µ‚Ä‚­‚¾‚³‚¢�B<a href='index.php'>�u‚±‚¿‚ç‚ðƒNƒŠƒbƒN ƒ�ƒOƒCƒ“�v</a>";
99 $ff = fopen(DB_PATH."idlist.log", "a+");
100 fwrite($ff, $id."<><>".$email."\n"); // NEW CHANGE
101 fclose($ff);
102 } else {
103 //contact admin
104 // echo Error 2
105 echo "ƒT�[ƒo�[‚ª‰ž“š‚µ‚Ä‚¢‚Ü‚¹‚ñ�BŒã‚Å‚à‚¤ˆê“x‚¨ŽŽ‚µ‚­‚¾‚³‚¢�B <a href='register.php'>�u‘k‚é�v</a>";
108 } else {
109 //user doesnt exist
110 // echo Error 2
111 echo "ƒ†�[ƒU�[‚Í‘¶�Ý‚µ‚Ü‚¹‚ñ <a href='register.php'>�u‘k‚é�v</a>";
114 } else {
115 echo "Error 1";
120 </body>
121 </html>