| 8 |
|
|
| 9 |
$data = json_decode(file_get_contents("php://input"), true); |
$data = json_decode(file_get_contents("php://input"), true); |
| 10 |
|
|
| 11 |
|
$user_tz = (isset($data["user_tz"]) ? $data["user_tz"] : ""); |
| 12 |
$photo = (isset($data["photo"]) ? intval($data["photo"]) : 0); |
$photo = (isset($data["photo"]) ? intval($data["photo"]) : 0); |
| 13 |
$introduction = (isset($data["introduction"]) ? $data["introduction"] : ""); |
$introduction = (isset($data["introduction"]) ? $data["introduction"] : ""); |
| 14 |
$sign_1 = (isset($data["sign_1"]) ? $data["sign_1"] : ""); |
$sign_1 = (isset($data["sign_1"]) ? $data["sign_1"] : ""); |
| 26 |
header("Content-Type:application/json; charset=utf-8"); |
header("Content-Type:application/json; charset=utf-8"); |
| 27 |
|
|
| 28 |
// Validate input data |
// Validate input data |
| 29 |
|
$timezone_identifiers = DateTimeZone::listIdentifiers(); |
| 30 |
|
if (!in_array($user_tz, $timezone_identifiers, true)) |
| 31 |
|
{ |
| 32 |
|
$result_set["return"]["code"] = -1; |
| 33 |
|
array_push($result_set["return"]["errorFields"], array( |
| 34 |
|
"id" => "user_tz", |
| 35 |
|
"errMsg" => "不存在的时区", |
| 36 |
|
)); |
| 37 |
|
} |
| 38 |
|
|
| 39 |
$r_introduction = check_badwords(split_line($introduction, "", 80, 10), "****"); |
$r_introduction = check_badwords(split_line($introduction, "", 80, 10), "****"); |
| 40 |
if ($introduction != $r_introduction) |
if ($introduction != $r_introduction) |
| 41 |
{ |
{ |
| 113 |
exit(json_encode($result_set)); |
exit(json_encode($result_set)); |
| 114 |
} |
} |
| 115 |
|
|
| 116 |
$sql = "UPDATE user_pubinfo SET introduction = '$introduction', ". |
$sql = "UPDATE user_pubinfo SET user_timezone = '$user_tz', introduction = '$introduction', ". |
| 117 |
"photo = $photo, sign_1 = '$sign_1', sign_2 = '$sign_2', sign_3 = '$sign_3'". |
"photo = $photo, sign_1 = '$sign_1', sign_2 = '$sign_2', sign_3 = '$sign_3'". |
| 118 |
" WHERE UID=" . $_SESSION["BBS_uid"]; |
" WHERE UID=" . $_SESSION["BBS_uid"]; |
| 119 |
|
|
| 135 |
exit(json_encode($result_set)); |
exit(json_encode($result_set)); |
| 136 |
} |
} |
| 137 |
|
|
| 138 |
|
// Update user_tz in session data |
| 139 |
|
$_SESSION["BBS_user_tz"] = new DateTimeZone($user_tz); |
| 140 |
|
|
| 141 |
mysqli_close($db_conn); |
mysqli_close($db_conn); |
| 142 |
exit(json_encode($result_set)); |
exit(json_encode($result_set)); |
| 143 |
?> |
?> |