mirror of
https://github.com/bringout/oca-ocb-security.git
synced 2026-04-20 07:12:04 +02:00
19.0 vanilla
This commit is contained in:
parent
20ddc1b4a3
commit
c0efcc53f5
1162 changed files with 125577 additions and 105287 deletions
|
|
@ -5,12 +5,12 @@
|
|||
<field name="name">Invite to use two-factor authentication</field>
|
||||
<field name="model_id" ref="base.model_res_users"/>
|
||||
<field name="binding_model_id" ref="base.model_res_users"/>
|
||||
<field name="binding_view_types">list</field>
|
||||
<field name="binding_view_types">list,kanban</field>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
action = records.action_totp_invite()
|
||||
</field>
|
||||
<field name="groups_id" eval="[(4, ref('base.group_erp_manager'))]"/>
|
||||
<field name="group_ids" eval="[(4, ref('base.group_erp_manager'))]"/>
|
||||
</record>
|
||||
|
||||
<!--Action called when using the link in "Invite to use 2FA" mail-->
|
||||
|
|
@ -22,6 +22,6 @@
|
|||
user = env.user
|
||||
action = user.action_open_my_account_settings()
|
||||
</field>
|
||||
<field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="group_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<field name="model_id" ref="base.model_res_users" />
|
||||
<field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
|
||||
<field name="subject">Invitation to activate two-factor authentication on your Odoo account</field>
|
||||
<field name="partner_to">{{ object.partner_id.id }}</field>
|
||||
<field name="lang">{{ object.partner_id.lang }}</field>
|
||||
<field name="partner_to" eval="False"/>
|
||||
<field name="use_default_to" eval="True"/>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html" type="html">
|
||||
<div style="margin: 0px; padding: 0px; font-size: 13px;">
|
||||
|
|
@ -20,11 +20,58 @@
|
|||
|
||||
<p style="margin: 16px 0px 16px 0px; text-align: center;">
|
||||
<a t-att-href="object.get_totp_invite_url()"
|
||||
style="background-color:#875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px;">
|
||||
t-attf-style="background-color:{{object.company_id.email_secondary_color or '#875A7B'}}; padding: 8px 16px 8px 16px; text-decoration: none; color: {{object.company_id.email_primary_color or '#FFFFFF'}}; border-radius: 5px;">
|
||||
Activate my two-factor Authentication
|
||||
</a>
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="mail_template_totp_mail_code" model="mail.template">
|
||||
<field name="name">Settings: 2Fa New Login</field>
|
||||
<field name="model_id" ref="base.model_res_users" />
|
||||
<field name="subject">Your two-factor authentication code</field>
|
||||
<field name="email_to" eval="False"/>
|
||||
<field name="use_default_to" eval="True"/>
|
||||
<field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html" type="html">
|
||||
<div style="margin: 0px; padding: 0px; font-size: 13px;">
|
||||
Dear <t t-out="object.partner_id.name or ''"></t><br/><br/>
|
||||
<p>Someone is trying to log in into your account with a new device.</p>
|
||||
<ul>
|
||||
<t t-set="not_available">N/A</t>
|
||||
<li>Location: <t t-out="ctx.get('location') or not_available"/></li>
|
||||
<li>Device: <t t-out="ctx.get('device') or not_available"/></li>
|
||||
<li>Browser: <t t-out="ctx.get('browser') or not_available"/></li>
|
||||
<li>IP address: <t t-out="ctx.get('ip') or not_available"/></li>
|
||||
</ul>
|
||||
<p>If this is you, please enter the following code to complete the login:</p>
|
||||
<t t-set="code_expiration" t-value="object._get_totp_mail_code()"/>
|
||||
<t t-set="code" t-value="code_expiration[0]"/>
|
||||
<t t-set="expiration" t-value="code_expiration[1]"/>
|
||||
<div style="margin: 16px 0px 16px 0px; text-align: center;">
|
||||
<span t-out="code" style="background-color:#faf9fa; border: 1px solid #dad8de; padding: 8px 16px 8px 16px; font-size: 24px; color: #875A7B; border-radius: 5px;"/>
|
||||
</div>
|
||||
<small>Please note that this code expires in <t t-out="expiration"/>.</small>
|
||||
|
||||
<p style="margin: 16px 0px 16px 0px;">
|
||||
If you did NOT initiate this log-in,
|
||||
you should immediately change your password to ensure account security.
|
||||
</p>
|
||||
|
||||
<p style="margin: 16px 0px 16px 0px;">
|
||||
We also strongly recommend enabling the two-factor authentication using an authenticator app to help secure your account.
|
||||
</p>
|
||||
|
||||
<p style="margin: 16px 0px 16px 0px; text-align: center;">
|
||||
<a t-att-href="object.get_totp_invite_url()"
|
||||
style="background-color:#875A7B; padding: 8px 16px 8px 16px; text-decoration: none; color: #fff; border-radius: 5px;">
|
||||
Activate my two-factor authentication
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- Extend the security update template to include 2fa suggestion -->
|
||||
<template id="account_security_alert" inherit_id="mail.account_security_alert">
|
||||
<xpath expr="//div[hasclass('o_mail_account_security_suggestions')]" position="after">
|
||||
<div t-if="suggest_2fa">
|
||||
<span>Consider also</span>
|
||||
<a href="https://www.odoo.com/documentation/latest/applications/general/auth/2fa.html">
|
||||
activating Two-factor Authentication
|
||||
</a>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue