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

Contents of /fenglin/bbs/set_life.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations)
Fri Mar 28 05:55:16 2025 UTC (11 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.7: +2 -3 lines
Refine

1 <?
2 require_once "../lib/db_open.inc.php";
3 require_once "./common_lib.inc.php";
4 require_once "./session_init.inc.php";
5 ?>
6 <?
7 if (isset($_POST["user_id"]))
8 $user_id=intval($_POST["user_id"]);
9 else
10 $user_id=0;
11
12 if (isset($_POST["life"]))
13 $life=intval($_POST["life"]);
14 else
15 {
16 echo ("未指定生命值!");
17 exit();
18 }
19
20 if (!($_SESSION["BBS_priv"]->checkpriv(0, S_POST) && (
21 $_SESSION["BBS_priv"]->checklevel(P_ADMIN_M | P_ADMIN_S | P_MAN_C))))
22 {
23 error_msg("您无权修改用户生命值!",true);
24 exit();
25 }
26
27 switch($life)
28 {
29 case 999:
30 case 666:
31 case 365:
32 case 333:
33 case 150:
34 case 30:
35 break;
36 default:
37 echo ("非法生命值!");
38 exit();
39 }
40
41 $rs=mysql_query("select UID from user_list where UID=$user_id and enable")
42 or die("Query user error!");
43
44 if (!($row=mysql_fetch_array($rs)))
45 {
46 include "./error/user_not_found.htm";
47 exit();
48 }
49
50 $uid=$row["UID"];
51
52 mysql_free_result($rs);
53
54 mysql_query("update user_pubinfo set life=$life where UID=$uid")
55 or die("Update user_pubinfo error!");
56
57 mysql_query("insert delayed into user_life_log(UID,set_UID,life,dt,ip) ".
58 "values($uid,".$_SESSION["BBS_uid"].",$life,now(),'".
59 client_addr()."')")
60 or die("Add log error!");
61
62 error_msg("设置用户生命值成功!");
63
64 mysql_query("update user_online set current_action='reload' where UID=".$uid)
65 or die("Update user_online error!");
66
67 mysql_close($db_conn);
68 ?>
69 <HTML>
70 <head>
71 <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; ?>">
73 <title>设置用户生命值</title>
74 <link rel="stylesheet" href="css/default.css" type="text/css">
75 </head>
76 <BODY>
77 <P align=center>用户生命值设置完成!</P>
78 </BODY>
79 </HTML>

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