Initial support for Accounts
This adds initial support for accounts a concept meant to signify a customer, a department or any other entity that somehow owns or manages one or more domains.
The purpose is to be able to assign an account to any number of domains, making it easy to track who owns or manages a domain, significantly improving manageability in setups with a large number of domains.
An account consists of a mandatory, unique `name` and optional `description`, `contact` name and `mail` address. The account `name` is stripped of spaces and symbols, and lower cased before getting stored in the database and in PowerDNS, to help ensure some type of predictability and uniqueness in the database.
The term *account* is actually taken from the PowerDNS database, where the `domains.account` column is used to store the account relationship, in in the form of the account `name`.
The link to a domain in PowerDNS-Admin is done through the `domain.account_id` FOREIGN KEY, that is linked to the `account.id` PRIMARY KEY.
(cherry picked from commits 4e95f33dfb0676d1c401a033c28bca3be7d6ec26, da0d596bd019a339549e2c59630a8fdee65d0e22, 7f06e6aaf4fd8011c784f24b7bbbba5f52aef319, 1c624dad8749024033d1d15dd6242ca52b39f135)
2018-06-04 15:10:02 +00:00
|
|
|
{% extends "base.html" %}
|
2018-08-18 11:41:59 +00:00
|
|
|
{% set active_page = "admin_accounts" %}
|
Initial support for Accounts
This adds initial support for accounts a concept meant to signify a customer, a department or any other entity that somehow owns or manages one or more domains.
The purpose is to be able to assign an account to any number of domains, making it easy to track who owns or manages a domain, significantly improving manageability in setups with a large number of domains.
An account consists of a mandatory, unique `name` and optional `description`, `contact` name and `mail` address. The account `name` is stripped of spaces and symbols, and lower cased before getting stored in the database and in PowerDNS, to help ensure some type of predictability and uniqueness in the database.
The term *account* is actually taken from the PowerDNS database, where the `domains.account` column is used to store the account relationship, in in the form of the account `name`.
The link to a domain in PowerDNS-Admin is done through the `domain.account_id` FOREIGN KEY, that is linked to the `account.id` PRIMARY KEY.
(cherry picked from commits 4e95f33dfb0676d1c401a033c28bca3be7d6ec26, da0d596bd019a339549e2c59630a8fdee65d0e22, 7f06e6aaf4fd8011c784f24b7bbbba5f52aef319, 1c624dad8749024033d1d15dd6242ca52b39f135)
2018-06-04 15:10:02 +00:00
|
|
|
{% block title %}<title>DNS Control Panel - Edit Account</title>{% endblock %}
|
|
|
|
|
|
|
|
{% block dashboard_stat %}
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
<section class="content-header">
|
|
|
|
<h1>
|
|
|
|
Account
|
|
|
|
<small>{% if create %}New account{% else %}{{ account.name }}{% endif %}</small>
|
|
|
|
</h1>
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li><a href="{{ url_for('dashboard') }}"><i class="fa fa-dashboard"></i>Home</a></li>
|
|
|
|
<li><a href="{{ url_for('admin_manageaccount') }}">Accounts</a></li>
|
|
|
|
<li class="active">{% if create %}Add{% else %}Edit{% endif %} account</li>
|
|
|
|
</ol>
|
|
|
|
</section>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<section class="content">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4">
|
|
|
|
<div class="box box-primary">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">{% if create %}Add{% else %}Edit{% endif %} account</h3>
|
|
|
|
</div>
|
|
|
|
<!-- /.box-header -->
|
|
|
|
<!-- form start -->
|
|
|
|
<form role="form" method="post" action="{% if create %}{{ url_for('admin_editaccount') }}{% else %}{{ url_for('admin_editaccount', account_name=account.name) }}{% endif %}">
|
|
|
|
<input type="hidden" name="create" value="{{ create }}">
|
|
|
|
<div class="box-body">
|
|
|
|
{% if error %}
|
|
|
|
<div class="alert alert-danger alert-dismissible">
|
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
|
|
|
<h4><i class="icon fa fa-ban"></i> Error!</h4>
|
|
|
|
{{ error }}
|
|
|
|
</div>
|
|
|
|
<span class="help-block">{{ error }}</span>
|
|
|
|
{% endif %}
|
|
|
|
<div class="form-group has-feedback {% if invalid_accountname or duplicate_accountname %}has-error{% endif %}">
|
|
|
|
<label class="control-label" for="accountname">Name</label>
|
|
|
|
<input type="text" class="form-control" placeholder="Account Name (required)"
|
|
|
|
name="accountname" {% if account %}value="{{ account.name }}"{% endif %} {% if not create %}disabled{% endif %}>
|
|
|
|
<span class="fa fa-cog form-control-feedback"></span>
|
|
|
|
{% if invalid_accountname %}
|
|
|
|
<span class="help-block">Cannot be blank and must only contain alphanumeric characters.</span>
|
|
|
|
{% elif duplicate_accountname %}
|
|
|
|
<span class="help-block">Account name already in use.</span>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="form-group has-feedback">
|
|
|
|
<label class="control-label" for="accountdescription">Description</label>
|
|
|
|
<input type="text" class="form-control" placeholder="Account Description (optional)"
|
|
|
|
name="accountdescription" {% if account %}value="{{ account.description }}"{% endif %}>
|
|
|
|
<span class="fa fa-industry form-control-feedback"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group has-feedback">
|
|
|
|
<label class="control-label" for="accountcontact">Contact Person</label>
|
|
|
|
<input type="text" class="form-control" placeholder="Contact Person (optional)"
|
|
|
|
name="accountcontact" {% if account %}value="{{ account.contact }}"{% endif %}>
|
|
|
|
<span class="fa fa-user form-control-feedback"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group has-feedback">
|
|
|
|
<label class="control-label" for="accountmail">Mail Address</label>
|
|
|
|
<input type="email" class="form-control" placeholder="Mail Address (optional)"
|
|
|
|
name="accountmail" {% if account %}value="{{ account.mail }}"{% endif %}>
|
|
|
|
<span class="fa fa-envelope form-control-feedback"></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-06-05 18:41:39 +00:00
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">Access Control</h3>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<p>Users on the right have access to manage records in all domains
|
|
|
|
associated with the account.</p>
|
|
|
|
<p>Click on users to move between columns.</p>
|
|
|
|
<div class="form-group col-xs-2">
|
|
|
|
<select multiple="multiple" class="form-control" id="account_multi_user" name="account_multi_user">
|
|
|
|
{% for user in users %}
|
|
|
|
<option {% if user.id in account_user_ids %}selected{% endif %} value="{{ user.username }}">{{ user.username }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
Initial support for Accounts
This adds initial support for accounts a concept meant to signify a customer, a department or any other entity that somehow owns or manages one or more domains.
The purpose is to be able to assign an account to any number of domains, making it easy to track who owns or manages a domain, significantly improving manageability in setups with a large number of domains.
An account consists of a mandatory, unique `name` and optional `description`, `contact` name and `mail` address. The account `name` is stripped of spaces and symbols, and lower cased before getting stored in the database and in PowerDNS, to help ensure some type of predictability and uniqueness in the database.
The term *account* is actually taken from the PowerDNS database, where the `domains.account` column is used to store the account relationship, in in the form of the account `name`.
The link to a domain in PowerDNS-Admin is done through the `domain.account_id` FOREIGN KEY, that is linked to the `account.id` PRIMARY KEY.
(cherry picked from commits 4e95f33dfb0676d1c401a033c28bca3be7d6ec26, da0d596bd019a339549e2c59630a8fdee65d0e22, 7f06e6aaf4fd8011c784f24b7bbbba5f52aef319, 1c624dad8749024033d1d15dd6242ca52b39f135)
2018-06-04 15:10:02 +00:00
|
|
|
<div class="box-footer">
|
|
|
|
<button type="submit" class="btn btn-flat btn-primary">{% if create %}Create{% else %}Update{% endif %} Account</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-8">
|
|
|
|
<div class="box box-primary">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">Help with creating a new account</h3>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<p>
|
|
|
|
An account allows grouping of domains belonging to a particular entity, such as a customer or department.<br/>
|
|
|
|
A domain can be assigned to an account upon domain creation or through the domain administration page.
|
|
|
|
</p>
|
|
|
|
<p>Fill in all the fields to the in the form to the left.</p>
|
|
|
|
<p>
|
|
|
|
<strong>Name</strong> is an account identifier. It will be stored as all lowercase letters (no spaces, special characters etc).<br/>
|
|
|
|
<strong>Description</strong> is a user friendly name for this account.<br/>
|
|
|
|
<strong>Contact person</strong> is the name of a contact person at the account.<br/>
|
|
|
|
<strong>Mail Address</strong> is an e-mail address for the contact person.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
2018-06-05 18:41:39 +00:00
|
|
|
{% endblock %}
|
|
|
|
{% block extrascripts %}
|
|
|
|
<script>
|
|
|
|
$("#account_multi_user").multiSelect();
|
|
|
|
</script>
|
Initial support for Accounts
This adds initial support for accounts a concept meant to signify a customer, a department or any other entity that somehow owns or manages one or more domains.
The purpose is to be able to assign an account to any number of domains, making it easy to track who owns or manages a domain, significantly improving manageability in setups with a large number of domains.
An account consists of a mandatory, unique `name` and optional `description`, `contact` name and `mail` address. The account `name` is stripped of spaces and symbols, and lower cased before getting stored in the database and in PowerDNS, to help ensure some type of predictability and uniqueness in the database.
The term *account* is actually taken from the PowerDNS database, where the `domains.account` column is used to store the account relationship, in in the form of the account `name`.
The link to a domain in PowerDNS-Admin is done through the `domain.account_id` FOREIGN KEY, that is linked to the `account.id` PRIMARY KEY.
(cherry picked from commits 4e95f33dfb0676d1c401a033c28bca3be7d6ec26, da0d596bd019a339549e2c59630a8fdee65d0e22, 7f06e6aaf4fd8011c784f24b7bbbba5f52aef319, 1c624dad8749024033d1d15dd6242ca52b39f135)
2018-06-04 15:10:02 +00:00
|
|
|
{% endblock %}
|