Initial commit
[2ch-be.git] / dev-test / old_dev / dev-test / bak / status.php.bak
blobaac01016c41756c9bd208bc50f00c3f555e614e4
1 <?php
3 //DMDM = email
4 //MDMD = password
5 include('encrypt.php');
6 // isset if login or not
7 if (!isset($_COOKIE['DMDM']) && !isset($_COOKIE['MDMD'])) {
8         header('location:index.php');
9         exit;
12 $icoimg="";
14 $email = Decrypt($_COOKIE['DMDM'],KEY);
15 $email = filter_var($email, FILTER_SANITIZE_EMAIL);
17 if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
18 exit;
21 include('inf.php');
23 $fdir = substr($email, 0, 1);
24 $sdir = substr($email, 1, 1);
25 $data = @file(DB_PATH."$fdir/$sdir/$email");
27 if(count($data)<3) {
28         foreach($_COOKIE as $ky => $vl)
29                 setcookie($ky,"",time()-3600);
30         header('location:index.php');
31         exit;
34 for ($i=0; $i < count($data); $i++) {
35         $data[$i] = trim($data[$i]);
37 if(count($data)>5){
38         $mystatus = '';
39         if($data[6]!=FORGOT){
40                 $mystatus = urldecode($data[6]);
41                 $mystatus = str_replace("<br>","\n",$mystatus);
42         }
45 $e_ = (isset($_GET['e_'])) ? strip_tags(addslashes(filter_var($_GET['e_'], FILTER_SANITIZE_STRING))):'';
46 if($e_=='1'){
47   $isforedit =true;
50 if (isset($_GET['ico'])) {
51         $ico = $_GET['ico'];
52         $ico=trim($ico);
53         if(preg_match('/[^a-z_\-0-9._]/i', $ico)){
54                 $ico ="";
55         }
57         $type =Array(1 => 'gif'); //store all the image extension types in array
58         $ext  = explode(".",$ico); //explode and find value after dot
59         if(!(in_array($ext[1],$type))) //check image extension not in the array $type
60         {
61                 echo "412";
62                 exit;
63         }
65         $icoimg    = "<img src=\"http://204.63.8.28/ico/".$ico."\" class='pic'/>";
66         $data[5]   =$ico;
67         $writeData = implode("\n",$data);
68         file_put_contents(DB_PATH."$fdir/$sdir/$email", $writeData);
69         header('location:status.php');
72 if (isset($data[5]) && !empty($data[5])) {
73         $ico=trim($data[5]);
74         if(preg_match('/[^a-z_\-0-9._]/i', $ico))
75         {
76                 $ico ="";
77         }
78         $icoimg = "<img src=\"http://204.63.8.28/ico/".$ico."\" class='pic'/>";
80   
81 include "include/header.php";
83 $inbox = new Message;
84 $uid   = $inbox->GetID($_COOKIE['DMDM'],$id_mail_path);
88 <body>
89         <div class="well well-lg">
91         <!-- navigation-->
92         <?php require ('include/nav.php'); ?>
93         <!-- end navigation-->
95         <!--<h3 class="form-signin-heading">ƒXƒe[ƒ^ƒXƒy[ƒW</h3>-->
97         <a href="choose.php"><div class="ic panel panel-default pull-left"><?php echo $icoimg; ?></div></a><!-- ƒAƒCƒRƒ“‚̓NƒŠƒbƒN‚·‚é‚ƕύX‚Å‚«‚Ü‚· --> 
98       
99         <!-- start tripcode -->
100         <div class="panel2 panel panel-default">
101         <h5><strong>トリップ:</strong></h5>
102         <!-- tripcode -->
103         <div class="tripc input-group">
104                 <input type="text" class="form-control" name="trip" id="trip_c" value="<?php print $data[7];?>" />
105                 <!-- <input type="text" class="form-control" value="B1VjUMK0na7D"/> -->
106                 <span class="input-group-btn">
107                 <button class="btn btn-default" type="submit" value="ŒvŽZ‚·‚é" id="caltrip" />
108                         <span class="glyphicon glyphicon-random"></span>
109                 </button>
110                 </span>
111         </div>
112       
113         </div>
114         <!-- end tripcode!!   -->
116         <!-- start status -->
117         <div class="panel4 panel panel-default">
118                 <strong>紹介文</strong>
119                 <?php if(empty($_GET['e_'])){
120                         $hide="";
121                 }
122                 else
123                 {
124                         $hide="hide";
125                 ?>
126                 <form method="post">
127                         <?php if(isset($echo)) echo "<span style=\"color:green\">$echo</span>"; ?>
128                         <button name="isca" class="bottom btn btn-default pull-right btn-sm">
129                                 <span class="glyphicon glyphicon-remove"></span>
130                         </button>
131                         <button name="isub" class="bottom btn btn-default pull-right btn-sm">
132                                 <span class="glyphicon glyphicon-ok"></span>
133                         </button> 
134                         <div class="clearfix"></div>
135                         <textarea rows="4" id="input" name="info" class="textpanel form-control" maxlength="250"><?php echo $mystatus; ?></textarea>
136                 </form>
138                 <?php
139                 }
140                 ?>
142                 <a href="<?php echo $_SERVER['PHP_SELF'] . '?e_=1'; ?>" class="<?php echo $hide; ?> bottom btn btn-default pull-right btn-sm">
143                 <span class="glyphicon glyphicon-edit"></span>
144                 </a>
146                 <div class="<?php echo $hide; ?> panel5 panel panel-default">
147                 <div class="txt"><?php echo $mystatus; ?></div>
148                 </div>
150         </div>
151         <!-- end status -->
153         <div class="clearfix"></div>
154     
155         <div class="panel3 panel panel-default txt">
156                 <?php 
157                         echo 
158                         "<h5><strong>Eメール:</strong> ".$data[1]."</h5>
159                         <h5><strong>点数:</strong><span class='badge'> ".$data[3]."</span></h5>";
160                 ?>
161                 <strong>古いアカウントの移行</strong><br><a href="mailto:migrate@2ch.net">証明として、旧アカウントの詳細を電子メールで送信します。</a><br><br>
162                 <hr>
163                 <h4 class="text pull-right"> <a href="logout.php"><span class="label label-danger">ログアウトする</span></a> </h4>
164                 <h4 class="text pull-right"> <a href="change_pass.php"><span class="label label-primary">パスワードを変更する</span></a> </h4>
165                 <div class="clearfix"></div>
166         </div>
168         </div>
170 <?php 
171         require ('include/footer.php');