@@ -5174,7 +5174,8 @@ function getMarzbanUserInfo($server_id, $remark){
51745174 $ curl = curl_init ();
51755175 for ($ i = 0 ; $ i <= 10 ; $ i ++){
51765176 $ info = getMarzbanUser ($ server_id , $ remark );
5177-
5177+ $ subLink = "/sub/ " . (explode ("/sub/ " , $ info ->subscription_url )[1 ]);
5178+ $ info ->subscription_url = $ subLink ;
51785179 curl_setopt ($ curl , CURLOPT_URL , $ panel_url . $ info ->subscription_url );
51795180 curl_setopt ($ curl , CURLOPT_CONNECTTIMEOUT , 3 );
51805181 curl_setopt ($ curl , CURLOPT_TIMEOUT , 3 );
@@ -5183,6 +5184,7 @@ function getMarzbanUserInfo($server_id, $remark){
51835184 $ configInfo = $ info ;
51845185 break ;
51855186 }
5187+ if ($ i == 10 ) $ configInfo = $ info ;
51865188 }
51875189 curl_close ($ curl );
51885190
@@ -5294,7 +5296,8 @@ function addMarzbanUser($server_id, $remark, $volume, $days, $plan_id){
52945296 $ response = json_decode (curl_exec ($ curl ));
52955297 curl_close ($ curl );
52965298 if (isset ($ response ->detail ) || !isset ($ response ->links )){
5297- return (object ) ['success ' =>false , 'msg ' => $ response ->detail ];
5299+ $ detail = $ response ->detail ;
5300+ return (object ) ['success ' =>false , 'msg ' => is_object ($ detail )?implode ("- " , (array ) $ detail ):$ detail ];
52985301 }
52995302 $ userInfo = getMarzbanUserInfo ($ server_id , $ remark );
53005303
@@ -5364,7 +5367,8 @@ function editMarzbanConfig($server_id,$info){
53645367 $ response = curl_exec ($ curl );
53655368 curl_close ($ curl );
53665369 if (isset ($ response ->detail )){
5367- return (object ) ['success ' =>false , 'msg ' => $ response ->detail ];
5370+ $ detail = $ response ->detail ;
5371+ return (object ) ['success ' =>false , 'msg ' => is_object ($ detail )?implode ("- " , (array ) $ detail ):$ detail ];
53685372 }
53695373 return (object ) ['success ' =>true ];
53705374}
@@ -5398,7 +5402,8 @@ function resetMarzbanTraffic($server_id, $remark, $token){
53985402 $ response = curl_exec ($ curl );
53995403 curl_close ($ curl );
54005404 if (isset ($ response ->detail )){
5401- return (object ) ['success ' =>false , 'msg ' => $ response ->detail ];
5405+ $ detail = $ response ->detail ;
5406+ return (object ) ['success ' =>false , 'msg ' => is_object ($ detail )?implode ("- " , (array ) $ detail ):$ detail ];
54025407 }
54035408 return (object ) ['success ' =>true ];
54045409}
@@ -5427,7 +5432,8 @@ function renewMarzbanUUID($server_id,$remark){
54275432 $ response = json_decode (curl_exec ($ curl ));
54285433 curl_close ($ curl );
54295434 if (isset ($ response ->detail )){
5430- return (object ) ['success ' =>false , 'msg ' => $ response ->detail ];
5435+ $ detail = $ response ->detail ;
5436+ return (object ) ['success ' =>false , 'msg ' => is_object ($ detail )?implode ("- " , (array ) $ detail ):$ detail ];
54315437 }
54325438 $ response = getMarzbanUserInfo ($ server_id , $ remark );
54335439 return $ response ;
@@ -5465,7 +5471,8 @@ function deleteMarzban($server_id,$remark){
54655471 curl_close ($ curl );
54665472
54675473 if (isset ($ response ->detail )){
5468- return (object ) ['success ' =>false , 'msg ' => $ response ->detail ];
5474+ $ detail = $ response ->detail ;
5475+ return (object ) ['success ' =>false , 'msg ' => is_object ($ detail )?implode ("- " , (array ) $ detail ):$ detail ];
54695476 }
54705477
54715478 return (object ) ['success ' =>true ];
@@ -5517,7 +5524,8 @@ function changeMarzbanState($server_id,$remark){
55175524 curl_close ($ curl );
55185525
55195526 if (isset ($ response ->detail )){
5520- return (object ) ['success ' =>false , 'msg ' => $ response ->detail ];
5527+ $ detail = $ response ->detail ;
5528+ return (object ) ['success ' =>false , 'msg ' => is_object ($ detail )?implode ("- " , (array ) $ detail ):$ detail ];
55215529 }
55225530 return (object ) ['success ' =>true ];
55235531}
0 commit comments