Initial commit
[2ch-be.git] / dev-test / np.php
blob3f01eb4317d09644be683ba498ed0e41e573a06e
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="Shift_JIS">
5 <title>�V‚µ‚¢ƒpƒXƒ��[ƒh</title>
6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 <meta name="description" content="">
8 <meta name="author" content="">
9 <link rel="stylesheet" type="text/css" href="../css/style.css"/>
10 </head>
11 <body>
12 <?php
13 include('encrypt.php');
14 if (isset($_GET['vhj']) && isset($_GET['i']) && !empty($_GET['vhj']) && !empty($_GET['i'])) {
16 $ide = Decrypt($_GET['i'],KEY);
17 $em = Decrypt($_GET['vhj'],KEY);
19 $ide = trim($ide);
20 $em = trim($em);
21 $em = filter_var($em, FILTER_SANITIZE_STRING);
22 $email = explode("|",$em);
24 if(isset($email[1]) && $email[1]==$ide)
25 $email = $email[0];
26 else
27 $email = "";
29 $email = filter_var($email, FILTER_SANITIZE_EMAIL);
30 if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
31 echo "–³Œø‚ȃ��[ƒ‹";
32 exit;
35 $fdir = substr($email, 0, 1);
36 $sdir = substr($email, 1, 1);
37 $data = @file(DB_PATH."$fdir/$sdir/$email");
39 if(count($data)>3) {
40 if (trim($data[count($data)-1]) !=FORGOT) {
41 echo "ŠúŒÀ�Ø‚ê‚̃Šƒ“ƒN";
42 exit;
44 } else {
45 echo "Error";
46 exit;
49 } elseif (isset($_POST['newpass'])) {
51 $pass = trim($_POST['pass']);
52 $pass = filter_var($pass, FILTER_SANITIZE_STRING);
53 $pass = strip_tags(addslashes($pass));
54 $cpass = trim($_POST['cpass']);
55 $cpass = filter_var($cpass, FILTER_SANITIZE_STRING);
56 $cpass = strip_tags(addslashes($cpass));
58 $email = trim($_POST['email']);
59 $email = filter_var($email, FILTER_SANITIZE_EMAIL);
60 if (!filter_var($email, FILTER_VALIDATE_EMAIL)){
61 echo "bad"; exit;}
63 if ($pass != $cpass) {
64 echo "�V‚µ‚¢ƒpƒXƒ��[ƒh‚ªˆê’v‚µ‚Ü‚¹‚ñ�B";
65 exit;
66 }else{
67 if(!preg_match("/[a-z0-9 \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\]\^\_\{\}\|\~]{4,32}+/i",$pass))
68 die("–³Œø‚ȃpƒXƒ��[ƒh‚Å‚·�B");
71 $fdir = substr($email, 0, 1);
72 $sdir = substr($email, 1, 1);
73 $data = @file(DB_PATH."$fdir/$sdir/$email");
74 for ($i=0; $i < count($data); $i++) {
75 $data[$i] = trim($data[$i]);
77 if (trim($data[count($data)-1]) !=FORGOT) {
78 echo "ŠúŒÀ�Ø‚ê‚̃Šƒ“ƒN";
79 exit;
82 $pass = hash("sha256", $pass."kahitanupo");
83 $data[2]=$pass;
84 unset($data[count($data)-1]);
85 $writeData = implode("\n",$data);
86 //$writeData = $data[0]."\n".$data[1]."\n".$pass."\n".$data[3]."\n".$data[4]."\n".$data[5]."\n";
87 file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
88 echo "ƒpƒXƒ��[ƒh‚ð�Ä�ݒ肵‚Ü‚µ‚½�B";
89 exit;
90 } else {
91 echo "‚±‚±‚ÅŒ©‚é‚à‚͉̂½‚à‚È‚¢";
92 exit;
95 <div class="containerz">
96 <div class="navbar-collapse">
97 <ul class="nav navbar-nav">
98 </ul>
99 </div>
100 </div>
102 <div class="container">
103 <center>
104 <div class="form-signin" style = "font-size: 1.2em;text-align:right;">
105 <a href="http://www.2ch.net/">
106 <img src="http://www.2ch.net/images/2ch_logo.gif">
107 </a><br>
108 BE 2.0
109 </div>
110 </center>
111 </div>
113 <div class="container">
114 <center>
115 <form class="form-signin" method="post" action="np.php">
116 <h3 class="form-signin-heading">�V‚µ‚¢ƒpƒXƒ��[ƒh</h3>
117 <input type="hidden" name="email" value="<?php echo $email; ?>">
118 <input type="password" name="pass" placeholder="�V‚µ‚¢ƒpƒXƒ��[ƒh" required autofocus>
119 <input type="password" name="cpass" placeholder="�V‚µ‚¢ƒpƒXƒ��[ƒh‚ð�Ä“ü—Í" required >
120 <br><br>
121 <button name="newpass" type="submit">’ñ�o‚·‚é</button><br><br><br>
122 </form>
123 </center>
124 </div>
125 </body>
126 </html>