File: //tmp/creator-studio-redesign-post.patch
*** Begin Patch
*** Update File: /home/kiwerkzeuge.de/public_html/creator-studio/_lib/redesign.php
@@
}
$action = (string) ($_POST['action'] ?? '');
+ if ($action === 'switch-tiktok-account') {
+ try {
+ if (!cs_verify_csrf($_POST['csrf'] ?? null)) {
+ throw new RuntimeException(cs_r_lang($lang) === 'en' ? 'The form token was invalid. Reload and try again.' : 'Das Formular-Token war ungültig. Bitte neu laden.');
+ }
+ if (trim((string) ($_POST['website'] ?? '')) !== '') {
+ cs_set_flash('success', 'OK', cs_r_lang($lang) === 'en' ? 'Account unchanged.' : 'Konto unverändert.');
+ header('Location: ' . cs_r_url($lang, $page) . '#account', true, 303);
+ exit;
+ }
+ $openId = cs_resolve_session_account_ref((string) ($_POST['account_ref'] ?? ''));
+ if ($openId === null) {
+ throw new RuntimeException(cs_r_lang($lang) === 'en' ? 'This account is not available in the current browser session. Connect it again before switching.' : 'Dieses Konto ist in der aktuellen Browser-Session nicht verfügbar. Verbinde es erneut, bevor du wechselst.');
+ }
+ $account = cs_find_account($openId);
+ if ($account === null) {
+ throw new RuntimeException(cs_r_lang($lang) === 'en' ? 'The selected TikTok account is no longer stored.' : 'Das gewählte TikTok-Konto ist nicht mehr gespeichert.');
+ }
+ cs_set_current_open_id($openId);
+ cs_set_flash('success', cs_r_lang($lang) === 'en' ? 'TikTok account selected' : 'TikTok-Konto gewählt', cs_r_lang($lang) === 'en' ? 'New reviews and publish actions now use ' . cs_account_public_label($account) . '.' : 'Neue Reviews und Publishing-Aktionen nutzen jetzt ' . cs_account_public_label($account) . '.');
+ } catch (Throwable $error) {
+ cs_set_flash('error', cs_r_lang($lang) === 'en' ? 'Account switch failed' : 'Kontowechsel fehlgeschlagen', $error->getMessage());
+ }
+ header('Location: ' . cs_r_url($lang, $page) . '#account', true, 303);
+ exit;
+ }
if ($action === 'photo-carousel-brief') {
*** End Patch