mirror of https://gitlab.federez.net/re2o/re2o
committed by
Gabriel Detraz
13 changed files with 380 additions and 36 deletions
@ -0,0 +1,54 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.11.28 on 2020-04-23 16:04 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.conf import settings |
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
import ldapdb.models.fields |
||||
|
import re2o.mixins |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
("users", "0091_auto_20200423_1256"), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.CreateModel( |
||||
|
name="SSHKey", |
||||
|
fields=[ |
||||
|
( |
||||
|
"id", |
||||
|
models.AutoField( |
||||
|
auto_created=True, |
||||
|
primary_key=True, |
||||
|
serialize=False, |
||||
|
verbose_name="ID", |
||||
|
), |
||||
|
), |
||||
|
("key", models.TextField(blank=True, verbose_name="Public ssh key")), |
||||
|
( |
||||
|
"user", |
||||
|
models.ForeignKey( |
||||
|
on_delete=django.db.models.deletion.CASCADE, |
||||
|
to=settings.AUTH_USER_MODEL, |
||||
|
), |
||||
|
), |
||||
|
], |
||||
|
options={ |
||||
|
"verbose_name": "SSH key", |
||||
|
"verbose_name_plural": "SSH keys", |
||||
|
"permissions": (("view_sshkey", "Can view an SSHKey object"),), |
||||
|
}, |
||||
|
bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), |
||||
|
), |
||||
|
migrations.AddField( |
||||
|
model_name="ldapuser", |
||||
|
name="ssh_keys", |
||||
|
field=ldapdb.models.fields.ListField( |
||||
|
blank=True, db_column="sshkeys", null=True |
||||
|
), |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,18 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.11.28 on 2020-04-23 18:28 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
("users", "0092_auto_20200423_1804"), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RenameField( |
||||
|
model_name="ldapuser", old_name="ssh_keys", new_name="sshkeys", |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Generated by Django 1.11.28 on 2020-04-23 18:30 |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import migrations |
||||
|
import ldapdb.models.fields |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
("users", "0093_auto_20200423_2028"), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name="ldapuser", |
||||
|
name="sshkeys", |
||||
|
field=ldapdb.models.fields.ListField( |
||||
|
blank=True, db_column="sshkeys", max_length=200, null=True |
||||
|
), |
||||
|
), |
||||
|
] |
||||
@ -0,0 +1,60 @@ |
|||||
|
{% comment %} |
||||
|
Re2o est un logiciel d'administration développé initiallement au rezometz. Il |
||||
|
se veut agnostique au réseau considéré, de manière à être installable en |
||||
|
quelques clics. |
||||
|
|
||||
|
Copyright © 2017 Gabriel Détraz |
||||
|
Copyright © 2017 Lara Kermarec |
||||
|
Copyright © 2017 Augustin Lemesle |
||||
|
|
||||
|
This program is free software; you can redistribute it and/or modify |
||||
|
it under the terms of the GNU General Public License as published by |
||||
|
the Free Software Foundation; either version 2 of the License, or |
||||
|
(at your option) any later version. |
||||
|
|
||||
|
This program is distributed in the hope that it will be useful, |
||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
GNU General Public License for more details. |
||||
|
|
||||
|
You should have received a copy of the GNU General Public License along |
||||
|
with this program; if not, write to the Free Software Foundation, Inc., |
||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
||||
|
{% endcomment %} |
||||
|
|
||||
|
{% load i18n %} |
||||
|
|
||||
|
{% load acl %} |
||||
|
{% load logs_extra %} |
||||
|
|
||||
|
|
||||
|
{% if sshkeys.paginator %} |
||||
|
{% include 'pagination.html' with list=sshkeys %} |
||||
|
{% endif %} |
||||
|
|
||||
|
|
||||
|
<table class="table table-striped"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>{% trans "SSH key" %}</th> |
||||
|
<th></th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
{% for sshkey in sshkeys %} |
||||
|
<td>{{ sshkey.key }}</td> |
||||
|
<td class="text-right"> |
||||
|
{% can_delete sshkey %} |
||||
|
{% include 'buttons/suppr.html' with href='users:del-sshkey' id=sshkey.id %} |
||||
|
{% acl_end %} |
||||
|
{% history_button sshkey %} |
||||
|
{% can_edit sshkey %} |
||||
|
{% include 'buttons/edit.html' with href='users:edit-sshkey' id=sshkey.id %} |
||||
|
{% acl_end %} |
||||
|
</td> |
||||
|
</tr> |
||||
|
{% endfor %} |
||||
|
</table> |
||||
|
|
||||
|
{% if sshkey.paginator %} |
||||
|
{% include 'pagination.html' with list=sshkey %} |
||||
|
{% endif %} |
||||
Loading…
Reference in new issue