Branding and templates: per-domain, tenant and server logos, /logo, operator calendar email templates and RSVP page (BT-1 to BT-26)
Logos resolve domain, then tenant, then server-wide, then the built-in, with subdomains finding their domain. GET /logo serves a data-URL image, redirects to a URL logo without fetching it, sandboxes SVG, and answers 404 when no custom logo applies. Emails embed the first PNG, JPEG or GIF logo. Logo and template writes are checked; stored templates are read at send time, always escaped, and fall back to the built-in with a build warning when they don't parse. The RSVP page is served byte for byte with a CSP and no-referrer. The sign-in and RSVP pages load the logo through an image element. MT-22's session logo follows the chain to the server-wide logo. Acceptance tests 1 to 17; test 18 written as the ignored branding_compat.
This commit is contained in:
@@ -553,8 +553,17 @@ async fn build_template(
|
||||
};
|
||||
|
||||
|
||||
// inbuxa: BT-11, BT-18: the operator's template, read now, else the built-in
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
let template = &server.core.groupware.alarms_template;
|
||||
let custom = inbuxa_features::branding::templates::stored(
|
||||
server.registry(),
|
||||
inbuxa_features::branding::templates::Which::Alarm,
|
||||
)
|
||||
.await
|
||||
.ok()
|
||||
.flatten();
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
let template = custom.as_ref().unwrap_or(&server.core.groupware.alarms_template);
|
||||
let formatter = TextFormatter::new(account_info.locale().as_str())?;
|
||||
let locale = formatter.locale;
|
||||
|
||||
|
||||
@@ -323,8 +323,17 @@ pub async fn build_itip_template(
|
||||
summary: &ItipSummary,
|
||||
logo_cid: &str,
|
||||
) -> trc::Result<Details> {
|
||||
// inbuxa: BT-11, BT-18: the operator's template, read now, else the built-in
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
let template = &server.core.groupware.itip_template;
|
||||
let custom = inbuxa_features::branding::templates::stored(
|
||||
server.registry(),
|
||||
inbuxa_features::branding::templates::Which::Invite,
|
||||
)
|
||||
.await
|
||||
.ok()
|
||||
.flatten();
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
let template = custom.as_ref().unwrap_or(&server.core.groupware.itip_template);
|
||||
let formatter = TextFormatter::new(account_info.locale().as_str())?;
|
||||
let locale = formatter.locale;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user