diff --git a/CHANGELOG.md b/CHANGELOG.md index 38acd72464..a76e9399d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ developers to maintain and readjust their custom modifications on the main proje ### Added - Add support for PHP 8.4 (#1640) +- Add new secret token header field to webhooks and default to X-EA-Token (#1607) ### Fixed diff --git a/application/config/app.php b/application/config/app.php index 6cdba90a94..dca27c74ca 100644 --- a/application/config/app.php +++ b/application/config/app.php @@ -9,10 +9,10 @@ | */ -$config['version'] = '1.5.0'; // This must be changed manually. +$config['version'] = '1.5.1-beta.1'; // This must be changed manually. $config['url'] = Config::BASE_URL; $config['debug'] = Config::DEBUG_MODE; -$config['cache_busting_token'] = 'ZV954'; +$config['cache_busting_token'] = 'UH44E'; diff --git a/application/controllers/Webhooks.php b/application/controllers/Webhooks.php index 47f6bf80db..901268b151 100644 --- a/application/controllers/Webhooks.php +++ b/application/controllers/Webhooks.php @@ -20,7 +20,16 @@ */ class Webhooks extends EA_Controller { - public array $allowed_webhook_fields = ['id', 'name', 'url', 'actions', 'secret_token', 'is_ssl_verified', 'notes']; + public array $allowed_webhook_fields = [ + 'id', + 'name', + 'url', + 'actions', + 'secret_header', + 'secret_token', + 'is_ssl_verified', + 'notes', + ]; public array $optional_webhook_fields = [ // diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index aabebdbc6b..50302e6b3f 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'تم تقديم بيانات اعتماد غير صالحة، يرجى المحاولة مرة أخرى'; $lang['calendar_url'] = 'عنوان URL للتقويم'; $lang['please_select'] = 'يرجى الاختيار'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/bosnian/translations_lang.php b/application/language/bosnian/translations_lang.php index e7561f8fc6..06be932652 100644 --- a/application/language/bosnian/translations_lang.php +++ b/application/language/bosnian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Nevažeći akreditivi su navedeni, pokušajte ponovo.'; $lang['calendar_url'] = 'URL kalendara'; $lang['please_select'] = 'Molimo izaberite'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index ce2a1e6b01..8b5192f731 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -482,4 +482,5 @@ $lang['display_in_services'] = 'Покажи в услугите'; $lang['import_ldap_users'] = 'Импортиране на LDAP потребители'; $lang['manage_providers'] = 'Управление на доставчици'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index f318d6f9c2..c3f0a93b9d 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Les credencials no són vàlides, torneu-ho a provar un altre cop.'; $lang['calendar_url'] = 'URL del calendari'; $lang['please_select'] = 'Si us plau, seleccioneu'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index fc5f41ce14..91c7151ea7 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -496,4 +496,5 @@ $lang['website'] = '网站'; $lang['social_media'] = '社交媒体'; $lang['follow_us'] = '关注我们'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/croatian/translations_lang.php b/application/language/croatian/translations_lang.php index 8356d7208f..32b78e9f63 100644 --- a/application/language/croatian/translations_lang.php +++ b/application/language/croatian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Pruženi podaci za prijavu su neispravni, pokušajte ponovo.'; $lang['calendar_url'] = 'URL Kalendar'; $lang['please_select'] = 'Molimo Odaberite'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index cd5cbdeb62..51734c71fe 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -489,4 +489,5 @@ $lang['open'] = 'Otevřít'; $lang['close'] = 'Zavřít'; $lang['confirm_delete'] = 'Opravdu chcete odstranit tento záznam?'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index b783eb00df..b7bab183a7 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Ugyldige legitimationsoplysninger angivet, prøv igen.'; $lang['calendar_url'] = 'Kalender URL'; $lang['please_select'] = 'Vælg venligst'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index c5ba363f67..3d08f78ff3 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -494,4 +494,5 @@ $lang['event_success'] = 'Evenement succesvol toegevoegd.'; $lang['event_update_success'] = 'Evenement succesvol bijgewerkt.'; $lang['event_delete_success'] = 'Evenement succesvol verwijderd.'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index 81a85f9f7c..e641365e8e 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Invalid credentials provided, please try again.'; $lang['calendar_url'] = 'Calendar URL'; $lang['please_select'] = 'Please Select'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/estonian/translations_lang.php b/application/language/estonian/translations_lang.php index 4ecfcfd781..c5c7d76a38 100644 --- a/application/language/estonian/translations_lang.php +++ b/application/language/estonian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Esitatud andmed on vigased, palun proovige uuesti.'; $lang['calendar_url'] = 'Kalendri URL'; $lang['please_select'] = 'Palun Valige'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index c58e021128..8a2d995d41 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Tunnukset olivat virheelliset, ole hyvä ja yritä uudelleen.'; $lang['calendar_url'] = 'Kalenterin URL'; $lang['please_select'] = 'Valitse'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index 31ed453c85..777e86a4d1 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Identifiants fournis invalides, veuillez réessayer.'; $lang['calendar_url'] = 'URL du Calendrier'; $lang['please_select'] = 'Veuillez Sélectionner'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/german/translations_lang.php b/application/language/german/translations_lang.php index 1e88a192f6..b176a95aca 100755 --- a/application/language/german/translations_lang.php +++ b/application/language/german/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Invalid credentials provided, please try again.'; $lang['calendar_url'] = 'Calendar URL'; $lang['please_select'] = 'Bitte Wählen'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index 586585e8da..79f1150333 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Invalid credentials provided, please try again.'; $lang['calendar_url'] = 'Calendar URL'; $lang['please_select'] = 'Παρακαλώ Επιλέξτε'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index 37da8744a0..4a3339995f 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -450,4 +450,5 @@ $lang['webhook_deleted'] = 'WebHook נמחק בהצלחה.'; $lang['delete_webhook'] = 'מחק WebHook'; $lang['contact_info'] = 'מידע ליצירת קשר'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index 4f267e5be4..8f4fe9ebd0 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'अमान्य क्रेडेंशियल्स प्रदान किए गए हैं, कृपया पुनः प्रयास करें।'; $lang['calendar_url'] = 'कैलेंडर URL'; $lang['please_select'] = 'कृपया चयन करें'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index b953039182..0a6c5997cf 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Érvénytelen hitelesítő adatok lettek megadva, kérem próbálja újra.'; $lang['calendar_url'] = 'Naptár URL'; $lang['please_select'] = 'Kérem válasszon'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index dadbaa1ca7..a03b4b5215 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Credenziali fornite non valide, riprova.'; $lang['calendar_url'] = 'URL Calendario'; $lang['please_select'] = 'Seleziona'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index fd7f917ed1..e9c59d5990 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = '無効な認証情報が提供されました。もう一度お試しください。'; $lang['calendar_url'] = 'カレンダーURL'; $lang['please_select'] = '選択してください'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/latvian/translations_lang.php b/application/language/latvian/translations_lang.php index f6ccff1dcb..34482b6254 100644 --- a/application/language/latvian/translations_lang.php +++ b/application/language/latvian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Sniegti nepareizi akreditācijas dati, lūdzu, mēģiniet vēlreiz.'; $lang['calendar_url'] = 'Kalendāra URL'; $lang['please_select'] = 'Lūdzu, izvēlieties'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/lithuanian/translations_lang.php b/application/language/lithuanian/translations_lang.php index de37e3c8dd..3e04394487 100644 --- a/application/language/lithuanian/translations_lang.php +++ b/application/language/lithuanian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Pateikti negaliojantys duomenys, bandykite dar kartą.'; $lang['calendar_url'] = 'Kalendoriaus URL'; $lang['please_select'] = 'Prašome pasirinkti'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index 5b95d32470..2304177789 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Onvalabel Benotzerdaten, probéiert w.e.g. nach eng Kéier.'; $lang['calendar_url'] = 'Kalenner URL'; $lang['please_select'] = 'Wielt w.e.g.'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index 2e6c80ee7e..7c5b492123 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'अवैध प्रमाणपत्रे प्रदान केली गेली, कृपया पुन्हा प्रयत्न करा.'; $lang['calendar_url'] = 'कॅलेंडर URL'; $lang['please_select'] = 'कृपया निवडा'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/norwegian/translations_lang.php b/application/language/norwegian/translations_lang.php index 61ffe972bb..e644235d89 100644 --- a/application/language/norwegian/translations_lang.php +++ b/application/language/norwegian/translations_lang.php @@ -458,4 +458,5 @@ $lang['default_language'] = 'Standardspråk'; $lang['default_language_hint'] = 'Angi standard språkverdi som skal brukes for nye poster.'; $lang['sync_method_prompt'] = 'Hvilken synkroniseringsmetode ønsker du å bruke?'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/persian/translations_lang.php b/application/language/persian/translations_lang.php index c3b5884307..ec90c90fe0 100644 --- a/application/language/persian/translations_lang.php +++ b/application/language/persian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'اعتبارنامههای نامعتبر ارائه شده است، لطفاً دوباره تلاش کنید.'; $lang['calendar_url'] = 'URL تقویم'; $lang['please_select'] = 'لطفاً انتخاب کنید'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index 2f509c8c46..087b5edfec 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Podano nieprawidłowe dane logowania, spróbuj ponownie.'; $lang['calendar_url'] = 'URL kalendarza'; $lang['please_select'] = 'Proszę wybrać'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index ec3dfb4225..8711b64a67 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Credenciais inválidas fornecidas, por favor, tente novamente.'; $lang['calendar_url'] = 'URL do Calendário'; $lang['please_select'] = 'Por Favor, Selecione'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index ff15893902..819ac9c297 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Credenciais inválidas fornecidas, por favor, tente novamente.'; $lang['calendar_url'] = 'URL do Calendário'; $lang['please_select'] = 'Por Favor Selecione'; -// End \ No newline at end of file +$lang['secret_header'] = 'Secret Header'; +// End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index 0de3bfe729..0ee367be2f 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Credențiale invalide furnizate, vă rugăm să încercați din nou.'; $lang['calendar_url'] = 'URL Calendar'; $lang['please_select'] = 'Vă Rugăm să Selectați'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index c98b03a8c0..eb9e39375d 100644 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Предоставлены неверные учетные данные, пожалуйста, попробуйте снова.'; $lang['calendar_url'] = 'URL Календаря'; $lang['please_select'] = 'Пожалуйста, выберите'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/serbian/translations_lang.php b/application/language/serbian/translations_lang.php index f9acfd8400..13881ebfb7 100644 --- a/application/language/serbian/translations_lang.php +++ b/application/language/serbian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Pružene kredencijale su nevažeće, molimo pokušajte ponovo.'; $lang['calendar_url'] = 'URL Kalendara'; $lang['please_select'] = 'Molimo izaberite'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index 5e708d885f..fa8fd649ac 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Poskytnuté údaje sú neplatné, skúste to prosím znova.'; $lang['calendar_url'] = 'URL kalendára'; $lang['please_select'] = 'Vyberte prosím'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/slovenian/translations_lang.php b/application/language/slovenian/translations_lang.php index 803127c480..a010cc6494 100644 --- a/application/language/slovenian/translations_lang.php +++ b/application/language/slovenian/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Navedene neveljavne poverilnice, poskusite znova.'; $lang['calendar_url'] = 'URL koledarja'; $lang['please_select'] = 'Prosim izberite'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index fcf0b43dea..8e5b63e760 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Credenciales inválidas proporcionadas, por favor intente nuevamente.'; $lang['calendar_url'] = 'URL del Calendario'; $lang['please_select'] = 'Por Favor Seleccione'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index e413441348..7690f4f8cf 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Ogiltiga uppgifter angivna, vänligen försök igen.'; $lang['calendar_url'] = 'Kalender-URL'; $lang['please_select'] = 'Vänligen välj'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/thai/translations_lang.php b/application/language/thai/translations_lang.php index 0068dc34d7..da589e1e92 100644 --- a/application/language/thai/translations_lang.php +++ b/application/language/thai/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'ข้อมูลรับรองไม่ถูกต้อง กรุณาลองอีกครั้ง'; $lang['calendar_url'] = 'URL ปฏิทิน'; $lang['please_select'] = 'กรุณาเลือก'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/traditional-chinese/translations_lang.php b/application/language/traditional-chinese/translations_lang.php index 9f402dfa2b..1b63d7ec08 100644 --- a/application/language/traditional-chinese/translations_lang.php +++ b/application/language/traditional-chinese/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = '提供的憑證無效,請重試。'; $lang['calendar_url'] = '日曆網址'; $lang['please_select'] = '請選擇'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index f56bbc6c76..b763c619c1 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -483,4 +483,5 @@ $lang['invalid_credentials_provided'] = 'Geçersiz kimlik bilgileri sağlandı, lütfen tekrar deneyin.'; $lang['calendar_url'] = 'Takvim URL'; $lang['please_select'] = 'Lütfen Seçin'; +$lang['secret_header'] = 'Secret Header'; // End diff --git a/application/libraries/Webhooks_client.php b/application/libraries/Webhooks_client.php index 921c71a3e2..a3ace6f814 100644 --- a/application/libraries/Webhooks_client.php +++ b/application/libraries/Webhooks_client.php @@ -74,13 +74,22 @@ private function call(array $webhook, string $action, array $payload): void try { $client = new Client(); - $client->post($webhook['url'], [ + $headers = []; + + if (!empty($webhook['secret_header']) && !empty($webhook['secret_token'])) { + $headers[$webhook['secret_header']] = $webhook['secret_token']; + } + + $response = $client->post($webhook['url'], [ 'verify' => $webhook['is_ssl_verified'], + 'headers' => $headers, 'json' => [ 'action' => $action, 'payload' => $payload, ], ]); + + echo $response->getBody()->getContents(); // Use this for quick debugging } catch (Throwable $e) { log_message( 'error', diff --git a/application/migrations/060_add_secret_header_column_to_webhooks_table.php b/application/migrations/060_add_secret_header_column_to_webhooks_table.php new file mode 100644 index 0000000000..eb85215a6e --- /dev/null +++ b/application/migrations/060_add_secret_header_column_to_webhooks_table.php @@ -0,0 +1,44 @@ + + * @copyright Copyright (c) Alex Tselegidis + * @license https://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link https://easyappointments.org + * @since v1.4.0 + * ---------------------------------------------------------------------------- */ + +class Migration_Add_secret_header_column_to_webhooks_table extends EA_Migration +{ + /** + * Upgrade method. + */ + public function up(): void + { + if (!$this->db->field_exists('secret_header', 'webhooks')) { + $fields = [ + 'secret_header' => [ + 'type' => 'VARCHAR', + 'constraint' => '256', + 'default' => 'X-Ea-Token', + 'after' => 'actions', + ], + ]; + + $this->dbforge->add_column('webhooks', $fields); + } + } + + /** + * Downgrade method. + */ + public function down(): void + { + if ($this->db->field_exists('secret_header', 'webhooks')) { + $this->dbforge->drop_column('webhooks', 'secret_header'); + } + } +} diff --git a/application/views/pages/webhooks.php b/application/views/pages/webhooks.php index b770b6ebeb..a581bad60f 100755 --- a/application/views/pages/webhooks.php +++ b/application/views/pages/webhooks.php @@ -79,13 +79,21 @@