die; } if (@sql_query("UPDATE users SET username ='******' WHERE id = " . $userid)) { sql_query("UPDATE users SET seedbonus =seedbonus -" . $charge . " WHERE id = " . $userid) or sqlerr(__FILE__, __LINE__); echo "改名成功,本次消费麦粒" . $charge . ",欢迎再次光临^_^。"; $charge = $charge * 2; sql_query("UPDATE bonusapp set namecharge=" . $charge . " where userid=" . $userid) or sqlerr(__FILE__, __LINE__); } else { echo "修改失败,该用户名可能已被占用"; die; } } $charge = $charge / 2; sendshoutbox("薄情寡义的[@{$CURUSER['username']}] 不喜欢自己的名字啦,花了{$charge} 个麦粒给自己换了个新名字叫[@{$newname}]快来围观土豪吧¬_¬"); writeBonusComment($CURUSER[id], "用户名由{$CURUSER['username']}更换为{$newname} ,花费麦粒{$charge}"); writeModComment($CURUSER[id], "用户名由{$CURUSER['username']}更换为{$newname} ,花费麦粒{$charge}"); record_op_log(0, $CURUSER[id], htmlspecialchars($CURUSER['username']), "change", $CURUSER['username'] . "--花费麦粒自助更名为--" . $newname); print "<br>建议重新登录,<a href=\"logout.php\" align=\"center\">点我去登录</a>"; } function checktorrent($torrentid) { $res = @sql_query("SELECT * from torrents where id =" . $torrentid) or sqlerr(__FILE__, __LINE__); $row = mysql_fetch_array($res); if ($row['pos_state'] == 'sticky') { die('抱歉,不允许对置顶的种子进行编辑'); } return $row; } if ($action == "prm") { //促销 $id = htmlspecialchars($_POST['torrentid']);
// warn users until 30 days $until = sqlesc(date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $length)); sql_query("UPDATE users SET enabled='yes', leechwarn='yes', leechwarnuntil={$until} WHERE id = " . sqlesc($userid)) or sqlerr(__FILE__, __LINE__); $modcomment = date("Y-m-d") . " - Enabled by " . $CURUSER['username'] . " - Reason For {$opreason}"; writeModComment($userid, $modcomment); } else { sql_query("UPDATE users SET enabled='yes', leechwarn='no' WHERE id = " . sqlesc($userid)) or sqlerr(__FILE__, __LINE__); } $modcomment = date("Y-m-d") . " - Enabled by " . $CURUSER['username'] . " - Reason For {$opreason}"; writeModComment($userid, $modcomment); record_op_log($CURUSER['id'], $id, htmlspecialchars($name), 'unban', $opreason); stderr("Success", "用户:" . htmlspecialchars($name) . "</b> 复活账号成功,原因是" . $opreason, false); } else { sql_query("UPDATE users SET enabled='no' WHERE id={$userid}") or sqlerr(__FILE__, __LINE__); $modcomment = date("Y-m-d") . " - Disabled by " . $CURUSER['username'] . " - Reason For {$opreason}"; writeModComment($userid, $modcomment); record_op_log($CURUSER['id'], $id, htmlspecialchars($name), 'ban', $opreason); stderr("Success", "用户:" . htmlspecialchars($name) . " 封禁成功,原因是" . $opreason, true); } } else { stderr("操作失败", "当前用户状态与要操作的状态相同。", false); } } } stdhead("Delete account"); ?> <h1>Delete account</h1> <table border=1 cellspacing=0 cellpadding=5> <form method=post action=delacctadmin.php> <tr><td class=rowhead>User id</td><td><input size=40 name=userid></td></tr>