fix: auto-run and harden billing provisioning idempotency

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/a39ca073-858c-4e1e-978f-09caabb0f029

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-09 14:16:41 +00:00 committed by GitHub
parent d636f65647
commit 2a6c8440aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 130 additions and 23 deletions

View file

@ -155,7 +155,7 @@ function exec_ogp_module()
// Record the server in the billing tables so it participates in the
// normal lifecycle (renewals, expiration, admin dashboard).
require_once('billing_integration.php');
admin_register_server_in_billing(
$billing_order_id = admin_register_server_in_billing(
$db,
$web_user_id,
$home_cfg_id,
@ -168,6 +168,14 @@ function exec_ogp_module()
$control_password,
$ftppassword
);
if ($billing_order_id !== FALSE && intval($billing_order_id) > 0) {
require_once(__DIR__ . '/../billing/create_servers.php');
billing_invoke_provision(array(
'order_ids' => array(intval($billing_order_id)),
'user_id' => intval($web_user_id),
'is_admin' => true
));
}
$view->refresh("?m=user_games&amp;p=edit&amp;home_id=$new_home_id", 0);
}else{