Add self-service domain registration

This commit is contained in:
kaiyou
2018-04-18 20:31:32 +02:00
parent 1c26c9e376
commit 381e76511d
6 changed files with 105 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
{% extends "base.html" %}
{% block title %}
{% trans %}Register a domain{% endtrans %}
{% endblock %}
{% block content %}
<form class="form" method="post" role="form">
{{ form.hidden_tag() }}
{% call macros.box(title="Requirements") %}
<p>{% trans %}In order to register a new domain, you must first setup the
domain zone so that the domain <code>MX</code> points to this server{% endtrans %}
(<code>{{ config["HOSTNAMES"].split(",")[0] }}</code>).
</p>
<p>
{% trans %}If you do not know how to setup an <code>MX</code> record for your DNS zone,
please contact your DNS provider or administrator. Also, please wait a
couple minutes after the <code>MX</code> is set so the local server cache
expires.{% endtrans %}
</p>
{% endcall %}
{% call macros.box() %}
{% if form.localpart %}
{{ macros.form_fields((form.localpart, form.name), append='<span class="input-group-addon">@</span>') }}
{{ macros.form_fields((form.pw, form.pw2)) }}
{% else %}
{{ macros.form_field(form.name) }}
{% endif %}
{{ macros.form_field(form.captcha) }}
{{ macros.form_field(form.submit) }}
{% endcall %}
</form>
{% endblock %}

View File

@@ -92,6 +92,13 @@
<i class="fa fa-life-ring"></i> <span>{% trans %}Help{% endtrans %}</span>
</a>
</li>
{% if config['DOMAIN_REGISTRATION'] %}
<li>
<a href="{{ url_for('.domain_signup') }}">
<i class="fa fa-plus-square"></i> <span>{% trans %}Register a domain{% endtrans %}</span>
</a>
</li>
{% endif %}
{% if current_user.is_authenticated %}
<li>
<a href="{{ url_for('.logout') }}">