Upload folder via GUI - includes

This commit is contained in:
Git Manager GUI
2026-05-05 21:18:59 +02:00
parent 1abc412e1d
commit cd5c99d852
2 changed files with 130 additions and 13 deletions

View File

@@ -1846,11 +1846,21 @@ class WBF_Ajax {
}
$type = sanitize_key($_POST['type'] ?? '');
if ( ! in_array($type, ['fly_abo', 'plot_abo'], true) ) {
if ( ! in_array($type, ['fly_abo', 'plot_abo', 'item_abo'], true) ) {
wp_send_json_error(['message' => 'Ungültiger Abo-Typ.']);
return;
}
// Bei item_abo: abo_id pflichtfeld
$abo_id = 0;
if ( $type === 'item_abo' ) {
$abo_id = (int)($_POST['abo_id'] ?? 0);
if ( $abo_id <= 0 ) {
wp_send_json_error(['message' => 'Abo-ID fehlt oder ungültig.']);
return;
}
}
// MC-Name ermitteln (Spielername = Forum-Username oder verknüpfter MC-Name)
$mc_name = '';
if ( class_exists('WBF_MC_Bridge') ) {
@@ -1866,7 +1876,7 @@ class WBF_Ajax {
return;
}
$ok = WBF_Abo::cancel_abo($mc_name, $type);
$ok = WBF_Abo::cancel_abo($mc_name, $type, $abo_id);
if ($ok) {
wp_send_json_success(['message' => 'Abo erfolgreich gekündigt.']);