|
114 | 114 | } |
115 | 115 | if(preg_match('/^\/([Ss]tart)/', $text) or $text == $buttonValues['back_to_main'] or $data == 'mainMenu') { |
116 | 116 | setUser(); |
117 | | - setUser("", "temp"); |
118 | | - if ($uinfo->num_rows == 0) { |
119 | | - $first_name = !empty($first_name)?$first_name:" "; |
120 | | - $username = !empty($username)?$username:" "; |
121 | | - $refcode = time(); |
122 | | - $sql = "INSERT INTO `users` VALUES (NULL,?,?,?,?, 0,?)"; |
123 | | - $stmt = $connection->prepare($sql); |
124 | | - $stmt->bind_param("issii", $from_id, $first_name, $username, $refcode, $time); |
125 | | - $stmt->execute(); |
126 | | - $stmt->close(); |
127 | | - } |
| 117 | + setUser("", "temp"); |
128 | 118 | if(isset($data) and $data == "mainMenu"){ |
129 | 119 | $res = editText($message_id, $mainValues['start_message'], getMainKeys()); |
130 | 120 | if(!$res->ok){ |
|
690 | 680 | 👤 اسم: <code> $first_name </code> |
691 | 681 | 💰 موجودی: <code> $myWallet </code> |
692 | 682 |
|
693 | | -👈🏻 کل سرویس ها : <code> $totalBuys </code> عدد |
| 683 | +☑️ کل سرویس ها : <code> $totalBuys </code> عدد |
694 | 684 | |
695 | 685 | ", |
696 | 686 | $keys,"html"); |
|
9194 | 9184 | if(preg_match('/^editServer(\D+)(\d+)/',$userInfo['step'],$match) && $text != $buttonValues['cancel'] && ($from_id == $admin || $userInfo['isAdmin'] == true)){ |
9195 | 9185 | switch($match[1]){ |
9196 | 9186 | case "Name": |
9197 | | - $txt ="title"; |
| 9187 | + $sql = "UPDATE `server_info` SET `title`"; |
9198 | 9188 | break; |
9199 | | - case "Max": |
9200 | | - $txt = "ucount"; |
| 9189 | + case "Flag": |
| 9190 | + $sql = "UPDATE `server_info` SET `flag`"; |
9201 | 9191 | break; |
9202 | 9192 | case "Remark": |
9203 | | - $txt ="remark"; |
9204 | | - break; |
9205 | | - case "Flag": |
9206 | | - $txt = "flag"; |
| 9193 | + $sql = "UPDATE `server_info` SET `remark`"; |
9207 | 9194 | break; |
9208 | | - default: |
9209 | | - $txt = $match[1]; |
| 9195 | + case "Max": |
| 9196 | + $sql = "UPDATE `server_info` SET `ucount`"; |
9210 | 9197 | break; |
9211 | 9198 | } |
9212 | 9199 |
|
9213 | 9200 | if($text == "/empty"){ |
9214 | | - $stmt = $connection->prepare("UPDATE `server_info` SET `$txt` IS NULL WHERE `id`=?"); |
| 9201 | + $stmt = $connection->prepare("$sql IS NULL WHERE `id`=?"); |
9215 | 9202 | $stmt->bind_param("i", $match[2]); |
9216 | 9203 | $stmt->execute(); |
9217 | 9204 | $stmt->close(); |
9218 | 9205 | }else{ |
9219 | | - $stmt = $connection->prepare("UPDATE `server_info` SET `$txt`=? WHERE `id`=?"); |
| 9206 | + $stmt = $connection->prepare("$sql=? WHERE `id`=?"); |
9220 | 9207 | $stmt->bind_param("si",$text, $match[2]); |
9221 | 9208 | $stmt->execute(); |
9222 | 9209 | $stmt->close(); |
|
9238 | 9225 | } |
9239 | 9226 | if(preg_match('/^editsServer(\D+)(\d+)/',$userInfo['step'],$match) && $text != $buttonValues['cancel'] && ($from_id == $admin || $userInfo['isAdmin'] == true)){ |
9240 | 9227 | if($text == "/empty"){ |
9241 | | - if($match[1] == "header_type" || $match[1] == "security"){ |
9242 | | - $stmt = $connection->prepare("UPDATE `server_config` SET `{$match[1]}` = 'none' WHERE `id`=?"); |
9243 | | - $stmt->bind_param("i", $match[2]); |
9244 | | - }else{ |
9245 | | - $stmt = $connection->prepare("UPDATE `server_config` SET `{$match[1]}` = '' WHERE `id`=?"); |
9246 | | - $stmt->bind_param("i", $match[2]); |
9247 | | - } |
| 9228 | + if($match[1] == "sni") $stmt = $connection->prepare("UPDATE `server_config` SET `sni` = '' WHERE `id`=?"); |
| 9229 | + elseif($match[1] == "header_type") $stmt = $connection->prepare("UPDATE `server_config` SET `header_type` = 'none' WHERE `id`=?"); |
| 9230 | + elseif($match[1] == "request_header") $stmt = $connection->prepare("UPDATE `server_config` SET `request_header` = '' WHERE `id`=?"); |
| 9231 | + elseif($match[1] == "response_header") $stmt = $connection->prepare("UPDATE `server_config` SET `response_header` = '' WHERE `id`=?"); |
| 9232 | + elseif($match[1] == "security") $stmt = $connection->prepare("UPDATE `server_config` SET `security` = 'none' WHERE `id`=?"); |
| 9233 | + elseif($match[1] == "tlsSettings") $stmt = $connection->prepare("UPDATE `server_config` SET `tlsSettings` = '' WHERE `id`=?"); |
| 9234 | + |
| 9235 | + $stmt->bind_param("i", $match[2]); |
9248 | 9236 | }else{ |
9249 | | - if($match[1] == "header_type" && $text != "http" && $text != "none"){ |
9250 | | - sendMessage("برای نوع header type فقط none و یا http مجاز است"); |
9251 | | - exit(); |
| 9237 | + if($match[1] == "sni") $stmt = $connection->prepare("UPDATE `server_config` SET `sni`=? WHERE `id`=?"); |
| 9238 | + elseif($match[1] == "header_type"){ |
| 9239 | + if($text != "http" && $text != "none"){ |
| 9240 | + sendMessage("برای نوع header type فقط none و یا http مجاز است"); |
| 9241 | + exit(); |
| 9242 | + }else $stmt = $connection->prepare("UPDATE `server_config` SET `header_type`=? WHERE `id`=?"); |
9252 | 9243 | } |
9253 | | - elseif($match[1] == "security" && $text != "tls" && $text != "none" && $text != "xtls"){ |
9254 | | - sendMessage("برای نوع security فقط tls یا xtls و یا هم none مجاز است"); |
9255 | | - exit(); |
| 9244 | + elseif($match[1] == "request_header") $stmt = $connection->prepare("UPDATE `server_config` SET `request_header`=? WHERE `id`=?"); |
| 9245 | + elseif($match[1] == "response_header") $stmt = $connection->prepare("UPDATE `server_config` SET `response_header`=? WHERE `id`=?"); |
| 9246 | + elseif($match[1] == "security"){ |
| 9247 | + if($text != "tls" && $text != "none" && $text != "xtls"){ |
| 9248 | + sendMessage("برای نوع security فقط tls یا xtls و یا هم none مجاز است"); |
| 9249 | + exit(); |
| 9250 | + }else $stmt = $connection->prepare("UPDATE `server_config` SET `security`=? WHERE `id`=?"); |
9256 | 9251 | } |
9257 | | - $stmt = $connection->prepare("UPDATE `server_config` SET `{$match[1]}`=? WHERE `id`=?"); |
| 9252 | + elseif($match[1] == "tlsSettings") $stmt = $connection->prepare("UPDATE `server_config` SET `tlsSettings`=? WHERE `id`=?"); |
9258 | 9253 | $stmt->bind_param("si",$text, $match[2]); |
9259 | 9254 | } |
9260 | 9255 | $stmt->execute(); |
|
9289 | 9284 | if(preg_match('/^editServer(\D+)(\d+)/',$userInfo['step'],$match) && $text != $buttonValues['cancel'] && ($from_id == $admin || $userInfo['isAdmin'] == true)){ |
9290 | 9285 | switch($match[1]){ |
9291 | 9286 | case "Name": |
9292 | | - $txt ="title"; |
| 9287 | + $stmt = $connection->prepare("UPDATE `server_info` SET `title`=? WHERE `id`=?"); |
9293 | 9288 | break; |
9294 | 9289 | case "Max": |
9295 | | - $txt = "ucount"; |
| 9290 | + $stmt = $connection->prepare("UPDATE `server_info` SET `ucount`=? WHERE `id`=?"); |
9296 | 9291 | break; |
9297 | 9292 | case "Remark": |
9298 | | - $txt ="remark"; |
| 9293 | + $stmt = $connection->prepare("UPDATE `server_info` SET `remark`=? WHERE `id`=?"); |
9299 | 9294 | break; |
9300 | 9295 | case "Flag": |
9301 | | - $txt = "flag"; |
| 9296 | + $stmt = $connection->prepare("UPDATE `server_info` SET `flag`=? WHERE `id`=?"); |
9302 | 9297 | break; |
9303 | 9298 | } |
9304 | 9299 |
|
9305 | | - $stmt = $connection->prepare("UPDATE `server_info` SET `$txt`=? WHERE `id`=?"); |
9306 | 9300 | $stmt->bind_param("si",$text, $match[2]); |
9307 | 9301 | $stmt->execute(); |
9308 | 9302 | $stmt->close(); |
|
0 commit comments