[mod] invitation_handle
This commit is contained in:
parent
d712412ac5
commit
2485e9c680
6 changed files with 21 additions and 72 deletions
|
@ -68,7 +68,7 @@ namespace _espe.api
|
|||
"name",
|
||||
]
|
||||
}),
|
||||
"restriction": () => restriction_logged_in,
|
||||
"restriction": () => restriction_none,
|
||||
"execution": () => async ({}) => {
|
||||
const data = await _espe.service.group.list();
|
||||
return Promise.resolve({
|
||||
|
|
|
@ -412,8 +412,8 @@ namespace _espe.conf
|
|||
: 240
|
||||
),
|
||||
"must_contain_letter": (node_settings_password_policy["must_contain_letter"] ?? true),
|
||||
"must_contain_number": (node_settings_password_policy["must_contain_number"] ?? true),
|
||||
"must_contain_special_character": (node_settings_password_policy["must_contain_special_character"] ?? true),
|
||||
"must_contain_number": (node_settings_password_policy["must_contain_number"] ?? false),
|
||||
"must_contain_special_character": (node_settings_password_policy["must_contain_special_character"] ?? false),
|
||||
})) (node_settings["password_policy"] ?? {})
|
||||
),
|
||||
"password_change": (
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
"identifier": "deu"
|
||||
},
|
||||
"tree": {
|
||||
"email.summon.subject": "Registrierung",
|
||||
"email.summon.body": "Hi, {{name}}\n\n{{remark}}\n\nWenn du die Dienste nutzen möchtest, rufe bitte folgende Adresse auf:\n\n{{url}}",
|
||||
"email.registration.subject": "Registrierung erfolgt",
|
||||
"email.registration.body": "Das Mitglied '{{name_display}}' hat sich soeben registriert:\n\n{{url}}",
|
||||
"email.activation.subject": "Freischaltung erfolgt",
|
||||
|
@ -15,7 +13,7 @@
|
|||
"email.password_change.execution.subject": "Passwort-Änderung abgeschlossen",
|
||||
"email.password_change.execution.body": "Hi, {{name}}\n\nDein Passwort wurde soeben geändert.\n",
|
||||
"email.invitation.subject": "Einladung",
|
||||
"email.invitation.body": "{{url}}",
|
||||
"email.invitation.body": "Du wurdest zu {{organisation}} eingeladen. Um beizutreten, rufe bitte folgende Adresse auf:\n\n{{url}}",
|
||||
"help.args.action.description": "auszuführende Aktion; Auswahl",
|
||||
"help.args.action.options.serve": "Server starten",
|
||||
"help.args.action.options.api_doc": "API-Dokumentation gemäß OpenAPI-Spezifikation auf Standard-Ausgabe schreiben",
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
"identifier": "eng"
|
||||
},
|
||||
"tree": {
|
||||
"email.summon.subject": "Registration",
|
||||
"email.summon.body": "Hi, {{name}}\n\n{{remark}}\n\nIn case you want to use online service, open the following link:\n\n{{url}}",
|
||||
"email.registration.subject": "Registration received",
|
||||
"email.registration.body": "The member '{{name_display}}' just registered:\n\n{{url}}",
|
||||
"email.activation.subject": "Activated",
|
||||
|
@ -15,7 +13,7 @@
|
|||
"email.password_change.execution.subject": "Password change concluded",
|
||||
"email.password_change.execution.body": "Hi, {{name}}\n\nYour password has just been changed.\n",
|
||||
"email.invitation.subject": "invitation",
|
||||
"email.invitation.body": "{{url}}",
|
||||
"email.invitation.body": "You have been invited to {{organisation}}. In order to join, please open the following address:\n\n{{url}}",
|
||||
"help.args.action.description": "action to executo; options",
|
||||
"help.args.action.options.serve": "start server",
|
||||
"help.args.action.options.api_doc": "write API documentation according to OpenAPI specification to stdout",
|
||||
|
|
|
@ -68,9 +68,9 @@ namespace _espe.service.invitation
|
|||
"groups_value": groups_value,
|
||||
} : {
|
||||
name_changeable : boolean;
|
||||
name_value : string;
|
||||
name_value : (null | string);
|
||||
label_changeable : boolean;
|
||||
label_value : string;
|
||||
label_value : (null | string);
|
||||
email_address_changeable : boolean;
|
||||
email_address_value : (null | string);
|
||||
groups_changeable : boolean;
|
||||
|
@ -86,7 +86,12 @@ namespace _espe.service.invitation
|
|||
send_immediatly ?: boolean;
|
||||
} = {
|
||||
}
|
||||
) : Promise<{id : _espe.type.invitation_id; key : _espe.type.invitation_key}>
|
||||
) : Promise<
|
||||
{
|
||||
id : _espe.type.invitation_id;
|
||||
key : _espe.type.invitation_key;
|
||||
}
|
||||
>
|
||||
{
|
||||
/**
|
||||
* @todo outsource to conf
|
||||
|
@ -97,7 +102,7 @@ namespace _espe.service.invitation
|
|||
*/
|
||||
const invitation_key : _espe.type.invitation_key = lib_plankton.sha256.get(
|
||||
(
|
||||
name_value
|
||||
(name_value ?? "")
|
||||
+
|
||||
"/"
|
||||
+
|
||||
|
@ -162,18 +167,22 @@ namespace _espe.service.invitation
|
|||
"key": invitation_key,
|
||||
}
|
||||
);
|
||||
try {
|
||||
try
|
||||
{
|
||||
await _espe.helpers.email_send(
|
||||
[email_address_value],
|
||||
lib_plankton.translate.get(
|
||||
"email.invitation.subject",
|
||||
lib_plankton.string.coin(
|
||||
"{{head}} | {{core}}",
|
||||
{
|
||||
"head": _espe.conf.get().settings.organisation.name,
|
||||
"core": lib_plankton.translate.get("email.invitation.subject"),
|
||||
}
|
||||
),
|
||||
lib_plankton.translate.get(
|
||||
"email.invitation.body",
|
||||
{
|
||||
"url": (url ?? "?"),
|
||||
"organisation": _espe.conf.get().settings.organisation.name,
|
||||
}
|
||||
),
|
||||
);
|
||||
|
|
|
@ -343,62 +343,6 @@ namespace _espe.service.member
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* sendet an ein Mitglied eine E-Mail mit Aufforderung zur Registrierung
|
||||
*/
|
||||
export async function summon(
|
||||
member_id : _espe.type.member_id,
|
||||
url_template : string
|
||||
) : Promise<(null | string)>
|
||||
{
|
||||
_espe.helpers.frontend_url_check();
|
||||
const member_object : _espe.type.member_object = await get(member_id);
|
||||
if (member_object.email_address === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
const url : (null | string) = _espe.helpers.frontend_url_get(
|
||||
url_template,
|
||||
{
|
||||
"verification": await _espe.helpers.verification_get(member_id),
|
||||
}
|
||||
);
|
||||
if (url === null) {
|
||||
// do nothing
|
||||
}
|
||||
else {
|
||||
await _espe.helpers.email_send(
|
||||
[
|
||||
member_object.email_address,
|
||||
],
|
||||
lib_plankton.string.coin(
|
||||
"{{head}} | {{core}}",
|
||||
{
|
||||
"head": _espe.conf.get().settings.organisation.name,
|
||||
"core": lib_plankton.translate.get("email.summon.subject"),
|
||||
}
|
||||
),
|
||||
lib_plankton.string.coin(
|
||||
lib_plankton.translate.get("email.summon.body"),
|
||||
{
|
||||
"name": name_display(member_object),
|
||||
"url": url,
|
||||
"remark": (
|
||||
(_espe.conf.get().settings.summon_email.remark === null)
|
||||
? ""
|
||||
: (_espe.conf.get().settings.summon_email.remark + "\n\n")
|
||||
),
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ändert bestimmte Daten des Mitglied
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue