Upload folder via GUI - includes
This commit is contained in:
@@ -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.']);
|
||||
|
||||
Reference in New Issue
Block a user