From ba7b7e572f0634e534320a057f4cc0a95f2a541d Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 25 Nov 2019 11:16:12 +0100 Subject: (plugins) adding signup scope and init hook, modifying ensureUserRegistrationAllowed allowedParams --- shared/models/plugins/client-hook.model.ts | 10 ++++++++-- shared/models/plugins/plugin-client-scope.type.ts | 2 +- shared/models/plugins/register-server-setting.model.ts | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'shared/models/plugins') diff --git a/shared/models/plugins/client-hook.model.ts b/shared/models/plugins/client-hook.model.ts index 07ea7eb96..91167ff8c 100644 --- a/shared/models/plugins/client-hook.model.ts +++ b/shared/models/plugins/client-hook.model.ts @@ -38,7 +38,10 @@ export const clientFilterHookObject = { 'filter:api.search.videos.list.result': true, // Filter params/result of the function that fetch video-channels according to the user search 'filter:api.search.video-channels.list.params': true, - 'filter:api.search.video-channels.list.result': true + 'filter:api.search.video-channels.list.result': true, + + // Filter form + 'filter:api.signup.registration.create.params': true } export type ClientFilterHookName = keyof typeof clientFilterHookObject @@ -58,7 +61,10 @@ export const clientActionHookObject = { 'action:search.init': true, // Fired every time Angular URL changes - 'action:router.navigation-end': true + 'action:router.navigation-end': true, + + // Fired when the registration page is being initialized + 'action:signup.register.init': true } export type ClientActionHookName = keyof typeof clientActionHookObject diff --git a/shared/models/plugins/plugin-client-scope.type.ts b/shared/models/plugins/plugin-client-scope.type.ts index 0c616c5ed..1c6d884f0 100644 --- a/shared/models/plugins/plugin-client-scope.type.ts +++ b/shared/models/plugins/plugin-client-scope.type.ts @@ -1 +1 @@ -export type PluginClientScope = 'common' | 'video-watch' | 'search' +export type PluginClientScope = 'common' | 'video-watch' | 'search' | 'signup' diff --git a/shared/models/plugins/register-server-setting.model.ts b/shared/models/plugins/register-server-setting.model.ts index 78c5abd1b..65a181705 100644 --- a/shared/models/plugins/register-server-setting.model.ts +++ b/shared/models/plugins/register-server-setting.model.ts @@ -3,7 +3,8 @@ export interface RegisterServerSettingOptions { label: string type: 'input' - // If the setting is not private, anyone can view its value + // If the setting is not private, anyone can view its value (client code included) + // If the setting is private, only server-side hooks can access it // Mainly used by the PeerTube client to get admin config private: boolean -- cgit v1.2.3