/[LeafOK_CVS]/fenglin/bbs/set_life.php
ViewVC logotype

Diff of /fenglin/bbs/set_life.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 by sysadm, Sat Jun 5 23:29:01 2004 UTC Revision 1.9 by sysadm, Sat Mar 29 05:03:27 2025 UTC
# Line 1  Line 1 
1  <?  <?
2            require_once "../lib/db_open.inc.php";
3            require_once "./common_lib.inc.php";
4          require_once "./session_init.inc.php";          require_once "./session_init.inc.php";
5  ?>  ?>
6  <?  <?
# Line 11  if (isset($_POST["life"])) Line 13  if (isset($_POST["life"]))
13          $life=intval($_POST["life"]);          $life=intval($_POST["life"]);
14  else  else
15  {  {
16          echo ("未指定生命值!");          echo ("鏈寚瀹氱敓鍛藉硷紒");
17          exit();          exit();
18  }  }
19    
20  $db_conn=include "./db_open.inc.php";  if (!($_SESSION["BBS_priv"]->checkpriv(0, S_POST) && (
21            $_SESSION["BBS_priv"]->checklevel(P_ADMIN_M | P_ADMIN_S | P_MAN_C))))
 if (!($_SESSION["BBS_priv"]->checkpriv(0,S_POST) && (  
         $_SESSION["BBS_priv"]->checklevel(P_ADMIN_M) ||  
         $_SESSION["BBS_priv"]->checklevel(P_ADMIN_S) ||  
         $_SESSION["BBS_priv"]->checklevel(P_MAN_C))))  
22  {  {
23  ?>          error_msg("鎮ㄦ棤鏉冧慨鏀圭敤鎴风敓鍛藉硷紒",true);
 <script language="JavaScript">  
         alert("您无权修改用户生命值!");  
         history.go(-1);  
 </script>  
 <?  
24          exit();          exit();
25  }  }
26    
# Line 36  switch($life) Line 29  switch($life)
29          case 999:          case 999:
30          case 666:          case 666:
31          case 365:          case 365:
32            case 333:
33          case 150:          case 150:
34          case 30:          case 30:
35                  break;                  break;
36          default:          default:
37                  echo ("非法生命值!");                  echo ("闈炴硶鐢熷懡鍊硷紒");
38                  exit();                  exit();
39  }  }
40    
# Line 60  mysql_free_result($rs); Line 54  mysql_free_result($rs);
54  mysql_query("update user_pubinfo set life=$life where UID=$uid")  mysql_query("update user_pubinfo set life=$life where UID=$uid")
55          or die("Update user_pubinfo error!");          or die("Update user_pubinfo error!");
56    
57  mysql_query("insert delayed into user_life_log(UID,set_UID,life,dt,ip) ".  mysql_query("insert into user_life_log(UID,set_UID,life,dt,ip) ".
58          "values($uid,".$_SESSION["BBS_uid"].",$life,now(),'".          "values($uid,".$_SESSION["BBS_uid"].",$life,now(),'".
59          $_SERVER["REMOTE_ADDR"]."')")          client_addr()."')")
60          or die("Add log error!");          or die("Add log error!");
61    
62  ?>  error_msg("璁剧疆鐢ㄦ埛鐢熷懡鍊兼垚鍔燂紒");
 <script language="JavaScript">  
         alert("设置用户生命值成功!");  
 </script>  
 <?  
63    
64  mysql_query("update user_online set current_action='reload' where UID=".$uid)  mysql_query("update user_online set current_action='reload' where UID=".$uid)
65          or die("Update user_online error!");          or die("Update user_online error!");
# Line 78  mysql_close($db_conn); Line 68  mysql_close($db_conn);
68  ?>  ?>
69  <HTML>  <HTML>
70          <head>          <head>
71                  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">                  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
72                  <meta http-equiv="refresh" content="3;url=show_profile.php?user_id=<? echo $user_id; ?>">                  <meta http-equiv="refresh" content="3;url=show_profile.php?user_id=<? echo $user_id; ?>">
73                  <title>设置用户生命值</title>                  <title>璁剧疆鐢ㄦ埛鐢熷懡鍊</title>
74                  <link rel="stylesheet" href="css/default.css" type="text/css">                  <link rel="stylesheet" href="css/default.css" type="text/css">
75          </head>          </head>
76          <BODY>          <BODY>
77                  <P align=center>用户生命值设置完成!</P>                  <P align=center>鐢ㄦ埛鐢熷懡鍊艰缃畬鎴愶紒</P>
78          </BODY>          </BODY>
79  </HTML>  </HTML>


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1