Initial commit
[2ch-be.git] / dev-test / rewrite / zzz3.php
blobe7078344bca0908f29ca6c587d8e51312b4d90c1
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('include/config.php');
14 if (isset($_POST['mail']) && !empty($_POST['mail']) && !empty($_POST['pass']) && !empty($_POST['confpass'])) {
16 $email = trim($_POST['mail']);
17 $pass = trim($_POST['pass']);
18 $confpass= trim($_POST['confpass']);
20 $email = filter_var($email, FILTER_SANITIZE_EMAIL);
21 $pass = filter_var($pass, FILTER_SANITIZE_STRING);
22 $confpass = filter_var($confpass, FILTER_SANITIZE_STRING);
24 if (!filter_var($email, FILTER_VALIDATE_EMAIL)){
25 echo "bad"; exit;}
27 // Sanitize
28 $email = strip_tags(addslashes($email));
29 $pass = strip_tags(addslashes($pass));
30 $confpass = strip_tags(addslashes($confpass));
32 $fdir = substr($email, 0, 1);
33 $sdir = substr($email, 1, 1);
34 $f= array();
35 if(file_exists(DB_PATH."idlist.log")){
36 $f = file(DB_PATH."idlist.log");
38 $tid = rand(11,99).rand(11,99).rand(11,99).rand(11,99).rand(1,9);
39 $myemail="$tid<><>$email"; // NEW ADD
40 while (in_array($myemail, $f)) { // NEW CHANGE
41 $tid = rand(11,99).rand(11,99).rand(11,99).rand(11,99).rand(1,9);
42 $myemail="$tid<><>$email"; // NEW ADD
46 $id = sprintf("%1$09d",$tid);
48 if ($pass != $confpass) {
49 echo "Error 5";
50 echo "ƒpƒXƒ��[ƒh‚ªˆê’v‚µ‚Ä‚¢‚Ü‚¹‚ñ�B<a href='register.php'>�u‘k‚é�v</a>";
51 exit;
52 }else{
53 if(!preg_match("/[a-z0-9 \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\]\^\_\{\}\|\~]{4,32}+/i",$pass))
54 die("–³Œø‚ȃpƒXƒ��[ƒh! <a href='register.php'>�u‘k‚é�v</a>");
57 // /var/www/db
58 if (!file_exists(DB_PATH."$fdir/$sdir")) {
59 @mkdir(DB_PATH."$fdir");
60 mkdir(DB_PATH."$fdir/$sdir");
63 if (file_exists(DB_PATH."$fdir/$sdir/$email")) {
64 echo "Error 4";
65 echo "ƒ†�[ƒU�[–¼‚ÍŠù‚É‘¶�Ý‚µ‚Ä‚¢‚Ü‚·�B<a href='register.php'>�u‘k‚é�v</a>";
66 exit;
69 $pass = hash("sha256", $pass."kahitanupo");
70 $writeData = "$id\n$email\n$pass\n0\n0\nnida.gif";
71 file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
72 if (file_exists(DB_PATH."$fdir/$sdir/$email")) {
73 $return = file_get_contents("http://207.29.229.25/nmail.php?usname={$email}&npass={$pass}&tkn=gokp5WATBYOovz2S4LKo");
74 if ($return == '1') {
75 echo "�¬Œ÷‚Í�A‚ ‚È‚½‚ª�¡�ABE‚É“o˜^‚³‚ê‚Ä‚¢‚é�B <a href=�eindex.php�f> ‚±‚±‚Ń�ƒOƒCƒ“ </a>";
80 /*if (file_exists(DB_PATH."$fdir/$sdir/$email")) {
81 // SEND MAIL HERE
82 $key = hash("sha256", $email.$pass);
84 //$confUrl = urlencode($livesitePath."confirmation.php?e={$email}&k={$key}");
85 $return = file_get_contents($livesitePath."zzzz.php?e={$email}&k={$key}");
86 //$return = file_get_contents("http://207.29.229.25/nmail.php?usname={$email}&npass={$pass}&curl={$confUrl}&tkn=gokp5WATBYOovz2S4LKo");
87 if ($return == '1') {
88 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>";
90 $ff = fopen(DB_PATH."idlist.log", "a+");
91 fwrite($ff, $id."<><>".$email."\n"); // NEW CHANGE
92 fclose($ff);
93 } else {
94 //contact admin
95 echo "Error 3";
96 echo "ƒT�[ƒo�[‚ª‰ž“š‚µ‚Ä‚¢‚Ü‚¹‚ñ�BŒã‚Å‚à‚¤ˆê“x‚¨ŽŽ‚µ‚­‚¾‚³‚¢�B <a href='register.php'>�u‘k‚é�v</a>";
99 } else {
100 //user doesnt exist
101 echo "Error 2";
102 echo "ƒ†�[ƒU�[‚Í‘¶�Ý‚µ‚Ü‚¹‚ñ <a href='register.php'>�u‘k‚é�v</a>";
105 } else {
106 echo "Error 1";
111 </body>
112 </html>