/[LeafOK_CVS]/fenglin/manage/photo_process.php
ViewVC logotype

Annotation of /fenglin/manage/photo_process.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Mon Apr 14 02:11:42 2025 UTC (11 months ago) by sysadm
Branch: MAIN
Rename photo process and refact

1 sysadm 1.1 <?
2     require_once "../lib/db_open.inc.php";
3     require_once "../bbs/session_init.inc.php";
4    
5     force_login();
6    
7     $result_set = array(
8     "return" => array(
9     "code" => 0,
10     "message" => "",
11     "errorFields" => array(),
12     ),
13     );
14    
15     $p_id = ($_GET["p_id"] ? intval($_GET["p_id"]) : 0);
16     $enable = (isset($_GET["enable"]) && $_GET["enable"] == "1");
17    
18     if (!$_SESSION["BBS_priv"]->checklevel(P_ADMIN_M | P_ADMIN_S))
19     {
20     $result_set["return"]["code"] = -1;
21     $result_set["return"]["message"] = "没有权限";
22    
23     mysqli_close($db_conn);
24     exit(json_encode($result_set));
25     }
26    
27     if ($enable)
28     {
29     $sql = "UPDATE user_pubinfo SET photo_enable = 1 WHERE UID = $p_id";
30     }
31     else
32     {
33     $sql = "UPDATE user_pubinfo SET photo_ext = '' WHERE UID = $p_id";
34     }
35    
36     $rs = mysqli_query($db_conn, $sql);
37     if ($rs == false)
38     {
39     $result_set["return"]["code"] = -2;
40     $result_set["return"]["message"] = "Update photo error: " . mysqli_error($db_conn);
41    
42     mysqli_close($db_conn);
43     exit(json_encode($result_set));
44     }
45    
46     mysqli_close($db_conn);
47    
48     header("Location: photo_list.php");
49     ?>

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