(int)($root['fileid'] ?? 0), 'display_name'=>(string)($root['display_name'] ?? ''), 'webdav_path'=>(string)($root['webdav_path'] ?? ''), ); }, $roots)); unset($config['showcase_user']); foreach ($config['roots'] as $root) { if ((int)$root['fileid'] < 1 || trim((string)$root['display_name']) === '') throw new RuntimeException('Eine ausgewählte Nextcloud-Quelle ist unvollständig.'); } $config_json = json_encode($config, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); if (!is_string($config_json)) throw new RuntimeException('Die Quellenkonfiguration konnte nicht serialisiert werden.'); $table = bratonien_tools_nc_connector_table(); pwg_query("UPDATE `$table` SET config_json='".pwg_db_real_escape_string($config_json)."' WHERE id=".$connection_id." LIMIT 1"); unset($_SESSION['bratonien_nc_wizard']); unset($result['connection_id']); $result['message'] = 'Verbindung wurde mit generischer Nextcloud-Quellenauswahl angelegt. '.$result['message']; return $result; }