diff --git a/CHANGELOG.md b/CHANGELOG.md index 901f7b8e..a3bf2a23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,71 @@ +# Re2o 2.9 + +## Install steps + +To install the latest version of Re2o, checkout the [dedicated wiki entry](https://gitlab.federez.net/re2o/re2o/-/wikis/User-Documentation/Quick-Start#update-re2o). + +## Post-install steps + +### MR 531: FreeRADIUS Python3 backend + +On the Radius server, add `buster-backports` to your `/etc/apt/sources.list`: +```bash +echo "deb http://deb.debian.org/debian buster-backports main contrib" >> /etc/apt/sources.list +``` + +**Note:** If you are running Debian Bullseye, the package should already be available without going through backports. + +Then install the new required packages: +```bash +apt update +apt install -t buster-backports freeradius +cat apt_requirements_radius.txt | xargs sudo apt -y install +``` + +### MR 582: Autocomplete light + +On the Re2o server, install the new dependency and run `collectstatic`: +```bash +sudo pip3 install -r pip_requirements.txt +python3 manage.py collectstatic +``` + +### MR 589: Move ldap to optional app + +Add `ldap_sync` to your optional apps in your local settings if you want to keep using the LDAP synchronisation. + +### Final steps + +As usual, run the following commands after updating: +```bash +python3 manage.py migrate +sudo service apache2 reload +``` + +## New features + +Here is a list of noteworthy features brought by this update: + +* [!488](https://gitlab.federez.net/re2o/re2o/-/merge_requests/488): Use `+` in searches to combine keywords (e.g. `John+Doe`). +* [!495](https://gitlab.federez.net/re2o/re2o/-/merge_requests/495): Add optional behavior allowing users to override another user's room, if that user is no longer active. +* [!496](https://gitlab.federez.net/re2o/re2o/-/merge_requests/496): Add option to allow users to choose their password during account creation. They will have to separately confirm their email address. +* [!504](https://gitlab.federez.net/re2o/re2o/-/merge_requests/504): Add setting to change the minimum password length. +* [!507](https://gitlab.federez.net/re2o/re2o/-/merge_requests/507): New form for editing lists of rights that should make everyone happier. +* [!512](https://gitlab.federez.net/re2o/re2o/-/merge_requests/512): Add ability to comment on tickets. +* [!513](https://gitlab.federez.net/re2o/re2o/-/merge_requests/513): IP and MAC address history (`Statistics > Machine history` tab) which also works for deleted interfaces. Uses already existing history so events before the upgrade are taken into account. +* [!516](https://gitlab.federez.net/re2o/re2o/-/merge_requests/516): Detailed events in history views (e.g. show `old_email -> new_email`). +* [!519](https://gitlab.federez.net/re2o/re2o/-/merge_requests/519): Add ability to filter event logs (e.g. to show all the subscriptions added by an admin). +* [!569](https://gitlab.federez.net/re2o/re2o/-/merge_requests/569): Refactor navbar to make menu navigation easier. +* [!569](https://gitlab.federez.net/re2o/re2o/-/merge_requests/569): Add ability to install custom themes. +* [!578](https://gitlab.federez.net/re2o/re2o/-/merge_requests/578) : Migrations squashed to ease the installation process. +* [!582](https://gitlab.federez.net/re2o/re2o/-/merge_requests/582): Improve autocomplete fields so they load faster and have a clearer behavior (no more entering a value without clicking and thinking it was taken into account). +* [!589](https://gitlab.federez.net/re2o/re2o/-/merge_requests/589): Move LDAP to a separate optional app. +* Plenty of bux fixes. + +You can view the full list of closed issues [here](https://gitlab.federez.net/re2o/re2o/-/issues?scope=all&state=all&milestone_title=Re2o 2.9). + +# Before Re2o 2.9 + ## MR 160: Datepicker Install libjs-jquery libjs-jquery-ui libjs-jquery-timepicker libjs-bootstrap javascript-common @@ -21,7 +89,6 @@ rm static_files/js/jquery-2.2.4.min.js rm static/css/jquery-ui-timepicker-addon.css ``` - ## MR 159: Graph topo & MR 164: branche de création de graph Add a graph of the network topology @@ -34,7 +101,6 @@ Create the *media/images* directory: mkdir -p media/images ``` - ## MR 163: Fix install re2o Refactored install_re2o.sh script. @@ -45,8 +111,6 @@ install_re2o.sh help * The installation templates (LDIF files and `re2o/settings_locale.example.py`) have been changed to use `example.net` instead of `example.org` (more neutral and generic) - - ## MR 176: Add awesome Logo Add the logo and fix somme issues on the navbar and home page. Only collecting the statics is needed: @@ -54,7 +118,6 @@ Add the logo and fix somme issues on the navbar and home page. Only collecting t python3 manage.py collectstatic ``` - ## MR 172: Refactor API Creates a new (nearly) REST API to expose all models of Re2o. See [the dedicated wiki page](https://gitlab.federez.net/federez/re2o/wikis/API/Raw-Usage) for more details on how to use it. @@ -75,7 +138,6 @@ OPTIONAL_APPS = ( ) ``` - ## MR 177: Add django-debug-toolbar support Add the possibility to enable `django-debug-toolbar` in debug mode. First install the APT package: diff --git a/api/acl.py b/api/acl.py index 829f8ea9..e672338e 100644 --- a/api/acl.py +++ b/api/acl.py @@ -31,31 +31,6 @@ from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext as _ -def _create_api_permission(): - """Creates the 'use_api' permission if not created. - - The 'use_api' is a fake permission in the sense it is not associated with an - existing model and this ensure the permission is created every time this file - is imported. - """ - api_content_type, created = ContentType.objects.get_or_create( - app_label=settings.API_CONTENT_TYPE_APP_LABEL, - model=settings.API_CONTENT_TYPE_MODEL, - ) - if created: - api_content_type.save() - api_permission, created = Permission.objects.get_or_create( - name=settings.API_PERMISSION_NAME, - content_type=api_content_type, - codename=settings.API_PERMISSION_CODENAME, - ) - if created: - api_permission.save() - - -_create_api_permission() - - def can_view(user, *args, **kwargs): """Check if an user can view the application. diff --git a/api/migrations/0001_initial.py b/api/migrations/0001_initial.py new file mode 100644 index 00000000..44316324 --- /dev/null +++ b/api/migrations/0001_initial.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations +from django.conf import settings + +def create_api_permission(apps, schema_editor): + """Creates the 'use_api' permission if not created. + + The 'use_api' is a fake permission in the sense it is not associated with an + existing model and this ensure the permission is created. + """ + ContentType = apps.get_model("contenttypes", "ContentType") + Permission = apps.get_model("auth", "Permission") + api_content_type, created = ContentType.objects.get_or_create( + app_label=settings.API_CONTENT_TYPE_APP_LABEL, + model=settings.API_CONTENT_TYPE_MODEL, + ) + if created: + api_content_type.save() + api_permission, created = Permission.objects.get_or_create( + name=settings.API_PERMISSION_NAME, + content_type=api_content_type, + codename=settings.API_PERMISSION_CODENAME, + ) + if created: + api_permission.save() + +class Migration(migrations.Migration): + initial = True + dependencies = [] + operations = [ + migrations.RunPython(create_api_permission) + ] diff --git a/api/migrations/__init__.py b/api/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cotisations/migrations/0001_model_creation.py b/cotisations/migrations/0001_model_creation.py new file mode 100644 index 00000000..fcd4e769 --- /dev/null +++ b/cotisations/migrations/0001_model_creation.py @@ -0,0 +1,970 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import django.core.validators +import re2o.mixins +import re2o.aes_field +import re2o.field_permissions +import cotisations.models +import cotisations.payment_methods.mixins + + +class Migration(migrations.Migration): + initial = True + dependencies = [] + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + operations = [ + migrations.CreateModel( + name="BaseInvoice", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("date", models.DateTimeField(auto_now_add=True, verbose_name="date")), + ], + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + re2o.field_permissions.FieldPermissionModelMixin, + models.Model, + ), + ), + migrations.CreateModel( + name="Facture", + fields=[ + ( + "baseinvoice_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="cotisations.BaseInvoice", + ), + ), + ( + "cheque", + models.CharField( + max_length=255, blank=True, verbose_name="cheque number" + ), + ), + ("valid", models.BooleanField(default=False, verbose_name="validated")), + ( + "control", + models.BooleanField(default=False, verbose_name="controlled"), + ), + ], + options={ + "permissions": ( + ("change_facture_control", 'Can edit the "controlled" state'), + ("view_facture", "Can view an invoice object"), + ("change_all_facture", "Can edit all the previous invoices"), + ), + "verbose_name": "invoice", + "verbose_name_plural": "invoices", + }, + ), + migrations.CreateModel( + name="CustomInvoice", + fields=[ + ( + "baseinvoice_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="cotisations.BaseInvoice", + ), + ), + ( + "recipient", + models.CharField(max_length=255, verbose_name="recipient"), + ), + ( + "payment", + models.CharField(max_length=255, verbose_name="payment type"), + ), + ("address", models.CharField(max_length=255, verbose_name="address")), + ("paid", models.BooleanField(default=False, verbose_name="paid")), + ( + "remark", + models.TextField(verbose_name="remark", blank=True, null=True), + ), + ], + bases=("cotisations.baseinvoice",), + options={ + "permissions": ( + ("view_custominvoice", "Can view a custom invoice object"), + ) + }, + ), + migrations.CreateModel( + name="CostEstimate", + fields=[ + ( + "custominvoice_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="cotisations.CustomInvoice", + ), + ), + ( + "validity", + models.DurationField( + verbose_name="period of validity", help_text="DD HH:MM:SS" + ), + ), + ], + options={ + "permissions": ( + ("view_costestimate", "Can view a cost estimate object"), + ) + }, + bases=("cotisations.custominvoice",), + ), + migrations.CreateModel( + name="Vente", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "number", + models.IntegerField( + validators=[django.core.validators.MinValueValidator(1)], + verbose_name="amount", + ), + ), + ("name", models.CharField(max_length=255, verbose_name="article")), + ( + "prix", + models.DecimalField( + max_digits=5, decimal_places=2, verbose_name="price" + ), + ), + ( + "duration_connection", + models.PositiveIntegerField( + default=0, verbose_name="duration of the connection (in months)" + ), + ), + ( + "duration_days_connection", + models.PositiveIntegerField( + default=0, + verbose_name="duration of the connection (in days, will be added to duration in months)", + ), + ), + ( + "duration_membership", + models.PositiveIntegerField( + default=0, verbose_name="duration of the membership (in months)" + ), + ), + ( + "duration_days_membership", + models.PositiveIntegerField( + default=0, + verbose_name="duration of the membership (in days, will be added to duration in months)", + ), + ), + ], + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + options={ + "permissions": ( + ("view_vente", "Can view a purchase object"), + ("change_all_vente", "Can edit all the previous purchases"), + ), + "verbose_name": "purchase", + "verbose_name_plural": "purchases", + }, + ), + migrations.CreateModel( + name="Article", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "name", + models.CharField(max_length=255, verbose_name="designation"), + ), + ( + "prix", + models.DecimalField( + max_digits=5, decimal_places=2, verbose_name="unit price" + ), + ), + ( + "duration_connection", + models.PositiveIntegerField( + verbose_name="duration of the connection (in months)" + ), + ), + ( + "duration_days_connection", + models.PositiveIntegerField( + verbose_name="duration of the connection (in days, will be added to duration in months)", + ), + ), + ( + "duration_membership", + models.PositiveIntegerField( + verbose_name="duration of the membership (in months)" + ), + ), + ( + "duration_days_membership", + models.PositiveIntegerField( + verbose_name="duration of the membership (in days, will be added to duration in months)", + ), + ), + ( + "need_membership", + models.BooleanField( + default=True, verbose_name="need membership to be purchased" + ), + ), + ( + "type_user", + models.CharField( + choices=[ + ("Adherent", "Member"), + ("Club", "Club"), + ("All", "Both of them"), + ], + default="All", + max_length=255, + verbose_name="type of users concerned", + ), + ), + ( + "available_for_everyone", + models.BooleanField( + default=False, verbose_name="is available for every user" + ), + ), + ], + options={ + "permissions": ( + ("view_article", "Can view an article object"), + ("buy_every_article", "Can buy every article"), + ), + "verbose_name": "article", + "verbose_name_plural": "articles", + }, + ), + migrations.CreateModel( + name="Banque", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ], + options={ + "permissions": (("view_banque", "Can view a bank object"),), + "verbose_name": "bank", + "verbose_name_plural": "banks", + }, + ), + migrations.CreateModel( + name="Paiement", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("moyen", models.CharField(max_length=255, verbose_name="method")), + ( + "available_for_everyone", + models.BooleanField( + default=False, + verbose_name="is available for every user", + ), + ), + ( + "is_balance", + models.BooleanField( + default=False, + editable=False, + verbose_name="is user balance", + help_text="There should be only one balance payment method.", + validators=[cotisations.models.check_no_balance], + ), + ), + ], + options={ + "permissions": ( + ("view_paiement", "Can view a payment method object"), + ("use_every_payment", "Can use every payment method"), + ), + "verbose_name": "payment method", + "verbose_name_plural": "payment methods", + }, + ), + migrations.CreateModel( + name="Cotisation", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "date_start_con", + models.DateTimeField(verbose_name="start date for the connection"), + ), + ( + "date_end_con", + models.DateTimeField(verbose_name="end date for the connection"), + ), + ( + "date_start_memb", + models.DateTimeField(verbose_name="start date for the membership"), + ), + ( + "date_end_memb", + models.DateTimeField(verbose_name="end date for the membership"), + ), + ], + options={ + "permissions": ( + ("view_cotisation", "Can view a subscription object"), + ("change_all_cotisation", "Can edit the previous subscriptions"), + ), + "verbose_name": "subscription", + "verbose_name_plural": "subscriptions", + }, + ), + migrations.CreateModel( + name="BalancePayment", + bases=(cotisations.payment_methods.mixins.PaymentMethodMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "minimum_balance", + models.DecimalField( + verbose_name="minimum balance", + help_text="The minimal amount of money allowed for the balance at the end of a payment. You can specify a negative amount.", + max_digits=5, + decimal_places=2, + default=0, + ), + ), + ( + "maximum_balance", + models.DecimalField( + verbose_name="maximum balance", + help_text="The maximal amount of money allowed for the balance.", + max_digits=5, + decimal_places=2, + default=50, + blank=True, + null=True, + ), + ), + ( + "credit_balance_allowed", + models.BooleanField( + verbose_name="allow user to credit their balance", default=False + ), + ), + ], + options={"verbose_name": "user balance"}, + ), + migrations.CreateModel( + name="ChequePayment", + bases=(cotisations.payment_methods.mixins.PaymentMethodMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ], + options={"verbose_name": "cheque"}, + ), + migrations.CreateModel( + name="ComnpayPayment", + bases=(cotisations.payment_methods.mixins.PaymentMethodMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "payment_credential", + models.CharField( + max_length=255, + default="", + blank=True, + verbose_name="ComNpay VAT Number", + ), + ), + ( + "payment_pass", + re2o.aes_field.AESEncryptedField( + max_length=255, + null=True, + blank=True, + verbose_name="ComNpay secret key", + ), + ), + ( + "minimum_payment", + models.DecimalField( + verbose_name="minimum payment", + help_text="The minimal amount of money you have to use when paying with ComNpay.", + max_digits=5, + decimal_places=2, + default=1, + ), + ), + ( + "production", + models.BooleanField( + default=True, + verbose_name="production mode enabled (production URL, instead of homologation)", + ), + ), + ], + options={"verbose_name": "ComNpay"}, + ), + migrations.CreateModel( + name="FreePayment", + bases=(cotisations.payment_methods.mixins.PaymentMethodMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ], + options={"verbose_name": "Free payment"}, + ), + migrations.CreateModel( + name="NotePayment", + bases=(cotisations.payment_methods.mixins.PaymentMethodMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("server", models.CharField(max_length=255, verbose_name="server")), + ("port", models.PositiveIntegerField(blank=True, null=True)), + ("id_note", models.PositiveIntegerField(blank=True, null=True)), + ], + options={"verbose_name": "NoteKfet"}, + ), + ] diff --git a/cotisations/migrations/0002_foreign_keys.py b/cotisations/migrations/0002_foreign_keys.py new file mode 100644 index 00000000..73353baf --- /dev/null +++ b/cotisations/migrations/0002_foreign_keys.py @@ -0,0 +1,500 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-12-30 15:27 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('cotisations', '0001_model_creation'), + ] + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + + operations = [ + migrations.AddField( + model_name='balancepayment', + name='payment', + field=models.OneToOneField(default=None, editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='payment_method_balance', to='cotisations.Paiement'), + preserve_default=False, + ), + migrations.AddField( + model_name='chequepayment', + name='payment', + field=models.OneToOneField(default=None, editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='payment_method_cheque', to='cotisations.Paiement'), + preserve_default=False, + ), + migrations.AddField( + model_name='comnpaypayment', + name='payment', + field=models.OneToOneField(default=None, editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='payment_method_comnpay', to='cotisations.Paiement'), + preserve_default=False, + ), + migrations.AddField( + model_name='costestimate', + name='final_invoice', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='origin_cost_estimate', to='cotisations.CustomInvoice'), + ), + migrations.AddField( + model_name='cotisation', + name='vente', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='cotisations.Vente', verbose_name='purchase'), + ), + migrations.AddField( + model_name='facture', + name='banque', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='cotisations.Banque'), + ), + migrations.AddField( + model_name='facture', + name='paiement', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='cotisations.Paiement'), + preserve_default=False, + ), + migrations.AddField( + model_name='facture', + name='user', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + migrations.AddField( + model_name='freepayment', + name='payment', + field=models.OneToOneField(default=None, editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='payment_method_free', to='cotisations.Paiement'), + preserve_default=False, + ), + migrations.AddField( + model_name='notepayment', + name='payment', + field=models.OneToOneField(default=None, editable=False, on_delete=django.db.models.deletion.CASCADE, related_name='payment_method_note', to='cotisations.Paiement'), + preserve_default=False, + ), + migrations.AddField( + model_name='vente', + name='facture', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='cotisations.BaseInvoice', verbose_name='invoice'), + preserve_default=False, + ), + ] diff --git a/cotisations/utils.py b/cotisations/utils.py index 8166b0be..f484546a 100644 --- a/cotisations/utils.py +++ b/cotisations/utils.py @@ -105,8 +105,8 @@ def send_mail_voucher(invoice, request=None): "lastname": invoice.user.surname, "email": invoice.user.email, "phone": invoice.user.telephone, - "date_end": invoice.get_subscription().latest("date_end").date_end_memb, - "date_begin": invoice.get_subscription().earliest("date_start").date_start_memb, + "date_end": invoice.get_subscription().latest("date_end_memb").date_end_memb, + "date_begin": invoice.get_subscription().earliest("date_start_memb").date_start_memb, } templatename = CotisationsOption.get_cached_value( "voucher_template" diff --git a/ldap_sync/__init__.py b/ldap_sync/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ldap_sync/admin.py b/ldap_sync/admin.py new file mode 100644 index 00000000..0cba55da --- /dev/null +++ b/ldap_sync/admin.py @@ -0,0 +1,64 @@ +from django.contrib import admin + +from .models import ( + LdapUser, + LdapServiceUser, + LdapServiceUserGroup, + LdapUserGroup, +) + +class LdapUserAdmin(admin.ModelAdmin): + """LdapUser Admin view. Can't change password, manage + by User General model. + + Parameters: + Django ModelAdmin: Apply on django ModelAdmin + + """ + list_display = ("name", "uidNumber", "login_shell") + exclude = ("user_password", "sambat_nt_password") + search_fields = ("name",) + + +class LdapServiceUserAdmin(admin.ModelAdmin): + """LdapServiceUser Admin view. Can't change password, manage + by User General model. + + Parameters: + Django ModelAdmin: Apply on django ModelAdmin + + """ + + list_display = ("name",) + exclude = ("user_password",) + search_fields = ("name",) + + +class LdapUserGroupAdmin(admin.ModelAdmin): + """LdapUserGroup Admin view. + + Parameters: + Django ModelAdmin: Apply on django ModelAdmin + + """ + + list_display = ("name", "members", "gid") + search_fields = ("name",) + + +class LdapServiceUserGroupAdmin(admin.ModelAdmin): + """LdapServiceUserGroup Admin view. + + Parameters: + Django ModelAdmin: Apply on django ModelAdmin + + """ + + list_display = ("name",) + search_fields = ("name",) + + +admin.site.register(LdapUser, LdapUserAdmin) +admin.site.register(LdapUserGroup, LdapUserGroupAdmin) +admin.site.register(LdapServiceUser, LdapServiceUserAdmin) +admin.site.register(LdapServiceUserGroup, LdapServiceUserGroupAdmin) diff --git a/ldap_sync/apps.py b/ldap_sync/apps.py new file mode 100644 index 00000000..b96c34d1 --- /dev/null +++ b/ldap_sync/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class LdapSyncConfig(AppConfig): + name = 'ldap_sync' diff --git a/users/management/commands/ldap_rebuild.py b/ldap_sync/management/commands/ldap_rebuild.py similarity index 94% rename from users/management/commands/ldap_rebuild.py rename to ldap_sync/management/commands/ldap_rebuild.py index c8b172f9..1fc3c969 100644 --- a/users/management/commands/ldap_rebuild.py +++ b/ldap_sync/management/commands/ldap_rebuild.py @@ -1,4 +1,5 @@ # Copyright © 2018 Maël Kervella +# Copyright © 2021 Hugo Levy-Falk # # 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 @@ -21,6 +22,7 @@ from django.core.management.base import BaseCommand, CommandError from django.conf import settings from users.models import User, ListRight +from ldap_sync.models import synchronise_user, synchronise_serviceuser, synchronise_usergroup def split_lines(lines): @@ -89,9 +91,9 @@ def flush_ldap(binddn, bindpass, server, usersdn, groupsdn): def sync_ldap(): """Syncrhonize the whole LDAP with the DB.""" for u in User.objects.all(): - u.ldap_sync() + synchronise_user(sender=User, instance=u) for lr in ListRight.objects.all(): - lr.ldap_sync() + synchronise_usergroup(sender=ListRight, instance=lr) class Command(BaseCommand): diff --git a/users/management/commands/ldap_sync.py b/ldap_sync/management/commands/ldap_sync.py similarity index 88% rename from users/management/commands/ldap_sync.py rename to ldap_sync/management/commands/ldap_sync.py index 73f6698e..984f3fd7 100644 --- a/users/management/commands/ldap_sync.py +++ b/ldap_sync/management/commands/ldap_sync.py @@ -1,6 +1,7 @@ # Copyright © 2017 Gabriel Détraz # Copyright © 2017 Lara Kermarec # Copyright © 2017 Augustin Lemesle +# Copyright © 2020 Hugo Levy-Falk # # 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 @@ -19,6 +20,7 @@ from django.core.management.base import BaseCommand, CommandError from users.models import User +from ldap_sync.models import synchronise_user class Command(BaseCommand): @@ -36,5 +38,5 @@ class Command(BaseCommand): ) def handle(self, *args, **options): - for usr in User.objects.all(): - usr.ldap_sync(mac_refresh=options["full"]) + for user in User.objects.all(): + synchronise_user(sender=User, instance=user) diff --git a/ldap_sync/migrations/0001_initial.py b/ldap_sync/migrations/0001_initial.py new file mode 100644 index 00000000..01985ee8 --- /dev/null +++ b/ldap_sync/migrations/0001_initial.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2021-01-10 16:59 +from __future__ import unicode_literals + +from django.db import migrations +#from django.conf import settings +import ldapdb.models.fields + +#from ldap_sync.management.commands.ldap_rebuild import flush_ldap, sync_ldap + +#def rebuild_ldap(apps, schema_editor): +# usersdn = settings.LDAP["base_user_dn"] +# groupsdn = settings.LDAP["base_usergroup_dn"] +# binddn = settings.DATABASES["ldap"]["USER"] +# bindpass = settings.DATABASES["ldap"]["PASSWORD"] +# server = settings.DATABASES["ldap"]["NAME"] +# flush_ldap(binddn, bindpass, server, usersdn, groupsdn) + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('users', '0002_foreign_keys') + ] + + operations = [ + migrations.CreateModel( + name='LdapServiceUser', + fields=[ + ('dn', ldapdb.models.fields.CharField(max_length=200, serialize=False)), + ('name', ldapdb.models.fields.CharField(db_column='cn', max_length=200, primary_key=True, serialize=False)), + ('user_password', ldapdb.models.fields.CharField(blank=True, db_column='userPassword', max_length=200, null=True)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='LdapServiceUserGroup', + fields=[ + ('dn', ldapdb.models.fields.CharField(max_length=200, serialize=False)), + ('name', ldapdb.models.fields.CharField(db_column='cn', max_length=200, primary_key=True, serialize=False)), + ('members', ldapdb.models.fields.ListField(blank=True, db_column='member')), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='LdapUser', + fields=[ + ('dn', ldapdb.models.fields.CharField(max_length=200, serialize=False)), + ('gid', ldapdb.models.fields.IntegerField(db_column='gidNumber')), + ('name', ldapdb.models.fields.CharField(db_column='cn', max_length=200, primary_key=True, serialize=False)), + ('uid', ldapdb.models.fields.CharField(db_column='uid', max_length=200)), + ('uidNumber', ldapdb.models.fields.IntegerField(db_column='uidNumber', unique=True)), + ('sn', ldapdb.models.fields.CharField(db_column='sn', max_length=200)), + ('login_shell', ldapdb.models.fields.CharField(blank=True, db_column='loginShell', max_length=200, null=True)), + ('mail', ldapdb.models.fields.CharField(db_column='mail', max_length=200)), + ('given_name', ldapdb.models.fields.CharField(db_column='givenName', max_length=200)), + ('home_directory', ldapdb.models.fields.CharField(db_column='homeDirectory', max_length=200)), + ('display_name', ldapdb.models.fields.CharField(blank=True, db_column='displayName', max_length=200, null=True)), + ('dialupAccess', ldapdb.models.fields.CharField(db_column='dialupAccess', max_length=200)), + ('sambaSID', ldapdb.models.fields.IntegerField(db_column='sambaSID', unique=True)), + ('user_password', ldapdb.models.fields.CharField(blank=True, db_column='userPassword', max_length=200, null=True)), + ('sambat_nt_password', ldapdb.models.fields.CharField(blank=True, db_column='sambaNTPassword', max_length=200, null=True)), + ('macs', ldapdb.models.fields.ListField(blank=True, db_column='radiusCallingStationId', max_length=200, null=True)), + ('shadowexpire', ldapdb.models.fields.CharField(blank=True, db_column='shadowExpire', max_length=200, null=True)), + ], + options={ + 'abstract': False, + }, + ), + migrations.CreateModel( + name='LdapUserGroup', + fields=[ + ('dn', ldapdb.models.fields.CharField(max_length=200, serialize=False)), + ('gid', ldapdb.models.fields.IntegerField(db_column='gidNumber')), + ('members', ldapdb.models.fields.ListField(blank=True, db_column='memberUid')), + ('name', ldapdb.models.fields.CharField(db_column='cn', max_length=200, primary_key=True, serialize=False)), + ], + options={ + 'abstract': False, + }, + ), + migrations.AlterField( + model_name='ldapserviceuser', + name='dn', + field=ldapdb.models.fields.CharField(max_length=200, primary_key=True, serialize=False), + ), + migrations.AlterField( + model_name='ldapserviceusergroup', + name='dn', + field=ldapdb.models.fields.CharField(max_length=200, primary_key=True, serialize=False), + ), + migrations.AlterField( + model_name='ldapuser', + name='dn', + field=ldapdb.models.fields.CharField(max_length=200, primary_key=True, serialize=False), + ), + migrations.AlterField( + model_name='ldapusergroup', + name='dn', + field=ldapdb.models.fields.CharField(max_length=200, primary_key=True, serialize=False), + ), + ] diff --git a/ldap_sync/migrations/__init__.py b/ldap_sync/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ldap_sync/models.py b/ldap_sync/models.py new file mode 100644 index 00000000..b360e7c1 --- /dev/null +++ b/ldap_sync/models.py @@ -0,0 +1,334 @@ +import sys + +from django.db import models +from django.conf import settings +from django.dispatch import receiver + +from django.contrib.auth.models import Group + +import ldapdb.models +import ldapdb.models.fields + +import users.signals +import users.models + +import machines.models + +class LdapUser(ldapdb.models.Model): + """A class representing a LdapUser in LDAP, its LDAP conterpart. + Synced from re2o django User model, (User django models), + with a copy of its attributes/fields into LDAP, so this class is a mirror + of the classic django User model. + + The basedn userdn is specified in settings. + + Attributes: + name: The name of this User + uid: The uid (login) for the unix user + uidNumber: Linux uid number + gid: The default gid number for this user + sn: The user "str" pseudo + login_shell: Linux shell for the user + mail: Email address contact for this user + display_name: Pretty display name for this user + dialupAccess: Boolean, True for valid membership + sambaSID: Identical id as uidNumber + user_password: SSHA hashed password of user + samba_nt_password: NTLM hashed password of user + macs: Multivalued mac address + shadowexpire: Set it to 0 to block access for this user and disabled + account + """ + + # LDAP meta-data + base_dn = settings.LDAP["base_user_dn"] + object_classes = [ + "inetOrgPerson", + "top", + "posixAccount", + "sambaSamAccount", + "radiusprofile", + "shadowAccount", + ] + + # attributes + gid = ldapdb.models.fields.IntegerField(db_column="gidNumber") + name = ldapdb.models.fields.CharField( + db_column="cn", max_length=200, primary_key=True + ) + uid = ldapdb.models.fields.CharField(db_column="uid", max_length=200) + uidNumber = ldapdb.models.fields.IntegerField(db_column="uidNumber", unique=True) + sn = ldapdb.models.fields.CharField(db_column="sn", max_length=200) + login_shell = ldapdb.models.fields.CharField( + db_column="loginShell", max_length=200, blank=True, null=True + ) + mail = ldapdb.models.fields.CharField(db_column="mail", max_length=200) + given_name = ldapdb.models.fields.CharField(db_column="givenName", max_length=200) + home_directory = ldapdb.models.fields.CharField( + db_column="homeDirectory", max_length=200 + ) + display_name = ldapdb.models.fields.CharField( + db_column="displayName", max_length=200, blank=True, null=True + ) + dialupAccess = ldapdb.models.fields.CharField(db_column="dialupAccess") + sambaSID = ldapdb.models.fields.IntegerField(db_column="sambaSID", unique=True) + user_password = ldapdb.models.fields.CharField( + db_column="userPassword", max_length=200, blank=True, null=True + ) + sambat_nt_password = ldapdb.models.fields.CharField( + db_column="sambaNTPassword", max_length=200, blank=True, null=True + ) + macs = ldapdb.models.fields.ListField( + db_column="radiusCallingStationId", max_length=200, blank=True, null=True + ) + shadowexpire = ldapdb.models.fields.CharField( + db_column="shadowExpire", blank=True, null=True + ) + + def __str__(self): + return self.name + + def __unicode__(self): + return self.name + + def save(self, *args, **kwargs): + self.sn = self.name + self.uid = self.name + self.sambaSID = self.uidNumber + super(LdapUser, self).save(*args, **kwargs) + + +@receiver(users.signals.synchronise, sender=users.models.User) +def synchronise_user(sender, **kwargs): + """ + Synchronise an User to the LDAP. + Args: + * sender : The model class. + * instance : The actual instance being synchronised. + * base : Default `True`. When `True`, synchronise basic attributes. + * access_refresh : Default `True`. When `True`, synchronise the access time. + * mac_refresh : Default `True`. When True, synchronise the list of mac addresses. + * group_refresh: Default `False`. When `True` synchronise the groups of the instance. + """ + base=kwargs.get('base', True) + access_refresh=kwargs.get('access_refresh', True) + mac_refresh=kwargs.get('mac_refresh', True ) + group_refresh=kwargs.get('group_refresh', False) + + user=kwargs["instance"] + + if sys.version_info[0] >= 3 and ( + user.state == user.STATE_ACTIVE + or user.state == user.STATE_ARCHIVE + or user.state == user.STATE_DISABLED + ): + user.refresh_from_db() + try: + user_ldap = LdapUser.objects.get(uidNumber=user.uid_number) + except LdapUser.DoesNotExist: + user_ldap = LdapUser(uidNumber=user.uid_number) + base = True + access_refresh = True + mac_refresh = True + if base: + user_ldap.name = user.pseudo + user_ldap.sn = user.pseudo + user_ldap.dialupAccess = str(user.has_access()) + user_ldap.home_directory = user.home_directory + user_ldap.mail = user.get_mail + user_ldap.given_name = ( + user.surname.lower() + "_" + user.name.lower()[:3] + ) + user_ldap.gid = settings.LDAP["user_gid"] + if "{SSHA}" in user.password or "{SMD5}" in user.password: + # We remove the extra $ added at import from ldap + user_ldap.user_password = user.password[:6] + user.password[7:] + elif "{crypt}" in user.password: + # depending on the length, we need to remove or not a $ + if len(user.password) == 41: + user_ldap.user_password = user.password + else: + user_ldap.user_password = user.password[:7] + user.password[8:] + + user_ldap.sambat_nt_password = user.pwd_ntlm.upper() + if user.get_shell: + user_ldap.login_shell = str(user.get_shell) + user_ldap.shadowexpire = user.get_shadow_expire + if access_refresh: + user_ldap.dialupAccess = str(user.has_access()) + if mac_refresh: + user_ldap.macs = [ + str(mac) + for mac in machines.models.Interface.objects.filter(machine__user=user) + .values_list("mac_address", flat=True) + .distinct() + ] + if group_refresh: + # Need to refresh all groups because we don't know which groups + # were updated during edition of groups and the user may no longer + # be part of the updated group (case of group removal) + for group in Group.objects.all(): + if hasattr(group, "listright"): + synchronise_usergroup(users.models.ListRight, instance=group.listright) + user_ldap.save() + +@receiver(users.signals.remove, sender=users.models.User) +def remove_user(sender, **kwargs): + user = kwargs["instance"] + try: + user_ldap = LdapUser.objects.get(name=user.pseudo) + user_ldap.delete() + except LdapUser.DoesNotExist: + pass + +@receiver(users.signals.remove_mass, sender=users.models.User) +def remove_users(sender, **kwargs): + queryset_users = kwargs["queryset"] + LdapUser.objects.filter( + name__in=list(queryset_users.values_list("pseudo", flat=True)) + ).delete() + + +class LdapUserGroup(ldapdb.models.Model): + """A class representing a LdapUserGroup in LDAP, its LDAP conterpart. + Synced from UserGroup, (ListRight/Group django models), + with a copy of its attributes/fields into LDAP, so this class is a mirror + of the classic django ListRight model. + + The basedn usergroupdn is specified in settings. + + Attributes: + name: The name of this LdapUserGroup + gid: The gid number for this unix group + members: Users dn members of this LdapUserGroup + """ + + # LDAP meta-data + base_dn = settings.LDAP["base_usergroup_dn"] + object_classes = ["posixGroup"] + + # attributes + gid = ldapdb.models.fields.IntegerField(db_column="gidNumber") + members = ldapdb.models.fields.ListField(db_column="memberUid", blank=True) + name = ldapdb.models.fields.CharField( + db_column="cn", max_length=200, primary_key=True + ) + + def __str__(self): + return self.name + +@receiver(users.signals.synchronise, sender=users.models.ListRight) +def synchronise_usergroup(sender, **kwargs): + group = kwargs["instance"] + try: + group_ldap = LdapUserGroup.objects.get(gid=group.gid) + except LdapUserGroup.DoesNotExist: + group_ldap = LdapUserGroup(gid=group.gid) + group_ldap.name = group.unix_name + group_ldap.members = [user.pseudo for user in group.user_set.all()] + group_ldap.save() + +@receiver(users.signals.remove, sender=users.models.ListRight) +def remove_usergroup(sender, **kwargs): + group = kwargs["instance"] + try: + group_ldap = LdapUserGroup.objects.get(gid=group.gid) + group_ldap.delete() + except LdapUserGroup.DoesNotExist: + pass + + + +class LdapServiceUser(ldapdb.models.Model): + """A class representing a ServiceUser in LDAP, its LDAP conterpart. + Synced from ServiceUser, with a copy of its attributes/fields into LDAP, + so this class is a mirror of the classic django ServiceUser model. + + The basedn userservicedn is specified in settings. + + Attributes: + name: The name of this ServiceUser + user_password: The SSHA hashed password of this ServiceUser + """ + + # LDAP meta-data + base_dn = settings.LDAP["base_userservice_dn"] + object_classes = ["applicationProcess", "simpleSecurityObject"] + + # attributes + name = ldapdb.models.fields.CharField( + db_column="cn", max_length=200, primary_key=True + ) + user_password = ldapdb.models.fields.CharField( + db_column="userPassword", max_length=200, blank=True, null=True + ) + + def __str__(self): + return self.name + + +def synchronise_serviceuser_group(serviceuser): + try: + group = LdapServiceUserGroup.objects.get(name=serviceuser.access_group) + except: + group = LdapServiceUserGroup(name=serviceuser.access_group) + group.members = list( + LdapServiceUser.objects.filter( + name__in=[ + user.pseudo + for user in users.models.ServiceUser.objects.filter( + access_group=serviceuser.access_group + ) + ] + ).values_list("dn", flat=True) + ) + group.save() + + +@receiver(users.signals.synchronise, sender=users.models.ServiceUser) +def synchronise_serviceuser(sender, **kwargs): + user = kwargs["instance"] + try: + user_ldap = LdapServiceUser.objects.get(name=user.pseudo) + except LdapServiceUser.DoesNotExist: + user_ldap = LdapServiceUser(name=user.pseudo) + user_ldap.user_password = user.password[:6] + user.password[7:] + user_ldap.save() + synchronise_serviceuser_group(user) + +@receiver(users.signals.remove, sender=users.models.ServiceUser) +def remove_serviceuser(sender, **kwargs): + user = kwargs["instance"] + try: + user_ldap = LdapServiceUser.objects.get(name=user.pseudo) + user_ldap.delete() + except LdapUser.DoesNotExist: + pass + synchronise_serviceuser_group(user) + + +class LdapServiceUserGroup(ldapdb.models.Model): + """A class representing a ServiceUserGroup in LDAP, its LDAP conterpart. + Synced from ServiceUserGroup, with a copy of its attributes/fields into LDAP, + so this class is a mirror of the classic django ServiceUserGroup model. + + The basedn userservicegroupdn is specified in settings. + + Attributes: + name: The name of this ServiceUserGroup + members: ServiceUsers dn members of this ServiceUserGroup + """ + + # LDAP meta-data + base_dn = settings.LDAP["base_userservicegroup_dn"] + object_classes = ["groupOfNames"] + + # attributes + name = ldapdb.models.fields.CharField( + db_column="cn", max_length=200, primary_key=True + ) + members = ldapdb.models.fields.ListField(db_column="member", blank=True) + + def __str__(self): + return self.name + diff --git a/ldap_sync/tests.py b/ldap_sync/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/ldap_sync/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/ldap_sync/urls.py b/ldap_sync/urls.py new file mode 100644 index 00000000..24f25ce8 --- /dev/null +++ b/ldap_sync/urls.py @@ -0,0 +1,4 @@ +from django.conf.urls import url +from .import views + +urlpatterns = [] diff --git a/ldap_sync/views.py b/ldap_sync/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/ldap_sync/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/machines/locale/fr/LC_MESSAGES/django.po b/machines/locale/fr/LC_MESSAGES/django.po index 1709f5e6..b5a5abb0 100644 --- a/machines/locale/fr/LC_MESSAGES/django.po +++ b/machines/locale/fr/LC_MESSAGES/django.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: 2.5\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-17 22:00+0100\n" +"POT-Creation-Date: 2021-01-09 00:47+0100\n" "PO-Revision-Date: 2018-06-23 16:35+0200\n" "Last-Translator: Yoann Piétri \n" "Language-Team: \n" @@ -34,112 +34,112 @@ msgstr "" msgid "You don't have the right to view this application." msgstr "Vous n'avez pas le droit de voir cette application." -#: machines/forms.py:78 +#: machines/forms.py:83 msgid "Machine name" msgstr "Nom de la machine" -#: machines/forms.py:99 machines/templates/machines/aff_machines.html:81 +#: machines/forms.py:117 machines/templates/machines/aff_machines.html:81 msgid "MAC address" msgstr "Adresse MAC" -#: machines/forms.py:100 machines/templates/machines/aff_machinetype.html:32 -#: machines/templates/machines/machine.html:112 +#: machines/forms.py:118 machines/templates/machines/aff_machinetype.html:32 +#: machines/templates/machines/machine.html:120 msgid "Machine type" msgstr "Type de machine" -#: machines/forms.py:101 +#: machines/forms.py:119 msgid "Select a machine type" msgstr "Sélectionnez un type de machine" -#: machines/forms.py:103 +#: machines/forms.py:121 msgid "Automatic IPv4 assignment" msgstr "Assignation automatique IPv4" -#: machines/forms.py:173 +#: machines/forms.py:194 msgid "Current aliases" msgstr "Alias actuels" -#: machines/forms.py:195 +#: machines/forms.py:219 msgid "Machine type to add" msgstr "Type de machine à ajouter" -#: machines/forms.py:196 +#: machines/forms.py:220 msgid "Related IP type" msgstr "Type d'IP relié" -#: machines/forms.py:204 +#: machines/forms.py:228 msgid "Current machine types" msgstr "Types de machines actuels" -#: machines/forms.py:229 +#: machines/forms.py:260 msgid "IP type to add" msgstr "Type d'IP à ajouter" -#: machines/forms.py:258 +#: machines/forms.py:289 msgid "Current IP types" msgstr "Types d'IP actuels" -#: machines/forms.py:281 +#: machines/forms.py:312 msgid "Extension to add" msgstr "Extension à ajouter" -#: machines/forms.py:282 machines/templates/machines/aff_extension.html:37 +#: machines/forms.py:313 machines/templates/machines/aff_extension.html:37 msgid "A record origin" msgstr "Enregistrement A origin" -#: machines/forms.py:283 machines/templates/machines/aff_extension.html:39 +#: machines/forms.py:314 machines/templates/machines/aff_extension.html:39 msgid "AAAA record origin" msgstr "Enregistrement AAAA origin" -#: machines/forms.py:284 +#: machines/forms.py:315 msgid "SOA record to use" msgstr "Enregistrement SOA à utiliser" -#: machines/forms.py:285 +#: machines/forms.py:316 msgid "Sign with DNSSEC" msgstr "Signer avec DNSSEC" -#: machines/forms.py:293 +#: machines/forms.py:324 msgid "Current extensions" msgstr "Extensions actuelles" -#: machines/forms.py:335 +#: machines/forms.py:366 msgid "Current SOA records" msgstr "Enregistrements SOA actuels" -#: machines/forms.py:368 +#: machines/forms.py:403 msgid "Current MX records" msgstr "Enregistrements MX actuels" -#: machines/forms.py:403 +#: machines/forms.py:442 msgid "Current NS records" msgstr "Enregistrements NS actuels" -#: machines/forms.py:433 +#: machines/forms.py:475 msgid "Current TXT records" msgstr "Enregistrements TXT actuels" -#: machines/forms.py:463 +#: machines/forms.py:508 msgid "Current DNAME records" msgstr "Enregistrements DNAME actuels" -#: machines/forms.py:493 +#: machines/forms.py:542 msgid "Current SRV records" msgstr "Enregistrements SRV actuels" -#: machines/forms.py:523 +#: machines/forms.py:580 msgid "Current NAS devices" msgstr "Dispositifs NAS actuels" -#: machines/forms.py:556 +#: machines/forms.py:618 msgid "Current roles" msgstr "Rôles actuels" -#: machines/forms.py:598 +#: machines/forms.py:665 msgid "Current services" msgstr "Services actuels" -#: machines/forms.py:640 +#: machines/forms.py:707 msgid "Current VLANs" msgstr "VLANs actuels" @@ -155,7 +155,7 @@ msgstr "Peut voir un objet machine" msgid "Can change the user of a machine" msgstr "Peut changer l'utilisateur d'une machine" -#: machines/models.py:85 machines/views.py:309 +#: machines/models.py:85 machines/views.py:220 msgid "machine" msgstr "machine" @@ -175,7 +175,7 @@ msgstr "Vous n'avez pas le droit de voir toutes les machines." msgid "Nonexistent user." msgstr "Utilisateur inexistant." -#: machines/models.py:161 machines/models.py:1514 +#: machines/models.py:161 machines/models.py:1594 msgid "You don't have the right to add a machine." msgstr "Vous n'avez pas le droit d'ajouter une machine." @@ -183,7 +183,7 @@ msgstr "Vous n'avez pas le droit d'ajouter une machine." msgid "You don't have the right to add a machine to another user." msgstr "Vous n'avez pas le droit d'ajouter une machine à un autre utilisateur." -#: machines/models.py:174 machines/models.py:1533 +#: machines/models.py:174 machines/models.py:1613 #, python-format msgid "" "You reached the maximum number of interfaces that you are allowed to create " @@ -192,7 +192,7 @@ msgstr "" "Vous avez atteint le nombre maximal d'interfaces que vous pouvez créer vous-" "même (%s)." -#: machines/models.py:199 machines/models.py:1576 +#: machines/models.py:199 machines/models.py:1656 msgid "You don't have the right to edit a machine of another user." msgstr "" "Vous n'avez pas le droit de modifier une machine d'un autre utilisateur." @@ -202,7 +202,7 @@ msgid "You don't have the right to delete a machine of another user." msgstr "" "Vous n'avez pas le droit de supprimer une machine d'une autre utilisateur." -#: machines/models.py:245 machines/models.py:2073 +#: machines/models.py:245 machines/models.py:2153 msgid "You don't have the right to view other machines than yours." msgstr "Vous n'avez pas le droit de voir d'autres machines que les vôtres." @@ -226,43 +226,43 @@ msgstr "type de machine" msgid "machine types" msgstr "types de machine" -#: machines/models.py:376 +#: machines/models.py:376 machines/models.py:402 machines/models.py:2234 msgid "You don't have the right to use all machine types." msgstr "Vous n'avez pas le droit d'utiliser tous les types de machine." -#: machines/models.py:413 +#: machines/models.py:441 msgid "Network containing the domain's IPv4 range (optional)." msgstr "Réseau contenant la plage IPv4 du domaine (optionnel)." -#: machines/models.py:418 +#: machines/models.py:446 msgid "Netmask for the domain's IPv4 range." msgstr "Masque de sous-réseau pour la plage IPv4 du domaine." -#: machines/models.py:421 +#: machines/models.py:449 msgid "Enable reverse DNS for IPv4." msgstr "Activer DNS inverse pour IPv4." -#: machines/models.py:428 +#: machines/models.py:456 msgid "Enable reverse DNS for IPv6." msgstr "Activer DNS inverse pour IPv6." -#: machines/models.py:435 +#: machines/models.py:463 msgid "Can view an IP type object" msgstr "Peut voir un objet type d'IP" -#: machines/models.py:436 +#: machines/models.py:464 msgid "Can use all IP types" msgstr "Peut utiliser tous les types d'IP" -#: machines/models.py:438 machines/templates/machines/machine.html:108 +#: machines/models.py:466 machines/templates/machines/machine.html:116 msgid "IP type" -msgstr "type d'IP" +msgstr "Type d'IP" -#: machines/models.py:439 +#: machines/models.py:467 msgid "IP types" -msgstr "types d'IP" +msgstr "Types d'IP" -#: machines/models.py:555 +#: machines/models.py:583 msgid "" "One or several IP addresses from the range are affected, impossible to " "delete the range." @@ -270,25 +270,25 @@ msgstr "" "Une ou plusieurs adresses IP de la plage sont affectées, impossible de " "supprimer la plage." -#: machines/models.py:616 +#: machines/models.py:644 msgid "Domaine IPv4 start and stop must be valid" msgstr "Les valeurs IPv4 Domaine ip start et stop doivent être valides" -#: machines/models.py:618 +#: machines/models.py:646 msgid "Range end must be after range start..." msgstr "La fin de la plage doit être après le début..." -#: machines/models.py:623 +#: machines/models.py:651 msgid "The range is too large, you can't create a larger one than a /16." msgstr "" "La plage est trop grande, vous ne pouvez pas en créer une plus grande " "qu'un /16." -#: machines/models.py:631 +#: machines/models.py:659 msgid "The specified range is not disjoint from existing ranges." msgstr "La plage renseignée n'est pas disjointe des plages existantes." -#: machines/models.py:644 +#: machines/models.py:672 msgid "" "If you specify a domain network or netmask, it must contain the domain's IP " "range." @@ -296,47 +296,47 @@ msgstr "" "Si vous renseignez un réseau ou masque de sous-réseau, il doit contenir la " "plage IP du domaine." -#: machines/models.py:699 +#: machines/models.py:727 msgid "v4 multicast management." msgstr "gestion de multidiffusion v4." -#: machines/models.py:700 +#: machines/models.py:728 msgid "v6 multicast management." msgstr "gestion de multidiffusion v6." -#: machines/models.py:703 +#: machines/models.py:731 msgid "Can view a VLAN object" msgstr "Peut voir un objet VLAN" -#: machines/models.py:704 machines/templates/machines/machine.html:160 +#: machines/models.py:732 machines/templates/machines/machine.html:168 msgid "VLAN" msgstr "VLAN" -#: machines/models.py:705 +#: machines/models.py:733 msgid "VLANs" msgstr "VLANs" -#: machines/models.py:724 +#: machines/models.py:752 msgid "MAC-address" msgstr "MAC-address" -#: machines/models.py:739 +#: machines/models.py:767 msgid "Can view a NAS device object" msgstr "Peut voir un objet dispositif NAS" -#: machines/models.py:740 machines/templates/machines/machine.html:164 +#: machines/models.py:768 machines/templates/machines/machine.html:172 msgid "NAS device" -msgstr "dispositif NAS" +msgstr "Dispositif NAS" -#: machines/models.py:741 +#: machines/models.py:769 msgid "NAS devices" -msgstr "dispositifs NAS" +msgstr "Dispositifs NAS" -#: machines/models.py:766 +#: machines/models.py:794 msgid "Contact email address for the zone." msgstr "Adresse mail de contact pour la zone." -#: machines/models.py:770 +#: machines/models.py:798 msgid "" "Seconds before the secondary DNS have to ask the primary DNS serial to " "detect a modification." @@ -344,7 +344,7 @@ msgstr "" "Secondes avant que le DNS secondaire demande au DNS primaire le serial pour " "détecter une modification." -#: machines/models.py:777 +#: machines/models.py:805 msgid "" "Seconds before the secondary DNS ask the serial again in case of a primary " "DNS timeout." @@ -352,7 +352,7 @@ msgstr "" "Secondes avant que le DNS secondaire demande le serial de nouveau dans le " "cas d'un délai d'attente du DNS primaire." -#: machines/models.py:784 +#: machines/models.py:812 msgid "" "Seconds before the secondary DNS stop answering requests in case of primary " "DNS timeout." @@ -360,121 +360,127 @@ msgstr "" "Secondes avant que le DNS secondaire arrête de répondre aux requêtes dans le " "cas d'un délai d'attente du DNS primaire." -#: machines/models.py:789 machines/models.py:1116 +#: machines/models.py:817 machines/models.py:1170 msgid "Time To Live." msgstr "Temps de vie" -#: machines/models.py:793 +#: machines/models.py:821 msgid "Can view an SOA record object" msgstr "Peut voir un objet enregistrement SOA" -#: machines/models.py:794 machines/templates/machines/aff_extension.html:36 -#: machines/templates/machines/machine.html:120 +#: machines/models.py:822 machines/templates/machines/aff_extension.html:36 +#: machines/templates/machines/machine.html:128 msgid "SOA record" -msgstr "enregistrement SOA" +msgstr "Enregistrement SOA" -#: machines/models.py:795 +#: machines/models.py:823 msgid "SOA records" -msgstr "enregistrements SOA" +msgstr "Enregistrements SOA" -#: machines/models.py:835 +#: machines/models.py:863 msgid "SOA to edit" msgstr "SOA à modifier" -#: machines/models.py:855 +#: machines/models.py:883 msgid "Zone name, must begin with a dot (.example.org)." msgstr "Nom de zone, doit commencer par un point (.example.org)." -#: machines/models.py:863 +#: machines/models.py:891 msgid "A record associated with the zone." msgstr "Enregistrement A associé à la zone." -#: machines/models.py:869 +#: machines/models.py:897 msgid "AAAA record associated with the zone." msgstr "Enregristrement AAAA associé avec la zone." -#: machines/models.py:873 +#: machines/models.py:901 msgid "Should the zone be signed with DNSSEC." msgstr "La zone doit-elle être signée avec DNSSEC." -#: machines/models.py:878 +#: machines/models.py:906 msgid "Can view an extension object" msgstr "Peut voir un objet extension" -#: machines/models.py:879 +#: machines/models.py:907 msgid "Can use all extensions" msgstr "Peut utiliser toutes les extensions" -#: machines/models.py:881 +#: machines/models.py:909 msgid "DNS extension" -msgstr "extension DNS" +msgstr "Extension DNS" -#: machines/models.py:882 +#: machines/models.py:910 msgid "DNS extensions" -msgstr "extensions DNS" +msgstr "Extensions DNS" -#: machines/models.py:952 +#: machines/models.py:980 msgid "You don't have the right to use all extensions." msgstr "Vous n'avez pas le droit d'utiliser toutes les extensions." -#: machines/models.py:961 +#: machines/models.py:1005 +#, fuzzy +#| msgid "You don't have the right to use all extensions." +msgid "You don't have the right to list all extensions." +msgstr "Vous n'avez pas le droit d'utiliser toutes les extensions." + +#: machines/models.py:1015 msgid "An extension must begin with a dot." msgstr "Une extension doit commencer par un point." -#: machines/models.py:981 machines/models.py:1013 machines/models.py:1045 -#: machines/models.py:1075 machines/models.py:1870 +#: machines/models.py:1035 machines/models.py:1067 machines/models.py:1099 +#: machines/models.py:1129 machines/models.py:1950 msgid "Time To Live (TTL)" msgstr "Temps de vie (TTL)" -#: machines/models.py:985 +#: machines/models.py:1039 msgid "Can view an MX record object" msgstr "Peut voir un objet enregistrement MX" -#: machines/models.py:986 machines/templates/machines/machine.html:124 +#: machines/models.py:1040 machines/templates/machines/machine.html:132 msgid "MX record" -msgstr "enregistrement MX" +msgstr "Enregistrement MX" -#: machines/models.py:987 +#: machines/models.py:1041 msgid "MX records" -msgstr "enregistrements MX" +msgstr "Enregistrements MX" -#: machines/models.py:1017 +#: machines/models.py:1071 msgid "Can view an NS record object" msgstr "Peut voir un objet enregistrement NS" -#: machines/models.py:1018 machines/templates/machines/machine.html:128 +#: machines/models.py:1072 machines/templates/machines/machine.html:136 msgid "NS record" -msgstr "enregistrement NS" +msgstr "Enregistrement NS" -#: machines/models.py:1019 +#: machines/models.py:1073 msgid "NS records" -msgstr "enregistrements NS" +msgstr "Enregistrements NS" -#: machines/models.py:1049 +#: machines/models.py:1103 msgid "Can view a TXT record object" msgstr "Peut voir un objet enregistrement TXT" -#: machines/models.py:1050 machines/templates/machines/machine.html:132 +#: machines/models.py:1104 machines/templates/machines/machine.html:140 msgid "TXT record" msgstr "enregistrement TXT" -#: machines/models.py:1051 +#: machines/models.py:1105 msgid "TXT records" msgstr "enregistrements TXT" -#: machines/models.py:1079 +#: machines/models.py:1133 msgid "Can view a DNAME record object" msgstr "Peut voir un objet enregistrement DNAME" -#: machines/models.py:1080 machines/templates/machines/machine.html:136 +#: machines/models.py:1134 machines/templates/machines/machine.html:144 msgid "DNAME record" msgstr "enregistrement DNAME" -#: machines/models.py:1081 +#: machines/models.py:1135 msgid "DNAME records" msgstr "enregistrements DNAME" -#: machines/models.py:1122 +#: machines/models.py:1176 msgid "" "Priority of the target server (positive integer value, the lower it is, the " "more the server will be used if available)." @@ -482,7 +488,7 @@ msgstr "" "Priorité du serveur cible (entier positif, plus il est bas, plus le serveur " "sera utilisé si disponible)." -#: machines/models.py:1131 +#: machines/models.py:1185 msgid "" "Relative weight for records with the same priority (integer value between 0 " "and 65535)." @@ -490,168 +496,172 @@ msgstr "" "Poids relatif des enregistrements avec la même priorité (entier entre 0 et " "65535)." -#: machines/models.py:1136 +#: machines/models.py:1190 msgid "TCP/UDP port." msgstr "Port TCP/UDP." -#: machines/models.py:1139 +#: machines/models.py:1193 msgid "Target server." msgstr "Serveur cible." -#: machines/models.py:1143 +#: machines/models.py:1197 msgid "Can view an SRV record object" msgstr "Peut voir un objet enregistrement SRV" -#: machines/models.py:1144 machines/templates/machines/machine.html:140 +#: machines/models.py:1198 machines/templates/machines/machine.html:148 msgid "SRV record" msgstr "enregistrement SRV" -#: machines/models.py:1145 +#: machines/models.py:1199 msgid "SRV records" msgstr "enregistrements SRV" -#: machines/models.py:1204 +#: machines/models.py:1258 msgid "SSH public key." msgstr "Clé publique SSH." -#: machines/models.py:1207 +#: machines/models.py:1261 msgid "Comment." msgstr "Commentaire." -#: machines/models.py:1232 +#: machines/models.py:1287 msgid "Can view an SSHFP record object" msgstr "Peut voir un objet enregistrement SSHFP" -#: machines/models.py:1233 machines/templates/machines/machine.html:144 -#: machines/views.py:478 +#: machines/models.py:1288 machines/templates/machines/machine.html:152 +#: machines/views.py:387 msgid "SSHFP record" msgstr "enregistrement SSHFP" -#: machines/models.py:1234 +#: machines/models.py:1289 msgid "SSHFP records" msgstr "enregistrements SSHFP" -#: machines/models.py:1272 +#: machines/models.py:1322 +msgid "Ssh pub key entry is incorrect base64 entry" +msgstr "L'entrée Ssh pub key n'est pas une entrée base64 valide" + +#: machines/models.py:1352 msgid "Can view an interface object" msgstr "Peut voir un objet interface" -#: machines/models.py:1273 +#: machines/models.py:1353 msgid "Can change the owner of an interface" msgstr "Peut changer l'utilisateur d'une interface" -#: machines/models.py:1275 machines/views.py:362 +#: machines/models.py:1355 machines/views.py:271 msgid "interface" msgstr "interface" -#: machines/models.py:1276 +#: machines/models.py:1356 msgid "interfaces" msgstr "interfaces" -#: machines/models.py:1319 +#: machines/models.py:1399 msgid "Unknown vendor." msgstr "Constructeur inconnu." -#: machines/models.py:1389 +#: machines/models.py:1469 msgid "The given MAC address is invalid." msgstr "L'adresse MAC indiquée est invalide." -#: machines/models.py:1398 +#: machines/models.py:1478 msgid "There are no IP addresses available in the slash." msgstr "Il n'y a pas d'adresses IP disponibles dans le slash." -#: machines/models.py:1463 +#: machines/models.py:1543 msgid "The selected IP type is invalid." msgstr "Le type d'IP sélectionné est invalide." -#: machines/models.py:1477 +#: machines/models.py:1557 msgid "MAC address already registered in this machine type/subnet." msgstr "Adresse MAC déjà enregistrée dans ce type de machine/sous-réseau." -#: machines/models.py:1486 +#: machines/models.py:1566 msgid "The IPv4 address and the machine type don't match." msgstr "L'adresse IPv4 et le type de machine ne correspondent pas." -#: machines/models.py:1507 +#: machines/models.py:1587 msgid "Nonexistent machine." msgstr "Machine inexistante." -#: machines/models.py:1524 +#: machines/models.py:1604 msgid "" "You don't have the right to add an interface to a machine of another user." msgstr "" "Vous n'avez pas le droit d'ajouter une interface à une machine d'un autre " "utilisateur." -#: machines/models.py:1554 +#: machines/models.py:1634 msgid "You don't have the right to edit the machine." msgstr "Vous n'avez pas le droit d'éditer une machine." -#: machines/models.py:1600 +#: machines/models.py:1680 msgid "You don't have the right to delete interfaces of another user." msgstr "" "Vous n'avez pas le droit de supprimer une interface d'une autre utilisateur." -#: machines/models.py:1624 +#: machines/models.py:1704 msgid "You don't have the right to view interfaces other than yours." msgstr "Vous n'avez pas le droit de voir d'autres interfaces que les vôtres." -#: machines/models.py:1658 +#: machines/models.py:1738 msgid "If false,the DNS will not provide this ip." msgstr "Si faux, le DNS n'annoncera pas cette ip." -#: machines/models.py:1663 +#: machines/models.py:1743 msgid "Can view an IPv6 addresses list object" msgstr "Peut voir un objet list d'adresses IPv6" -#: machines/models.py:1666 +#: machines/models.py:1746 msgid "Can change the SLAAC value of an IPv6 addresses list" msgstr "Peut modifier la valeur SLAAC d'une liste d'adresses IPv6" -#: machines/models.py:1669 machines/views.py:422 +#: machines/models.py:1749 machines/views.py:331 msgid "IPv6 addresses list" msgstr "Liste d'adresses IPv6" -#: machines/models.py:1670 +#: machines/models.py:1750 msgid "IPv6 addresses lists" msgstr "Listes d'adresses IPv6" -#: machines/models.py:1688 machines/models.py:1973 +#: machines/models.py:1768 machines/models.py:2053 msgid "Nonexistent interface." msgstr "Interface inexistante." -#: machines/models.py:1694 +#: machines/models.py:1774 msgid "You don't have the right to add ipv6 to a machine of another user." msgstr "" "Vous n'avez pas le droit d'ajouter des ipv6 à une machine d'un autre " "utilisateur." -#: machines/models.py:1707 +#: machines/models.py:1787 msgid "You don't have the right to change the SLAAC value of an IPv6 address." msgstr "" "Vous n'avez pas le droit de changer la valeur SLAAC d'une adresse IPv6." -#: machines/models.py:1732 +#: machines/models.py:1812 msgid "You don't have the right to edit ipv6 of a machine of another user." msgstr "" "Vous n'avez pas le droit de modifier les ipv6 d'une machine d'un autre " "utilisateur." -#: machines/models.py:1757 +#: machines/models.py:1837 msgid "You don't have the right to delete ipv6 of a machine of another user." msgstr "" "Vous n'avez pas le droit de supprimer les ipv6 d'une machine d'une autre " "utilisateur." -#: machines/models.py:1781 +#: machines/models.py:1861 msgid "You don't have the right to view ipv6 of machines other than yours." msgstr "" "Vous n'avez pas le droit de voir les ipv6 d'autres machines que les vôtres." -#: machines/models.py:1814 +#: machines/models.py:1894 msgid "A SLAAC IP address is already registered." msgstr "Une adresse IP SLAAC est déjà enregistrée." -#: machines/models.py:1828 +#: machines/models.py:1908 msgid "" "The v6 prefix is incorrect and doesn't match the type associated with the " "machine." @@ -659,55 +669,55 @@ msgstr "" "Le préfixe v6 est incorrect et ne correspond pas au type associé à la " "machine." -#: machines/models.py:1863 +#: machines/models.py:1943 msgid "Mandatory and unique, must not contain dots." msgstr "Obligatoire et unique, ne doit pas contenir de points." -#: machines/models.py:1878 +#: machines/models.py:1958 msgid "Can view a domain object" msgstr "Peut voir un objet domaine" -#: machines/models.py:1879 +#: machines/models.py:1959 msgid "Can change the TTL of a domain object" msgstr "Peut changer le TTL d'un objet domaine" -#: machines/models.py:1881 +#: machines/models.py:1961 msgid "domain" msgstr "domaine" -#: machines/models.py:1882 +#: machines/models.py:1962 msgid "domains" msgstr "domaines" -#: machines/models.py:1909 +#: machines/models.py:1989 msgid "You can't create a both A and CNAME record." msgstr "Vous ne pouvez pas créer un enregistrement à la fois A et CNAME." -#: machines/models.py:1912 +#: machines/models.py:1992 msgid "You can't create a CNAME record pointing to itself." msgstr "Vous ne pouvez pas créer un enregistrement CNAME vers lui-même." -#: machines/models.py:1918 +#: machines/models.py:1998 #, python-format msgid "The domain name %s is too long (over 63 characters)." msgstr "Le nom de domaine %s est trop long (plus de 63 caractères)." -#: machines/models.py:1922 +#: machines/models.py:2002 #, python-format msgid "The domain name %s contains forbidden characters." msgstr "Le nom de domaine %s contient des caractères interdits." -#: machines/models.py:1940 +#: machines/models.py:2020 msgid "Invalid extension." msgstr "Extension invalide." -#: machines/models.py:1982 +#: machines/models.py:2062 msgid "You don't have the right to add an alias to a machine of another user." msgstr "" "Vous n'avez pas le droit d'ajouter un alias à une machine d'un autre " "utilisateur." -#: machines/models.py:1998 +#: machines/models.py:2078 #, python-format msgid "" "You reached the maximum number of alias that you are allowed to create " @@ -716,164 +726,164 @@ msgstr "" "Vous avez atteint le nombre maximal d'alias que vous pouvez créer vous-même " "(%s)." -#: machines/models.py:2024 +#: machines/models.py:2104 msgid "You don't have the right to edit an alias of a machine of another user." msgstr "" "Vous n'avez pas le droit de modifier un alias d'une machine d'un autre " "utilisateur." -#: machines/models.py:2049 +#: machines/models.py:2129 msgid "" "You don't have the right to delete an alias of a machine of another user." msgstr "" "Vous n'avez pas le droit de supprimer un alias d'une machine d'un autre " "utilisateur." -#: machines/models.py:2084 +#: machines/models.py:2164 msgid "You don't have the right to change the domain's TTL." msgstr "Vous n'avez pas le droit de changer le TTL du domaine." -#: machines/models.py:2106 +#: machines/models.py:2186 msgid "Can view an IPv4 addresses list object" msgstr "Peut voir un object liste d'adresses IPv4" -#: machines/models.py:2107 +#: machines/models.py:2187 msgid "IPv4 addresses list" msgstr "Liste d'adresses IPv4" -#: machines/models.py:2108 +#: machines/models.py:2188 msgid "IPv4 addresses lists" msgstr "Listes d'adresses IPv4" -#: machines/models.py:2125 +#: machines/models.py:2205 msgid "The IPv4 address and the range of the IP type don't match." msgstr "L'adresse IPv4 et la plage du type d'IP ne correspondent pas." -#: machines/models.py:2149 +#: machines/models.py:2257 msgid "DHCP server" msgstr "Serveur DHCP" -#: machines/models.py:2150 +#: machines/models.py:2258 msgid "Switches configuration server" msgstr "Serveur de configuration des commutateurs réseau" -#: machines/models.py:2151 +#: machines/models.py:2259 msgid "Recursive DNS server" msgstr "Serveur DNS récursif" -#: machines/models.py:2152 +#: machines/models.py:2260 msgid "NTP server" msgstr "Serveur NTP" -#: machines/models.py:2153 +#: machines/models.py:2261 msgid "RADIUS server" msgstr "Serveur RADIUS" -#: machines/models.py:2154 +#: machines/models.py:2262 msgid "Log server" msgstr "Serveur log" -#: machines/models.py:2155 +#: machines/models.py:2263 msgid "LDAP master server" msgstr "Serveur LDAP maître" -#: machines/models.py:2156 +#: machines/models.py:2264 msgid "LDAP backup server" msgstr "Serveur LDAP de secours" -#: machines/models.py:2157 +#: machines/models.py:2265 msgid "SMTP server" msgstr "Serveur SMTP" -#: machines/models.py:2158 +#: machines/models.py:2266 msgid "postgreSQL server" msgstr "Serveur postgreSQL" -#: machines/models.py:2159 +#: machines/models.py:2267 msgid "mySQL server" msgstr "Serveur mySQL" -#: machines/models.py:2160 +#: machines/models.py:2268 msgid "SQL client" msgstr "Client SQL" -#: machines/models.py:2161 +#: machines/models.py:2269 msgid "Gateway" msgstr "Passerelle" -#: machines/models.py:2169 +#: machines/models.py:2277 msgid "Can view a role object" msgstr "Peut voir un objet rôle" -#: machines/models.py:2170 +#: machines/models.py:2278 msgid "server role" msgstr "rôle de serveur" -#: machines/models.py:2171 +#: machines/models.py:2279 msgid "server roles" msgstr "rôles de serveur" -#: machines/models.py:2210 +#: machines/models.py:2318 msgid "Minimal time before regeneration of the service." msgstr "Temps minimal avant régénération du service." -#: machines/models.py:2214 +#: machines/models.py:2322 msgid "Maximal time before regeneration of the service." msgstr "Temps maximal avant régénération du service." -#: machines/models.py:2219 +#: machines/models.py:2327 msgid "Can view a service object" msgstr "Peut voir un objet service" -#: machines/models.py:2220 +#: machines/models.py:2328 msgid "service to generate (DHCP, DNS, ...)" msgstr "service à générer (DHCP, DNS, ...)" -#: machines/models.py:2221 +#: machines/models.py:2329 msgid "services to generate (DHCP, DNS, ...)" msgstr "services à générer (DHCP, DNS, ...)" -#: machines/models.py:2278 +#: machines/models.py:2386 msgid "Can view a service server link object" msgstr "Peut voir un objet lien service serveur" -#: machines/models.py:2280 +#: machines/models.py:2388 msgid "link between service and server" msgstr "lien entre service et serveur" -#: machines/models.py:2281 +#: machines/models.py:2389 msgid "links between service and server" msgstr "liens entre service et serveur" -#: machines/models.py:2328 +#: machines/models.py:2436 msgid "Name of the ports configuration" msgstr "Nom de la configuration de ports" -#: machines/models.py:2333 +#: machines/models.py:2441 msgid "Can view a ports opening list object" msgstr "Peut voir un objet liste d'ouverture de ports" -#: machines/models.py:2335 +#: machines/models.py:2443 msgid "ports opening list" msgstr "liste d'ouverture de ports" -#: machines/models.py:2336 +#: machines/models.py:2444 msgid "ports opening lists" msgstr "listes d'ouverture de ports" -#: machines/models.py:2351 +#: machines/models.py:2459 msgid "You don't have the right to delete a ports opening list." msgstr "Vous n'avez pas le droit de supprimer une liste d'ouverture de ports." -#: machines/models.py:2355 +#: machines/models.py:2463 msgid "This ports opening list is used." msgstr "Cette liste d'ouverture de ports est utilisée." -#: machines/models.py:2419 +#: machines/models.py:2527 msgid "ports opening" msgstr "ouverture de ports" -#: machines/models.py:2420 +#: machines/models.py:2528 msgid "ports openings" msgstr "ouvertures de ports" @@ -903,7 +913,7 @@ msgstr "Enregistrement" #: machines/templates/machines/aff_extension.html:34 #: machines/templates/machines/aff_srv.html:34 -#: machines/templates/machines/machine.html:116 +#: machines/templates/machines/machine.html:124 msgid "Extension" msgstr "Extension" @@ -983,13 +993,13 @@ msgstr "Afficher les adresses IPv6" msgid "No IPv6" msgstr "Pas d'IPv6" -#: machines/templates/machines/aff_machines.html:116 machines/views.py:291 -#: machines/views.py:406 machines/views.py:462 machines/views.py:518 -#: machines/views.py:587 machines/views.py:650 machines/views.py:716 -#: machines/views.py:768 machines/views.py:820 machines/views.py:872 -#: machines/views.py:927 machines/views.py:979 machines/views.py:1041 -#: machines/views.py:1097 machines/views.py:1149 machines/views.py:1215 -#: machines/views.py:1267 machines/views.py:1621 +#: machines/templates/machines/aff_machines.html:116 machines/views.py:202 +#: machines/views.py:315 machines/views.py:371 machines/views.py:427 +#: machines/views.py:496 machines/views.py:559 machines/views.py:625 +#: machines/views.py:677 machines/views.py:729 machines/views.py:781 +#: machines/views.py:836 machines/views.py:888 machines/views.py:950 +#: machines/views.py:1006 machines/views.py:1058 machines/views.py:1124 +#: machines/views.py:1176 machines/views.py:1530 msgid "Edit" msgstr "Modifier" @@ -1082,7 +1092,7 @@ msgstr "UDP (sortie)" #: machines/templates/machines/index_service.html:30 #: machines/templates/machines/index_sshfp.html:28 #: machines/templates/machines/index_vlan.html:30 -#: machines/templates/machines/machine.html:31 +#: machines/templates/machines/machine.html:30 msgid "Machines" msgstr "Machines" @@ -1164,7 +1174,7 @@ msgid "Expire" msgstr "Expiration" #: machines/templates/machines/aff_srv.html:32 -#: machines/templates/machines/machine.html:152 +#: machines/templates/machines/machine.html:160 msgid "Service" msgstr "Service" @@ -1434,101 +1444,97 @@ msgstr "Ajouter un VLAN" msgid "Delete one or several VLANs" msgstr "Supprimer un ou plusieurs VLANs" -#: machines/templates/machines/machine.html:92 +#: machines/templates/machines/machine.html:104 msgid "Machine" msgstr "Machine" -#: machines/templates/machines/machine.html:96 +#: machines/templates/machines/machine.html:108 msgid "Interface" msgstr "Interface" -#: machines/templates/machines/machine.html:104 +#: machines/templates/machines/machine.html:112 msgid "Domain" msgstr "Domaine" -#: machines/templates/machines/machine.html:148 +#: machines/templates/machines/machine.html:156 msgid "Alias" msgstr "Alias" -#: machines/templates/machines/machine.html:168 +#: machines/templates/machines/machine.html:176 msgid "IPv6 address" msgstr "Adresse IPv6" -#: machines/views.py:144 -msgid "Select a machine type first." -msgstr "Sélectionnez un type de machine d'abord." - -#: machines/views.py:236 +#: machines/views.py:151 msgid "The machine was created." msgstr "La machine a été créée." -#: machines/views.py:245 machines/views.py:341 machines/views.py:382 -#: machines/views.py:440 machines/views.py:495 machines/views.py:567 -#: machines/views.py:633 machines/views.py:699 machines/views.py:751 -#: machines/views.py:803 machines/views.py:855 machines/views.py:910 -#: machines/views.py:962 machines/views.py:1019 machines/views.py:1080 -#: machines/views.py:1132 machines/views.py:1198 machines/views.py:1250 +#: machines/views.py:158 machines/views.py:250 machines/views.py:291 +#: machines/views.py:349 machines/views.py:404 machines/views.py:476 +#: machines/views.py:542 machines/views.py:608 machines/views.py:660 +#: machines/views.py:712 machines/views.py:764 machines/views.py:819 +#: machines/views.py:871 machines/views.py:928 machines/views.py:989 +#: machines/views.py:1041 machines/views.py:1107 machines/views.py:1159 msgid "Add" msgstr "Ajouter" -#: machines/views.py:277 +#: machines/views.py:190 msgid "The machine was edited." msgstr "La machine a été modifiée." -#: machines/views.py:304 +#: machines/views.py:215 msgid "The machine was deleted." msgstr "La machine a été supprimée." -#: machines/views.py:331 +#: machines/views.py:242 msgid "The interface was created." msgstr "L'interface a été créée." -#: machines/views.py:357 +#: machines/views.py:266 msgid "The interface was deleted." msgstr "L'interface a été supprimée." -#: machines/views.py:377 +#: machines/views.py:286 msgid "The IPv6 addresses list was created." msgstr "La liste d'adresses IPv6 a été créée." -#: machines/views.py:398 +#: machines/views.py:307 msgid "The IPv6 addresses list was edited." msgstr "La liste d'adresses IPv6 a été modifiée." -#: machines/views.py:417 +#: machines/views.py:326 msgid "The IPv6 addresses list was deleted." msgstr "La liste d'adresses IPv6 a été supprimée." -#: machines/views.py:435 +#: machines/views.py:344 msgid "The SSHFP record was created." msgstr "L'enregistrement SSHFP a été créé." -#: machines/views.py:454 +#: machines/views.py:363 msgid "The SSHFP record was edited." msgstr "L'enregistrement SSHFP a été modifié." -#: machines/views.py:473 +#: machines/views.py:382 msgid "The SSHFP record was deleted." msgstr "L'enregistrement SSHFP a été supprimé." -#: machines/views.py:492 +#: machines/views.py:401 msgid "The IP type was created." msgstr "Le type d'IP a été créé." -#: machines/views.py:513 +#: machines/views.py:422 msgid "The IP type was edited." msgstr "Le type d'IP a été modifié." -#: machines/views.py:515 +#: machines/views.py:424 msgid "This IP type change would create duplicated domains" msgstr "" "Ce changement de type d'IP causerait des duplications de noms de domaine" -#: machines/views.py:537 +#: machines/views.py:446 msgid "The IP type was deleted." msgstr "Le type d'IP a été supprimé." -#: machines/views.py:543 +#: machines/views.py:452 #, python-format msgid "" "The IP type %s is assigned to at least one machine, you can't delete it." @@ -1536,33 +1542,33 @@ msgstr "" "Le type d'IP %s est assigné à au moins une machine, vous ne pouvez pas le " "supprimer." -#: machines/views.py:551 machines/views.py:617 machines/views.py:683 -#: machines/views.py:737 machines/views.py:789 machines/views.py:841 -#: machines/views.py:894 machines/views.py:948 machines/views.py:1000 -#: machines/views.py:1064 machines/views.py:1118 machines/views.py:1173 -#: machines/views.py:1236 machines/views.py:1288 +#: machines/views.py:460 machines/views.py:526 machines/views.py:592 +#: machines/views.py:646 machines/views.py:698 machines/views.py:750 +#: machines/views.py:803 machines/views.py:857 machines/views.py:909 +#: machines/views.py:973 machines/views.py:1027 machines/views.py:1082 +#: machines/views.py:1145 machines/views.py:1197 msgid "Delete" msgstr "Supprimer" -#: machines/views.py:564 +#: machines/views.py:473 msgid "The machine type was created." msgstr "Le type de machine a été créé." -#: machines/views.py:582 +#: machines/views.py:491 msgid "The machine type was edited." msgstr "Le type de machine a été modifié." -#: machines/views.py:584 +#: machines/views.py:493 msgid "This machine type change would create duplicated domains" msgstr "" "Ce changement de type de machine causerait des duplications de noms de " "domaines" -#: machines/views.py:603 +#: machines/views.py:512 msgid "The machine type was deleted." msgstr "Le type de machine a été supprimé." -#: machines/views.py:609 +#: machines/views.py:518 #, python-format msgid "" "The machine type %s is assigned to at least one machine, you can't delete it." @@ -1570,226 +1576,226 @@ msgstr "" "Le type de machine %s est assigné à au moins un machine, vous ne pouvez pas " "le supprimer." -#: machines/views.py:630 +#: machines/views.py:539 msgid "The extension was created." msgstr "L'extension a été créée." -#: machines/views.py:647 +#: machines/views.py:556 msgid "The extension was edited." msgstr "L'extension a été modifiée." -#: machines/views.py:666 +#: machines/views.py:575 msgid "The extension was deleted." msgstr "L'extension a été supprimée." -#: machines/views.py:672 +#: machines/views.py:581 #, python-format msgid "The extension %s is assigned to following %s : %s, you can't delete it." msgstr "" "L'extension %s est assignée aux %s suivants : %s , vous ne pouvez pas le " "supprimer." -#: machines/views.py:696 +#: machines/views.py:605 msgid "The SOA record was created." msgstr "L'enregistrement SOA a été créé." -#: machines/views.py:713 +#: machines/views.py:622 msgid "The SOA record was edited." msgstr "L'enregistrement SOA a été modifié." -#: machines/views.py:730 +#: machines/views.py:639 msgid "The SOA record was deleted." msgstr "L'enregistrement SOA a été supprimé." -#: machines/views.py:733 +#: machines/views.py:642 #, python-format msgid "Error: the SOA record %s can't be deleted." msgstr "Erreur : l'enregistrement SOA %s ne peut pas être supprimé." -#: machines/views.py:748 +#: machines/views.py:657 msgid "The MX record was created." msgstr "L'enregistrement MX a été créé." -#: machines/views.py:765 +#: machines/views.py:674 msgid "The MX record was edited." msgstr "L'enregistrement MX a été modifié." -#: machines/views.py:782 +#: machines/views.py:691 msgid "The MX record was deleted." msgstr "L'enregistrement MX a été supprimé." -#: machines/views.py:785 +#: machines/views.py:694 #, python-format msgid "Error: the MX record %s can't be deleted." msgstr "Erreur : l'enregistrement MX %s ne peut pas être supprimé." -#: machines/views.py:800 +#: machines/views.py:709 msgid "The NS record was created." msgstr "L'enregistrement NS a été créé." -#: machines/views.py:817 +#: machines/views.py:726 msgid "The NS record was edited." msgstr "L'enregistrement NS a été modifié." -#: machines/views.py:834 +#: machines/views.py:743 msgid "The NS record was deleted." msgstr "L'enregistrement NS a été supprimé." -#: machines/views.py:837 +#: machines/views.py:746 #, python-format msgid "Error: the NS record %s can't be deleted." msgstr "Erreur : l'enregistrement NS %s ne peut pas être supprimé." -#: machines/views.py:852 +#: machines/views.py:761 msgid "The DNAME record was created." msgstr "L'enregistrement DNAME a été créé." -#: machines/views.py:869 +#: machines/views.py:778 msgid "The DNAME record was edited." msgstr "L'enregistrement DNAME a été modifié." -#: machines/views.py:886 +#: machines/views.py:795 msgid "The DNAME record was deleted." msgstr "L'enregistrement DNAME a été supprimé." -#: machines/views.py:890 +#: machines/views.py:799 #, python-format msgid "Error: the DNAME record %s can't be deleted." msgstr "Erreur : l'enregistrement DNAME %s ne peut pas être supprimé." -#: machines/views.py:907 +#: machines/views.py:816 msgid "The TXT record was created." msgstr "L'enregistrement TXT a été créé." -#: machines/views.py:924 +#: machines/views.py:833 msgid "The TXT record was edited." msgstr "L'enregistrement TXT a été modifié." -#: machines/views.py:941 +#: machines/views.py:850 msgid "The TXT record was deleted." msgstr "L'enregistrement TXT a été supprimé." -#: machines/views.py:944 +#: machines/views.py:853 #, python-format msgid "Error: the TXT record %s can't be deleted." msgstr "Erreur : l'enregistrement %s ne peut pas être supprimé." -#: machines/views.py:959 +#: machines/views.py:868 msgid "The SRV record was created." msgstr "L'enregistrement SRV a été créé." -#: machines/views.py:976 +#: machines/views.py:885 msgid "The SRV record was edited." msgstr "L'enregistrement SRV a été modifié." -#: machines/views.py:993 +#: machines/views.py:902 msgid "The SRV record was deleted." msgstr "L'enregistrement SRV a été supprimé." -#: machines/views.py:996 +#: machines/views.py:905 #, python-format msgid "Error: the SRV record %s can't be deleted." msgstr "Erreur : l'enregistrement SRV %s ne peut pas être supprimé." -#: machines/views.py:1014 +#: machines/views.py:923 msgid "The alias was created." msgstr "L'alias a été créé." -#: machines/views.py:1033 +#: machines/views.py:942 msgid "The alias was edited." msgstr "L'alias a été modifié." -#: machines/views.py:1055 +#: machines/views.py:964 #, python-format msgid "The alias %s was deleted." msgstr "L'alias %s a été supprimé." -#: machines/views.py:1058 +#: machines/views.py:967 #, python-format msgid "Error: the alias %s can't be deleted." msgstr "Erreur : l'alias %s ne peut pas être supprimé." -#: machines/views.py:1077 +#: machines/views.py:986 msgid "The role was created." msgstr "Le rôle a été créé." -#: machines/views.py:1094 +#: machines/views.py:1003 msgid "The role was edited." msgstr "Le rôle a été modifié." -#: machines/views.py:1111 +#: machines/views.py:1020 msgid "The role was deleted." msgstr "Le rôle a été supprimé." -#: machines/views.py:1114 +#: machines/views.py:1023 #, python-format msgid "Error: the role %s can't be deleted." msgstr "Erreur : le rôle %s ne peut pas être supprimé." -#: machines/views.py:1129 +#: machines/views.py:1038 msgid "The service was created." msgstr "Le service a été créé." -#: machines/views.py:1146 +#: machines/views.py:1055 msgid "The service was edited." msgstr "Le service a été modifié." -#: machines/views.py:1165 +#: machines/views.py:1074 msgid "The service was deleted." msgstr "Le service a été supprimé." -#: machines/views.py:1169 +#: machines/views.py:1078 #, python-format msgid "Error: the service %s can't be deleted." msgstr "Erreur : le service %s ne peut pas être supprimé." -#: machines/views.py:1195 +#: machines/views.py:1104 msgid "The VLAN was created." msgstr "Le VLAN a été créé." -#: machines/views.py:1212 +#: machines/views.py:1121 msgid "The VLAN was edited." msgstr "Le VLAN a été modifié." -#: machines/views.py:1229 +#: machines/views.py:1138 msgid "The VLAN was deleted." msgstr "Le VLAN a été supprimé." -#: machines/views.py:1232 +#: machines/views.py:1141 #, python-format msgid "Error: the VLAN %s can't be deleted." msgstr "Erreur : le VLAN %s ne peut pas être supprimé." -#: machines/views.py:1247 +#: machines/views.py:1156 msgid "The NAS device was created." msgstr "Le dispositif NAS a été créé." -#: machines/views.py:1264 +#: machines/views.py:1173 msgid "The NAS device was edited." msgstr "Le dispositif NAS a été modifié." -#: machines/views.py:1281 +#: machines/views.py:1190 msgid "The NAS device was deleted." msgstr "Le dispositif NAS a été supprimé." -#: machines/views.py:1284 +#: machines/views.py:1193 #, python-format msgid "Error: the NAS device %s can't be deleted." msgstr "Erreur : le dispositif NAS %s ne peut pas être supprimé." -#: machines/views.py:1547 +#: machines/views.py:1456 msgid "The ports list was edited." msgstr "La liste de ports a été modifiée." -#: machines/views.py:1561 +#: machines/views.py:1470 msgid "The ports list was deleted." msgstr "La liste de ports a été supprimée." -#: machines/views.py:1586 +#: machines/views.py:1495 msgid "The ports list was created." msgstr "La liste de ports a été créée." -#: machines/views.py:1607 +#: machines/views.py:1516 msgid "" "Warning: the IP address is not public, the opening won't have any effect in " "v4." @@ -1797,6 +1803,9 @@ msgstr "" "Attention : l'adresse IP n'est pas publique, l'ouverture n'aura pas d'effet " "en v4." -#: machines/views.py:1618 +#: machines/views.py:1527 msgid "The ports configuration was edited." msgstr "La configuration de ports a été modifiée." + +#~ msgid "Select a machine type first." +#~ msgstr "Sélectionnez un type de machine d'abord." diff --git a/machines/migrations/0001_model_creation.py b/machines/migrations/0001_model_creation.py new file mode 100644 index 00000000..96c8dffc --- /dev/null +++ b/machines/migrations/0001_model_creation.py @@ -0,0 +1,1347 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import django.core.validators +import macaddress.fields +import re2o.mixins +import re2o.field_permissions +import datetime + + +class Migration(migrations.Migration): + initial = True + dependencies = [] + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + operations = [ + migrations.CreateModel( + name="Machine", + bases=( + re2o.mixins.RevMixin, + re2o.field_permissions.FieldPermissionModelMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "name", + models.CharField( + max_length=255, help_text="Optional.", blank=True, null=True + ), + ), + ("active", models.BooleanField(default=True)), + ], + options={ + "permissions": ( + ("view_machine", "Can view a machine object"), + ("change_machine_user", "Can change the user of a machine"), + ), + "verbose_name": "machine", + "verbose_name_plural": "machines", + }, + ), + migrations.CreateModel( + name="MachineType", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255)), + ], + options={ + "permissions": ( + ("view_machinetype", "Can view a machine type object"), + ("use_all_machinetype", "Can use all machine types"), + ), + "verbose_name": "machine type", + "verbose_name_plural": "machine types", + }, + ), + migrations.CreateModel( + name="IpType", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255)), + ("need_infra", models.BooleanField(default=False)), + ("domaine_ip_start", models.GenericIPAddressField(protocol="IPv4")), + ("domaine_ip_stop", models.GenericIPAddressField(protocol="IPv4")), + ( + "domaine_ip_network", + models.GenericIPAddressField( + protocol="IPv4", + null=True, + blank=True, + help_text="Network containing the domain's IPv4 range (optional).", + ), + ), + ( + "domaine_ip_netmask", + models.IntegerField( + default=24, + validators=[ + django.core.validators.MaxValueValidator(31), + django.core.validators.MinValueValidator(8), + ], + help_text="Netmask for the domain's IPv4 range.", + ), + ), + ( + "reverse_v4", + models.BooleanField( + default=False, help_text="Enable reverse DNS for IPv4." + ), + ), + ( + "prefix_v6", + models.GenericIPAddressField( + protocol="IPv6", null=True, blank=True + ), + ), + ( + "prefix_v6_length", + models.IntegerField( + default=64, + validators=[ + django.core.validators.MaxValueValidator(128), + django.core.validators.MinValueValidator(0), + ], + ), + ), + ( + "reverse_v6", + models.BooleanField( + default=False, help_text="Enable reverse DNS for IPv6." + ), + ), + ], + options={ + "permissions": ( + ("view_iptype", "Can view an IP type object"), + ("use_all_iptype", "Can use all IP types"), + ), + "verbose_name": "IP type", + "verbose_name_plural": "IP types", + }, + ), + migrations.CreateModel( + name="Vlan", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "vlan_id", + models.PositiveIntegerField( + validators=[django.core.validators.MaxValueValidator(4095)] + ), + ), + ("name", models.CharField(max_length=256)), + ("comment", models.CharField(max_length=256, blank=True)), + ("arp_protect", models.BooleanField(default=False)), + ("dhcp_snooping", models.BooleanField(default=False)), + ("dhcpv6_snooping", models.BooleanField(default=False)), + ( + "igmp", + models.BooleanField( + default=False, help_text="v4 multicast management." + ), + ), + ( + "mld", + models.BooleanField( + default=False, help_text="v6 multicast management." + ), + ), + ], + options={ + "permissions": (("view_vlan", "Can view a VLAN object"),), + "verbose_name": "VLAN", + "verbose_name_plural": "VLANs", + }, + ), + migrations.CreateModel( + name="Nas", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255, unique=True)), + ( + "port_access_mode", + models.CharField( + choices=(("802.1X", "802.1X"), ("Mac-address", "MAC-address")), + default="802.1X", + max_length=32, + ), + ), + ("autocapture_mac", models.BooleanField(default=False)), + ], + options={ + "permissions": (("view_nas", "Can view a NAS device object"),), + "verbose_name": "NAS device", + "verbose_name_plural": "NAS devices", + }, + ), + migrations.CreateModel( + name="SOA", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255)), + ( + "mail", + models.EmailField(help_text="Contact email address for the zone."), + ), + ( + "refresh", + models.PositiveIntegerField( + default=86400, + help_text="Seconds before the secondary DNS have to ask the primary DNS serial to detect a modification.", + ), + ), + ( + "retry", + models.PositiveIntegerField( + default=7200, + help_text="Seconds before the secondary DNS ask the serial again in case of a primary DNS timeout.", + ), + ), + ( + "expire", + models.PositiveIntegerField( + default=3600000, + help_text="Seconds before the secondary DNS stop answering requests in case of primary DNS timeout.", + ), + ), + ( + "ttl", + models.PositiveIntegerField( + default=172800, help_text="Time To Live." + ), + ), + ], + options={ + "permissions": (("view_soa", "Can view an SOA record object"),), + "verbose_name": "SOA record", + "verbose_name_plural": "SOA records", + }, + ), + migrations.CreateModel( + name="Extension", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "name", + models.CharField( + max_length=255, + unique=True, + help_text="Zone name, must begin with a dot (.example.org).", + ), + ), + ("need_infra", models.BooleanField(default=False)), + ( + "origin_v6", + models.GenericIPAddressField( + protocol="IPv6", + null=True, + blank=True, + help_text="AAAA record associated with the zone.", + ), + ), + ( + "dnssec", + models.BooleanField( + default=False, + help_text="Should the zone be signed with DNSSEC.", + ), + ), + ], + options={ + "permissions": ( + ("view_extension", "Can view an extension object"), + ("use_all_extension", "Can use all extensions"), + ), + "verbose_name": "DNS extension", + "verbose_name_plural": "DNS extensions", + }, + ), + migrations.CreateModel( + name="Mx", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("priority", models.PositiveIntegerField()), + ( + "ttl", + models.PositiveIntegerField( + verbose_name="Time To Live (TTL)", default=172800 + ), + ), + ], + options={ + "permissions": (("view_mx", "Can view an MX record object"),), + "verbose_name": "MX record", + "verbose_name_plural": "MX records", + }, + ), + migrations.CreateModel( + name="Ns", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "ttl", + models.PositiveIntegerField( + verbose_name="Time To Live (TTL)", default=172800 + ), + ), + ], + options={ + "permissions": (("view_ns", "Can view an NS record object"),), + "verbose_name": "NS record", + "verbose_name_plural": "NS records", + }, + ), + migrations.CreateModel( + name="Txt", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("field1", models.CharField(max_length=255)), + ("field2", models.TextField(max_length=2047)), + ( + "ttl", + models.PositiveIntegerField( + verbose_name="Time To Live (TTL)", default=172800 + ), + ), + ], + options={ + "permissions": (("view_txt", "Can view a TXT record object"),), + "verbose_name": "TXT record", + "verbose_name_plural": "TXT records", + }, + ), + migrations.CreateModel( + name="DName", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("alias", models.CharField(max_length=255)), + ( + "ttl", + models.PositiveIntegerField( + verbose_name="Time To Live (TTL)", default=172800 + ), + ), + ], + options={ + "permissions": (("view_dname", "Can view a DNAME record object"),), + "verbose_name": "DNAME record", + "verbose_name_plural": "DNAME records", + }, + ), + migrations.CreateModel( + name="Srv", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("service", models.CharField(max_length=31)), + ( + "protocole", + models.CharField( + max_length=3, + choices=(("TCP", "TCP"), ("UDP", "UDP")), + default="TCP", + ), + ), + ( + "ttl", + models.PositiveIntegerField( + default=172800, help_text="Time To Live." + ), + ), + ( + "priority", + models.PositiveIntegerField( + default=0, + validators=[django.core.validators.MaxValueValidator(65535)], + help_text="Priority of the target server (positive integer value, the lower it is, the more the server will be used if available).", + ), + ), + ( + "weight", + models.PositiveIntegerField( + default=0, + validators=[django.core.validators.MaxValueValidator(65535)], + help_text="Relative weight for records with the same priority (integer value between 0 and 65535).", + ), + ), + ( + "port", + models.PositiveIntegerField( + validators=[django.core.validators.MaxValueValidator(65535)], + help_text="TCP/UDP port.", + ), + ), + ], + options={ + "permissions": (("view_srv", "Can view an SRV record object"),), + "verbose_name": "SRV record", + "verbose_name_plural": "SRV records", + }, + ), + migrations.CreateModel( + name="SshFp", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "pub_key_entry", + models.TextField(help_text="SSH public key.", max_length=2048), + ), + ( + "algo", + models.CharField( + choices=( + ("ssh-rsa", "ssh-rsa"), + ("ssh-ed25519", "ssh-ed25519"), + ("ecdsa-sha2-nistp256", "ecdsa-sha2-nistp256"), + ("ecdsa-sha2-nistp384", "ecdsa-sha2-nistp384"), + ("ecdsa-sha2-nistp521", "ecdsa-sha2-nistp521"), + ), + max_length=32, + ), + ), + ( + "comment", + models.CharField( + help_text="Comment.", max_length=255, null=True, blank=True + ), + ), + ], + options={ + "permissions": (("view_sshfp", "Can view an SSHFP record object"),), + "verbose_name": "SSHFP record", + "verbose_name_plural": "SSHFP records", + }, + ), + migrations.CreateModel( + name="Interface", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + re2o.field_permissions.FieldPermissionModelMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("mac_address", macaddress.fields.MACAddressField(integer=False)), + ("details", models.CharField(max_length=255, blank=True)), + ], + options={ + "permissions": ( + ("view_interface", "Can view an interface object"), + ( + "change_interface_machine", + "Can change the owner of an interface", + ), + ), + "verbose_name": "interface", + "verbose_name_plural": "interfaces", + }, + ), + migrations.CreateModel( + name="Ipv6List", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + re2o.field_permissions.FieldPermissionModelMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("ipv6", models.GenericIPAddressField(protocol="IPv6")), + ("slaac_ip", models.BooleanField(default=False)), + ( + "active", + models.BooleanField( + default=True, + help_text="If false,the DNS will not provide this ip.", + ), + ), + ], + options={ + "permissions": ( + ("view_ipv6list", "Can view an IPv6 addresses list object"), + ( + "change_ipv6list_slaac_ip", + "Can change the SLAAC value of an IPv6 addresses list", + ), + ), + "verbose_name": "IPv6 addresses list", + "verbose_name_plural": "IPv6 addresses lists", + }, + ), + migrations.CreateModel( + name="Domain", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + re2o.field_permissions.FieldPermissionModelMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "name", + models.CharField( + help_text="Mandatory and unique, must not contain dots.", + max_length=255, + ), + ), + ( + "cname", + models.ForeignKey( + "self", null=True, blank=True, related_name="related_domain" + ), + ), + ( + "ttl", + models.PositiveIntegerField( + verbose_name="Time To Live (TTL)", default=0 + ), + ), + ], + options={ + "permissions": ( + ("view_domain", "Can view a domain object"), + ("change_ttl", "Can change the TTL of a domain object"), + ), + "verbose_name": "domain", + "verbose_name_plural": "domains", + }, + ), + migrations.CreateModel( + name="IpList", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("ipv4", models.GenericIPAddressField(protocol="IPv4", unique=True)), + ], + options={ + "permissions": ( + ("view_iplist", "Can view an IPv4 addresses list object"), + ), + "verbose_name": "IPv4 addresses list", + "verbose_name_plural": "IPv4 addresses lists", + }, + ), + migrations.CreateModel( + name="Role", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("role_type", models.CharField(max_length=255, unique=True)), + ( + "specific_role", + models.CharField( + choices=( + ("dhcp-server", "DHCP server"), + ("switch-conf-server", "Switches configuration server"), + ("dns-recursive-server", "Recursive DNS server"), + ("ntp-server", "NTP server"), + ("radius-server", "RADIUS server"), + ("log-server", "Log server"), + ("ldap-master-server", "LDAP master server"), + ("ldap-backup-server", "LDAP backup server"), + ("smtp-server", "SMTP server"), + ("postgresql-server", "postgreSQL server"), + ("mysql-server", "mySQL server"), + ("sql-client", "SQL client"), + ("gateway", "Gateway"), + ), + null=True, + blank=True, + max_length=32, + ), + ), + ], + options={ + "permissions": (("view_role", "Can view a role object"),), + "verbose_name": "server role", + "verbose_name_plural": "server roles", + }, + ), + migrations.CreateModel( + name="Service", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "service_type", + models.CharField(max_length=255, blank=True, unique=True), + ), + ( + "min_time_regen", + models.DurationField( + default=datetime.timedelta(minutes=1), + help_text="Minimal time before regeneration of the service.", + ), + ), + ( + "regular_time_regen", + models.DurationField( + default=datetime.timedelta(hours=1), + help_text="Maximal time before regeneration of the service.", + ), + ), + ], + options={ + "permissions": (("view_service", "Can view a service object"),), + "verbose_name": "service to generate (DHCP, DNS, ...)", + "verbose_name_plural": "services to generate (DHCP, DNS, ...)", + }, + ), + migrations.CreateModel( + name="Service_link", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("last_regen", models.DateTimeField(auto_now_add=True)), + ("asked_regen", models.BooleanField(default=False)), + ], + options={ + "permissions": ( + ("view_service_link", "Can view a service server link object"), + ), + "verbose_name": "link between service and server", + "verbose_name_plural": "links between service and server", + }, + ), + migrations.CreateModel( + name="OuverturePortList", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "name", + models.CharField( + help_text="Name of the ports configuration", max_length=255 + ), + ), + ], + options={ + "permissions": ( + ( + "view_ouvertureportlist", + "Can view a ports opening list" " object", + ), + ), + "verbose_name": "ports opening list", + "verbose_name_plural": "ports opening lists", + }, + ), + migrations.CreateModel( + name="OuverturePort", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "begin", + models.PositiveIntegerField( + validators=[django.core.validators.MaxValueValidator(65535)] + ), + ), + ( + "end", + models.PositiveIntegerField( + validators=[django.core.validators.MaxValueValidator(65535)] + ), + ), + ( + "protocole", + models.CharField( + max_length=1, choices=(("T", "TCP"), ("U", "UDP")), default="T" + ), + ), + ( + "io", + models.CharField( + max_length=1, choices=(("I", "IN"), ("O", "OUT")), default="O" + ), + ), + ], + options={ + "verbose_name": "ports opening", + "verbose_name_plural": "ports openings", + }, + ), + ] diff --git a/machines/migrations/0002_foreign_keys.py b/machines/migrations/0002_foreign_keys.py new file mode 100644 index 00000000..3ace9b2e --- /dev/null +++ b/machines/migrations/0002_foreign_keys.py @@ -0,0 +1,618 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-12-30 15:27 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('machines', '0001_model_creation'), + ] + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + + operations = [ + migrations.AddField( + model_name='dname', + name='zone', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Extension'), + preserve_default=False, + ), + migrations.AddField( + model_name='domain', + name='extension', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Extension'), + preserve_default=False, + ), + migrations.AddField( + model_name='domain', + name='interface_parent', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='machines.Interface'), + ), + migrations.AddField( + model_name='extension', + name='origin', + field=models.ForeignKey(blank=True, help_text='A record associated with the zone.', null=True, on_delete=django.db.models.deletion.PROTECT, to='machines.IpList'), + ), + migrations.AddField( + model_name='extension', + name='soa', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='machines.SOA'), + preserve_default=False, + ), + migrations.AddField( + model_name='interface', + name='ipv4', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='machines.IpList'), + ), + migrations.AddField( + model_name='interface', + name='machine', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='machines.Machine'), + preserve_default=False, + ), + migrations.AddField( + model_name='interface', + name='machine_type', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.MachineType'), + preserve_default=False, + ), + migrations.AddField( + model_name='interface', + name='port_lists', + field=models.ManyToManyField(blank=True, to='machines.OuverturePortList'), + ), + migrations.AddField( + model_name='iplist', + name='ip_type', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='machines.IpType'), + preserve_default=False, + ), + migrations.AddField( + model_name='iptype', + name='extension', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Extension'), + preserve_default=False, + ), + migrations.AddField( + model_name='iptype', + name='ouverture_ports', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='machines.OuverturePortList'), + ), + migrations.AddField( + model_name='iptype', + name='vlan', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='machines.Vlan'), + ), + migrations.AddField( + model_name='ipv6list', + name='interface', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='ipv6list', to='machines.Interface'), + preserve_default=False, + ), + migrations.AddField( + model_name='machine', + name='user', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + migrations.AddField( + model_name='machinetype', + name='ip_type', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='machines.IpType'), + ), + migrations.AddField( + model_name='mx', + name='name', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Domain'), + preserve_default=False, + ), + migrations.AddField( + model_name='mx', + name='zone', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Extension'), + preserve_default=False, + ), + migrations.AddField( + model_name='nas', + name='machine_type', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, related_name='machinetype_on_nas', to='machines.MachineType'), + preserve_default=False, + ), + migrations.AddField( + model_name='nas', + name='nas_type', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, related_name='nas_type', to='machines.MachineType'), + preserve_default=False, + ), + migrations.AddField( + model_name='ns', + name='ns', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Domain'), + preserve_default=False, + ), + migrations.AddField( + model_name='ns', + name='zone', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Extension'), + preserve_default=False, + ), + migrations.AddField( + model_name='ouvertureport', + name='port_list', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='machines.OuverturePortList'), + preserve_default=False, + ), + migrations.AddField( + model_name='role', + name='servers', + field=models.ManyToManyField(to='machines.Interface'), + ), + migrations.AddField( + model_name='service', + name='servers', + field=models.ManyToManyField(through='machines.Service_link', to='machines.Interface'), + ), + migrations.AddField( + model_name='service_link', + name='server', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='machines.Interface'), + preserve_default=False, + ), + migrations.AddField( + model_name='service_link', + name='service', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='machines.Service'), + preserve_default=False, + ), + migrations.AddField( + model_name='srv', + name='extension', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Extension'), + preserve_default=False, + ), + migrations.AddField( + model_name='srv', + name='target', + field=models.ForeignKey(default=None, help_text='Target server.', on_delete=django.db.models.deletion.PROTECT, to='machines.Domain'), + preserve_default=False, + ), + migrations.AddField( + model_name='sshfp', + name='machine', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='machines.Machine'), + preserve_default=False, + ), + migrations.AddField( + model_name='txt', + name='zone', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='machines.Extension'), + preserve_default=False, + ), + migrations.AlterUniqueTogether( + name='domain', + unique_together=set([('name', 'extension')]), + ), + ] diff --git a/machines/migrations/0063_auto_20171020_0040.py b/machines/migrations/0063_auto_20171020_0040.py index 8b9b7d24..54d35980 100644 --- a/machines/migrations/0063_auto_20171020_0040.py +++ b/machines/migrations/0063_auto_20171020_0040.py @@ -11,7 +11,6 @@ class Migration(migrations.Migration): dependencies = [ ("machines", "0062_extension_origin_v6"), - ("reversion", "0001_squashed_0004_auto_20160611_1202"), ] operations = [ diff --git a/machines/models.py b/machines/models.py index 9fd524be..5884d975 100644 --- a/machines/models.py +++ b/machines/models.py @@ -1277,9 +1277,10 @@ class SshFp(RevMixin, AclMixin, models.Model): See RFC: 1 is sha1 , 2 is sha256. """ + pubkey = self.base64_pubkey() return { - "1": hashlib.sha1(base64.b64decode(self.pub_key_entry)).hexdigest(), - "2": hashlib.sha256(base64.b64decode(self.pub_key_entry)).hexdigest(), + "1": hashlib.sha1(pubkey).hexdigest(), + "2": hashlib.sha256(pubkey).hexdigest(), } class Meta: @@ -1296,6 +1297,31 @@ class SshFp(RevMixin, AclMixin, models.Model): def can_delete(self, user_request, *args, **kwargs): return self.machine.can_delete(user_request, *args, **kwargs) + def base64_pubkey(self): + """Function to decode in base64 the pub key entry + + Returns: + Base64 decoded value of pub_key_entry + + Because of b64 MUST be divided by 4, we add a "padding" = carracter 3 times. + This padding is then ignored if the pubkey is greater than a multiple of 4. + More informations on : https://gist.github.com/perrygeo/ee7c65bb1541ff6ac770 + As said in the thread, this fix is not optimal, however it is very simple as + no options on b64decode function exists.""" + return base64.b64decode(self.pub_key_entry + "===") + + def clean(self, *args, **kwargs): + """Check if the pub_key_entry is a valid base64 entry. + + Raises: + ValidationError: the pub key entry is not a valid base64 enty. + """ + try: + self.base64_pubkey() + except ValueError: + raise ValidationError(_("Ssh pub key entry is incorrect base64 entry")) + super(SshFp, self).clean(*args, **kwargs) + def __str__(self): return str(self.algo) + " " + str(self.comment) diff --git a/multi_op/migrations/0001_squashed_0003_auto_20200904_1938.py b/multi_op/migrations/0001_squashed_0003_auto_20200904_1938.py new file mode 100644 index 00000000..2937f0c4 --- /dev/null +++ b/multi_op/migrations/0001_squashed_0003_auto_20200904_1938.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-12-30 17:32 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + replaces = [('multi_op', '0001_initial'), ('multi_op', '0002_auto_20200904_1905'), ('multi_op', '0003_auto_20200904_1938')] + + initial = True + + dependencies = [ + ('topologie', '0002_foreign_keys'), + ] + + operations = [ + migrations.CreateModel( + name='MultiopOption', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('enabled_dorm', models.ManyToManyField(blank=True, related_name='enabled_dorm_multiop', to='topologie.Dormitory', verbose_name='enabled dorm')), + ], + options={ + 'verbose_name': 'dormitories preferences', + }, + ), + ] diff --git a/preferences/migrations/0001_model_creation.py b/preferences/migrations/0001_model_creation.py new file mode 100644 index 00000000..ff399741 --- /dev/null +++ b/preferences/migrations/0001_model_creation.py @@ -0,0 +1,1218 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import re2o.mixins +import re2o.aes_field + + +class Migration(migrations.Migration): + dependencies = [] + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + operations = [ + migrations.CreateModel( + name="OptionalUser", + bases=(re2o.mixins.AclMixin, models.Model), + options={ + "permissions": ( + ("view_optionaluser", "Can view the user preferences"), + ), + "verbose_name": "user preferences", + }, + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("is_tel_mandatory", models.BooleanField(default=True)), + ("gpg_fingerprint", models.BooleanField(default=True)), + ( + "all_can_create_club", + models.BooleanField( + default=False, help_text="Users can create a club." + ), + ), + ( + "all_can_create_adherent", + models.BooleanField( + default=False, help_text="Users can create a member." + ), + ), + ( + "self_change_shell", + models.BooleanField( + default=False, help_text="Users can edit their shell." + ), + ), + ( + "self_change_pseudo", + models.BooleanField( + default=True, help_text="Users can edit their pseudo." + ), + ), + ( + "self_room_policy", + models.CharField( + choices=[ + ("DISABLED", "Users can't select their room"), + ( + "ONLY_INACTIVE", + "Users can only select a room occupied by a user with a disabled connection.", + ), + ("ALL_ROOM", "Users can select all rooms"), + ], + default="DISABLED", + help_text="Policy on self users room edition", + max_length=32, + ), + ), + ( + "local_email_accounts_enabled", + models.BooleanField( + default=False, + help_text="Enable local email accounts for users.", + ), + ), + ( + "local_email_domain", + models.CharField( + default="@example.org", + help_text="Domain to use for local email accounts.", + max_length=32, + ), + ), + ( + "max_email_address", + models.IntegerField( + default=15, + help_text="Maximum number of local email addresses for a standard user.", + ), + ), + ( + "delete_notyetactive", + models.IntegerField( + default=15, + help_text="Not yet active users will be deleted after this number of days.", + ), + ), + ( + "disable_emailnotyetconfirmed", + models.IntegerField( + default=2, + help_text="Users with an email address not yet confirmed will be disabled after this number of days.", + ), + ), + ( + "self_adhesion", + models.BooleanField( + default=False, + help_text="A new user can create their account on Re2o.", + ), + ), + ( + "all_users_active", + models.BooleanField( + default=False, + help_text="If True, all new created and connected users are active. If False, only when a valid registration has been paid.", + ), + ), + ( + "allow_set_password_during_user_creation", + models.BooleanField( + default=False, + help_text="If True, users have the choice to receive an email containing a link to reset their password during creation, or to directly set their password in the page. If False, an email is always sent.", + ), + ), + ( + "allow_archived_connexion", + models.BooleanField( + default=False, + help_text="If True, archived users are allowed to connect.", + ), + ), + ], + ), + migrations.CreateModel( + name="OptionalMachine", + bases=(re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("password_machine", models.BooleanField(default=False)), + ("max_lambdauser_interfaces", models.IntegerField(default=10)), + ( + "ipv6_mode", + models.CharField( + choices=[ + ("SLAAC", "Automatic configuration by RA"), + ("DHCPV6", "IP addresses assignment by DHCPv6"), + ("DISABLED", "Disabled"), + ], + default="DISABLED", + max_length=32, + ), + ), + ("create_machine", models.BooleanField(default=True)), + ( + "default_dns_ttl", + models.PositiveIntegerField( + default=172800, + verbose_name="default Time To Live (TTL) for CNAME, A and AAAA records", + ), + ), + ("max_lambdauser_aliases", models.IntegerField(default=10)), + ], + options={ + "permissions": ( + ("view_optionalmachine", "Can view the machine preferences"), + ), + "verbose_name": "machine preferences", + }, + ), + migrations.CreateModel( + name="OptionalTopologie", + bases=(re2o.mixins.AclMixin, models.Model), + options={ + "permissions": ( + ("view_optionaltopologie", "Can view the topology preferences"), + ), + "verbose_name": "topology preferences", + }, + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "switchs_web_management", + models.BooleanField( + default=False, + help_text="Web management, activated in case of automatic provision.", + ), + ), + ( + "switchs_web_management_ssl", + models.BooleanField( + default=False, + help_text="SSL web management, make sure that a certificate is installed on the switch.", + ), + ), + ( + "switchs_rest_management", + models.BooleanField( + default=False, + help_text="REST management, activated in case of automatic provision.", + ), + ), + ( + "switchs_provision", + models.CharField( + choices=[("sftp", "SFTP"), ("tftp", "TFTP")], + default="tftp", + help_text="Provision of configuration mode for switches.", + max_length=32, + ), + ), + ( + "sftp_login", + models.CharField( + blank=True, + help_text="SFTP login for switches.", + max_length=32, + null=True, + ), + ), + ( + "sftp_pass", + re2o.aes_field.AESEncryptedField( + blank=True, help_text="SFTP password.", max_length=63, null=True + ), + ), + ], + ), + migrations.CreateModel( + name="RadiusKey", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "radius_key", + re2o.aes_field.AESEncryptedField( + help_text="RADIUS key.", max_length=255 + ), + ), + ( + "comment", + models.CharField( + blank=True, + help_text="Comment for this key.", + max_length=255, + null=True, + ), + ), + ( + "default_switch", + models.BooleanField( + default=False, + help_text="Default key for switches.", + ), + ), + ], + options={ + "permissions": (("view_radiuskey", "Can view a RADIUS key object"),), + "verbose_name": "RADIUS key", + "verbose_name_plural": "RADIUS keys", + }, + bases=(re2o.mixins.AclMixin, models.Model), + ), + migrations.CreateModel( + name="SwitchManagementCred", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "management_id", + models.CharField(help_text="Switch login.", max_length=63), + ), + ( + "management_pass", + re2o.aes_field.AESEncryptedField( + help_text="Password.", max_length=63 + ), + ), + ( + "default_switch", + models.BooleanField( + default=True, + help_text="Default credentials for switches.", + unique=True, + ), + ), + ], + options={ + "permissions": ( + ( + "view_switchmanagementcred", + "Can view a switch management credentials object", + ), + ), + "verbose_name": "switch management credentials", + }, + bases=(re2o.mixins.AclMixin, models.Model), + ), + migrations.CreateModel( + name="Reminder", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "days", + models.IntegerField( + default=7, + help_text="Delay between the email and the membership's end.", + unique=True, + ), + ), + ( + "message", + models.TextField( + blank=True, + default="", + help_text="Message displayed specifically for this reminder.", + null=True, + ), + ), + ], + options={ + "permissions": (("view_reminder", "Can view a reminder object"),), + "verbose_name": "reminder", + "verbose_name_plural": "reminders", + }, + bases=(re2o.mixins.AclMixin, models.Model), + ), + migrations.CreateModel( + name="GeneralOption", + bases=(re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "general_message_fr", + models.TextField( + blank=True, + default="", + help_text="General message displayed on the French version of the website (e.g. in case of maintenance).", + ), + ), + ( + "general_message_en", + models.TextField( + blank=True, + default="", + help_text="General message displayed on the English version of the website (e.g. in case of maintenance).", + ), + ), + ("search_display_page", models.IntegerField(default=15)), + ("pagination_number", models.IntegerField(default=25)), + ("pagination_large_number", models.IntegerField(default=8)), + ("req_expire_hrs", models.IntegerField(default=48)), + ("site_name", models.CharField(default="Re2o", max_length=32)), + ( + "email_from", + models.EmailField(default="www-data@example.com", max_length=254), + ), + ( + "main_site_url", + models.URLField(default="http://re2o.example.org", max_length=255), + ), + ("GTU_sum_up", models.TextField(blank=True, default="")), + ( + "GTU", + models.FileField(blank=True, default="", null=True, upload_to=""), + ), + ], + options={ + "permissions": ( + ("view_generaloption", "Can view the general preferences"), + ), + "verbose_name": "general preferences", + }, + ), + migrations.CreateModel( + name="Service", + options={ + "permissions": (("view_service", "Can view the service preferences"),), + "verbose_name": "service", + "verbose_name_plural": "services", + }, + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=32)), + ("url", models.URLField()), + ("description", models.TextField()), + ("image", models.ImageField(blank=True, upload_to="logo")), + ], + ), + migrations.CreateModel( + name="MailContact", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "address", + models.EmailField( + default="contact@example.org", + help_text="Contact email address.", + max_length=254, + ), + ), + ( + "commentary", + models.CharField( + blank=True, + help_text="Description of the associated email address.", + max_length=256, + null=True, + ), + ), + ], + options={ + "permissions": ( + ("view_mailcontact", "Can view a contact email address object"), + ), + "verbose_name": "contact email address", + "verbose_name_plural": "contact email addresses", + }, + bases=(re2o.mixins.AclMixin, models.Model), + ), + migrations.CreateModel( + name="Mandate", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("start_date", models.DateTimeField(verbose_name="start date")), + ( + "end_date", + models.DateTimeField( + blank=True, null=True, verbose_name="end date" + ), + ), + ], + options={ + "verbose_name": "mandate", + "verbose_name_plural": "mandates", + "permissions": (("view_mandate", "Can view a mandate object"),), + }, + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + ), + migrations.CreateModel( + name="AssoOption", + bases=(re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "name", + models.CharField( + default="Networking organisation school Something", + max_length=256, + ), + ), + ("siret", models.CharField(default="00000000000000", max_length=32)), + ( + "adresse1", + models.CharField(default="Threadneedle Street", max_length=128), + ), + ( + "adresse2", + models.CharField(default="London EC2R 8AH", max_length=128), + ), + ("contact", models.EmailField(default="contact@example.org")), + ("telephone", models.CharField(max_length=15, default="0000000000")), + ("pseudo", models.CharField(default="Organisation", max_length=32)), + ("description", models.TextField(null=True, blank=True)), + ], + options={ + "permissions": ( + ("view_assooption", "Can view the organisation preferences"), + ), + "verbose_name": "organisation preferences", + }, + ), + migrations.CreateModel( + name="HomeOption", + bases=(re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("facebook_url", models.URLField(null=True, blank=True)), + ("twitter_url", models.URLField(null=True, blank=True)), + ( + "twitter_account_name", + models.CharField(max_length=32, null=True, blank=True), + ), + ], + options={ + "permissions": ( + ("view_homeoption", "Can view the homepage preferences"), + ), + "verbose_name": "homepage preferences", + }, + ), + migrations.CreateModel( + name="MailMessageOption", + bases=(re2o.mixins.AclMixin, models.Model), + options={ + "permissions": ( + ( + "view_mailmessageoption", + "Can view the email message preferences", + ), + ), + "verbose_name": "email message preferences", + }, + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "welcome_mail_fr", + models.TextField( + default="", blank=True, help_text="Welcome email in French." + ), + ), + ( + "welcome_mail_en", + models.TextField( + default="", blank=True, help_text="Welcome email in English." + ), + ), + ], + ), + migrations.CreateModel( + name="RadiusAttribute", + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "attribute", + models.CharField( + max_length=255, + verbose_name="attribute", + help_text="See https://freeradius.org/rfc/attributes.html.", + ), + ), + ("value", models.CharField(max_length=255, verbose_name="value")), + ( + "comment", + models.TextField( + verbose_name="comment", + help_text="Use this field to document this attribute.", + blank=True, + default="", + ), + ), + ], + options={ + "verbose_name": "RADIUS attribute", + "verbose_name_plural": "RADIUS attributes", + }, + ), + migrations.CreateModel( + name="RadiusOption", + bases=(re2o.mixins.AclMixin, models.Model), + options={ + "verbose_name": "RADIUS policy", + "verbose_name_plural": "RADIUS policies", + }, + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "radius_general_policy", + models.CharField( + choices=[ + ("MACHINE", "On the IP range's VLAN of the machine"), + ( + "DEFINED", + 'Preset in "VLAN for machines accepted by RADIUS"', + ), + ], + default="DEFINED", + max_length=32, + ), + ), + ( + "unknown_machine", + models.CharField( + choices=[ + ("REJECT", "Reject the machine"), + ("SET_VLAN", "Place the machine on the VLAN"), + ], + default="REJECT", + max_length=32, + verbose_name="policy for unknown machines", + ), + ), + ( + "unknown_port", + models.CharField( + choices=[ + ("REJECT", "Reject the machine"), + ("SET_VLAN", "Place the machine on the VLAN"), + ], + default="REJECT", + max_length=32, + verbose_name="policy for unknown ports", + ), + ), + ( + "unknown_room", + models.CharField( + choices=[ + ("REJECT", "Reject the machine"), + ("SET_VLAN", "Place the machine on the VLAN"), + ], + default="REJECT", + max_length=32, + verbose_name="Policy for machines connecting from unregistered rooms (relevant on ports with STRICT RADIUS mode)", + ), + ), + ( + "non_member", + models.CharField( + choices=[ + ("REJECT", "Reject the machine"), + ("SET_VLAN", "Place the machine on the VLAN"), + ], + default="REJECT", + max_length=32, + verbose_name="policy for non members", + ), + ), + ( + "banned", + models.CharField( + choices=[ + ("REJECT", "Reject the machine"), + ("SET_VLAN", "Place the machine on the VLAN"), + ], + default="REJECT", + max_length=32, + verbose_name="policy for banned users", + ), + ), + ], + ), + migrations.CreateModel( + name="CotisationsOption", + bases=(re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "send_voucher_mail", + models.BooleanField( + verbose_name="send voucher by email when the invoice is controlled", + help_text="Be careful, if no mandate is defined on the preferences page, errors will be triggered when generating vouchers.", + default=False, + ), + ), + ], + options={"verbose_name": "subscription preferences"}, + ), + migrations.CreateModel( + name="DocumentTemplate", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ( + "template", + models.FileField(upload_to="templates/", verbose_name="template"), + ), + ( + "name", + models.CharField(max_length=125, unique=True, verbose_name="name"), + ), + ], + options={ + "verbose_name": "document template", + "verbose_name_plural": "document templates", + }, + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + ), + ] diff --git a/preferences/migrations/0002_foreign_keys.py b/preferences/migrations/0002_foreign_keys.py new file mode 100644 index 00000000..e1890776 --- /dev/null +++ b/preferences/migrations/0002_foreign_keys.py @@ -0,0 +1,532 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-12-30 15:27 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import preferences.models +import re2o.aes_field + + +class Migration(migrations.Migration): + + dependencies = [ + ('machines', '0001_model_creation'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('users', '0001_model_creation'), + ('preferences', '0001_model_creation'), + ('reversion', '0001_squashed_0004_auto_20160611_1202'), + ] + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + + operations = [ + migrations.AddField( + model_name='assooption', + name='utilisateur_asso', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AddField( + model_name='cotisationsoption', + name='invoice_template', + field=models.OneToOneField(default=preferences.models.default_invoice, on_delete=django.db.models.deletion.PROTECT, related_name='invoice_template', to='preferences.DocumentTemplate', verbose_name='template for invoices'), + ), + migrations.AddField( + model_name='cotisationsoption', + name='voucher_template', + field=models.OneToOneField(default=preferences.models.default_voucher, on_delete=django.db.models.deletion.PROTECT, related_name='voucher_template', to='preferences.DocumentTemplate', verbose_name='template for subscription vouchers'), + ), + migrations.AddField( + model_name='mandate', + name='president', + field=models.ForeignKey(blank=True, help_text='Displayed on subscription vouchers.', null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='president of the association'), + ), + migrations.AddField( + model_name='optionaltopologie', + name='switchs_ip_type', + field=models.OneToOneField(blank=True, help_text='IP range for the management of switches.', null=True, on_delete=django.db.models.deletion.PROTECT, to='machines.IpType'), + ), + migrations.AddField( + model_name='optionaluser', + name='shell_default', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.ListShell'), + ), + migrations.AddField( + model_name='radiusoption', + name='banned_attributes', + field=models.ManyToManyField(blank=True, help_text='Answer attributes for banned users.', related_name='banned_attribute', to='preferences.RadiusAttribute', verbose_name='banned users attributes'), + ), + migrations.AddField( + model_name='radiusoption', + name='banned_vlan', + field=models.ForeignKey(blank=True, help_text='VLAN for banned users if not rejected.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='banned_vlan', to='machines.Vlan', verbose_name='banned users VLAN'), + ), + migrations.AddField( + model_name='radiusoption', + name='non_member_attributes', + field=models.ManyToManyField(blank=True, help_text='Answer attributes for non members.', related_name='non_member_attribute', to='preferences.RadiusAttribute', verbose_name='non members attributes'), + ), + migrations.AddField( + model_name='radiusoption', + name='non_member_vlan', + field=models.ForeignKey(blank=True, help_text='VLAN for non members if not rejected.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='non_member_vlan', to='machines.Vlan', verbose_name='non members VLAN'), + ), + migrations.AddField( + model_name='radiusoption', + name='ok_attributes', + field=models.ManyToManyField(blank=True, help_text='Answer attributes for accepted users.', related_name='ok_attribute', to='preferences.RadiusAttribute', verbose_name='accepted users attributes'), + ), + migrations.AddField( + model_name='radiusoption', + name='unknown_machine_attributes', + field=models.ManyToManyField(blank=True, help_text='Answer attributes for unknown machines.', related_name='unknown_machine_attribute', to='preferences.RadiusAttribute', verbose_name='unknown machines attributes'), + ), + migrations.AddField( + model_name='radiusoption', + name='unknown_machine_vlan', + field=models.ForeignKey(blank=True, help_text='VLAN for unknown machines if not rejected.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='unknown_machine_vlan', to='machines.Vlan', verbose_name='unknown machines VLAN'), + ), + migrations.AddField( + model_name='radiusoption', + name='unknown_port_attributes', + field=models.ManyToManyField(blank=True, help_text='Answer attributes for unknown ports.', related_name='unknown_port_attribute', to='preferences.RadiusAttribute', verbose_name='unknown ports attributes'), + ), + migrations.AddField( + model_name='radiusoption', + name='unknown_port_vlan', + field=models.ForeignKey(blank=True, help_text='VLAN for unknown ports if not rejected.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='unknown_port_vlan', to='machines.Vlan', verbose_name='unknown ports VLAN'), + ), + migrations.AddField( + model_name='radiusoption', + name='unknown_room_attributes', + field=models.ManyToManyField(blank=True, help_text='Answer attributes for unknown rooms.', related_name='unknown_room_attribute', to='preferences.RadiusAttribute', verbose_name='unknown rooms attributes'), + ), + migrations.AddField( + model_name='radiusoption', + name='unknown_room_vlan', + field=models.ForeignKey(blank=True, help_text='VLAN for unknown rooms if not rejected.', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='unknown_room_vlan', to='machines.Vlan', verbose_name='unknown rooms VLAN'), + ), + migrations.AddField( + model_name='radiusoption', + name='vlan_decision_ok', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='vlan_ok_option', to='machines.Vlan'), + ), + ] diff --git a/re2o/context_processors.py b/re2o/context_processors.py index c32c263f..07ee1c68 100644 --- a/re2o/context_processors.py +++ b/re2o/context_processors.py @@ -79,12 +79,12 @@ def context_optionnal_apps(request): optionnal_templates_navbar_user_list = [ app.views.navbar_user() for app in optionnal_apps - if hasattr(app.views, "navbar_user") + if hasattr(app, "views") and hasattr(app.views, "navbar_user") ] optionnal_templates_navbar_logout_list = [ app.views.navbar_logout() for app in optionnal_apps - if hasattr(app.views, "navbar_logout") + if hasattr(app, "views") and hasattr(app.views, "navbar_logout") ] return { "optionnal_templates_navbar_user_list": optionnal_templates_navbar_user_list, diff --git a/static/css/base.css b/static/css/base.css index 25faf52b..80285178 100644 --- a/static/css/base.css +++ b/static/css/base.css @@ -148,6 +148,7 @@ a > i.fa { .table-responsive { overflow: visible; + overflow-x: scroll; } /* Make modal wider on wide screens */ diff --git a/templates/base.html b/templates/base.html index 36fc45e4..324891d0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -82,18 +82,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
-
- {% include 'sidebar.html' %} - - {% block sidebar %} - {% endblock %} +
-
+
{# Display django.contrib.messages as Bootstrap alerts #} {% bootstrap_messages %} {% block content %}{% endblock %}
-
+ +
+ {% include 'sidebar.html' %} + + {% block sidebar %} + {% endblock %}
diff --git a/tickets/migrations/0001_squashed_0007.py b/tickets/migrations/0001_squashed_0007.py new file mode 100644 index 00000000..19c73679 --- /dev/null +++ b/tickets/migrations/0001_squashed_0007.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-12-30 16:53 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import re2o.mixins + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + replaces = [ + ("tickets", "0001_initial"), + ("tickets", "0002_auto_20191120_0159"), + ("tickets", "0003_auto_20200422_1839"), + ("tickets", "0004_auto_20200422_2127"), + ("tickets", "0005_auto_20200422_2309"), + ("tickets", "0006_auto_20200423_0202"), + ("tickets", "0007_ticket_language"), + ] + + operations = [ + migrations.CreateModel( + name='CommentTicket', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date', models.DateTimeField(auto_now_add=True)), + ('comment', models.TextField(max_length=4095)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_comment', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'ticket', + 'verbose_name_plural': 'tickets', + 'permissions': (('view_commentticket', 'Can view a ticket object'),), + }, + bases=(re2o.mixins.AclMixin, models.Model), + ), + migrations.CreateModel( + name='Ticket', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(help_text='Title of the ticket.', max_length=255)), + ('description', models.TextField(max_length=3000)), + ('date', models.DateTimeField(auto_now_add=True)), + ('email', models.EmailField(help_text='An email address to get back to you.', max_length=100, null=True)), + ('solved', models.BooleanField(default=False)), + ('language', models.CharField(default='en', help_text='Language of the ticket.', max_length=16)), + ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tickets', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'ticket', + 'verbose_name_plural': 'tickets', + 'permissions': (('view_ticket', 'Can view a ticket object'),), + }, + bases=(re2o.mixins.AclMixin, models.Model), + ), + migrations.CreateModel( + name='TicketOption', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('publish_address', models.EmailField(help_text='Email address to publish the new tickets (leave empty for no publication).', max_length=1000, null=True)), + ], + options={ + 'verbose_name': 'tickets options', + 'permissions': (('view_ticketoption', 'Can view tickets options'),), + }, + bases=(re2o.mixins.AclMixin, models.Model), + ), + migrations.AddField( + model_name='commentticket', + name='parent_ticket', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tickets.Ticket'), + ), + ] diff --git a/topologie/migrations/0001_model_creation.py b/topologie/migrations/0001_model_creation.py new file mode 100644 index 00000000..1367271e --- /dev/null +++ b/topologie/migrations/0001_model_creation.py @@ -0,0 +1,954 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings +import django.contrib.auth.models +import django.core.validators +import re2o.mixins +import re2o.field_permissions + + +class Migration(migrations.Migration): + initial = True + dependencies = [("machines", "0001_model_creation")] + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + operations = [ + migrations.CreateModel( + name="Stack", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=32, blank=True, null=True)), + ("stack_id", models.CharField(max_length=32, unique=True)), + ("details", models.CharField(max_length=255, blank=True, null=True)), + ("member_id_min", models.PositiveIntegerField()), + ("member_id_max", models.PositiveIntegerField()), + ], + options={ + "permissions": (("view_stack", "Can view a stack object"),), + "verbose_name": "switches stack", + "verbose_name_plural": "switches stacks", + }, + ), + migrations.CreateModel( + name="AccessPoint", + bases=("machines.machine",), + fields=[ + ( + "machine_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="machines.Machine", + ), + ), + ( + "location", + models.CharField( + max_length=255, + help_text="Details about the AP's location.", + blank=True, + null=True, + ), + ), + ], + options={ + "permissions": ( + ("view_accesspoint", "Can view an access point object"), + ), + "verbose_name": "access point", + "verbose_name_plural": "access points", + }, + ), + migrations.CreateModel( + name="Server", + bases=("machines.machine",), + fields=[], + options={"proxy": True}, + ), + migrations.CreateModel( + name="Switch", + bases=("machines.machine",), + fields=[ + ( + "machine_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="machines.Machine", + ), + ), + ("number", models.PositiveIntegerField(help_text="Number of ports.")), + ("stack_member_id", models.PositiveIntegerField(blank=True, null=True)), + ( + "automatic_provision", + models.BooleanField( + default=False, help_text="Automatic provision for the switch." + ), + ), + ], + options={ + "permissions": (("view_switch", "Can view a switch object"),), + "verbose_name": "switch", + "verbose_name_plural": "switches", + }, + ), + migrations.CreateModel( + name="ModelSwitch", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("reference", models.CharField(max_length=255)), + ( + "commercial_name", + models.CharField(max_length=255, null=True, blank=True), + ), + ("firmware", models.CharField(max_length=255, null=True, blank=True)), + ( + "is_modular", + models.BooleanField( + default=False, help_text="The switch model is modular." + ), + ), + ( + "is_itself_module", + models.BooleanField( + default=False, help_text="The switch is considered as a module." + ), + ), + ], + options={ + "permissions": ( + ("view_modelswitch", "Can view a switch model object"), + ), + "verbose_name": "switch model", + "verbose_name_plural": "switch models", + }, + ), + migrations.CreateModel( + name="ModuleSwitch", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "reference", + models.CharField( + max_length=255, + help_text="Reference of a module.", + verbose_name="module reference", + ), + ), + ( + "comment", + models.CharField( + max_length=255, + null=True, + blank=True, + help_text="Comment.", + verbose_name="comment", + ), + ), + ], + options={ + "permissions": ( + ("view_moduleswitch", "Can view a switch module object"), + ), + "verbose_name": "switch module", + "verbose_name_plural": "switch modules", + }, + ), + migrations.CreateModel( + name="ModuleOnSwitch", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "slot", + models.CharField( + max_length=15, help_text="Slot on switch.", verbose_name="slot" + ), + ), + ], + options={ + "permissions": ( + ( + "view_moduleonswitch", + "Can view a link between switch and module object", + ), + ), + "verbose_name": "link between switch and module", + "verbose_name_plural": "links between switch and module", + }, + ), + migrations.CreateModel( + name="ConstructorSwitch", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255)), + ], + options={ + "permissions": ( + ("view_constructorswitch", "Can view a switch constructor object"), + ), + "verbose_name": "switch constructor", + "verbose_name_plural": "switch constructors", + }, + ), + migrations.CreateModel( + name="SwitchBay", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255)), + ("info", models.CharField(max_length=255, blank=True, null=True)), + ], + options={ + "permissions": (("view_switchbay", "Can view a switch bay object"),), + "verbose_name": "switch bay", + "verbose_name_plural": "switch bays", + }, + ), + migrations.CreateModel( + name="Dormitory", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255)), + ], + options={ + "permissions": (("view_dormitory", "Can view a dormitory object"),), + "verbose_name": "dormitory", + "verbose_name_plural": "dormitories", + }, + ), + migrations.CreateModel( + name="Building", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255)), + ], + options={ + "permissions": (("view_building", "Can view a building object"),), + "verbose_name": "building", + "verbose_name_plural": "buildings", + }, + ), + migrations.CreateModel( + name="Port", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("port", models.PositiveIntegerField()), + ( + "state", + models.BooleanField( + default=True, + help_text="Port state Active.", + verbose_name="port state Active", + ), + ), + ("details", models.CharField(max_length=255, blank=True)), + ], + options={ + "permissions": (("view_port", "Can view a port object"),), + "verbose_name": "port", + "verbose_name_plural": "ports", + }, + ), + migrations.CreateModel( + name="PortProfile", + bases=( + re2o.mixins.AclMixin, + re2o.mixins.RevMixin, + models.Model, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255, verbose_name="name")), + ( + "profil_default", + models.CharField( + max_length=32, + choices=( + ("room", "Room"), + ("access_point", "Access point"), + ("uplink", "Uplink"), + ("asso_machine", "Organisation machine"), + ("nothing", "Nothing"), + ), + blank=True, + null=True, + verbose_name="default profile", + ), + ), + ( + "radius_type", + models.CharField( + max_length=32, + choices=( + ("NO", "NO"), + ("802.1X", "802.1X"), + ("MAC-radius", "MAC-RADIUS"), + ), + help_text="Type of RADIUS authentication: inactive, MAC-address or 802.1X.", + verbose_name="RADIUS type", + ), + ), + ( + "radius_mode", + models.CharField( + max_length=32, + choices=(("STRICT", "STRICT"), ("COMMON", "COMMON")), + default="COMMON", + help_text="In case of MAC-authentication: mode COMMON or STRICT on this port.", + verbose_name="RADIUS mode", + ), + ), + ( + "speed", + models.CharField( + max_length=32, + choices=( + ("10-half", "10-half"), + ("100-half", "100-half"), + ("10-full", "10-full"), + ("100-full", "100-full"), + ("1000-full", "1000-full"), + ("auto", "auto"), + ("auto-10", "auto-10"), + ("auto-100", "auto-100"), + ), + default="auto", + help_text="Port speed limit.", + ), + ), + ( + "mac_limit", + models.IntegerField( + null=True, + blank=True, + help_text="Limit of MAC-address on this port.", + verbose_name="MAC limit", + ), + ), + ( + "flow_control", + models.BooleanField(default=False, help_text="Flow control."), + ), + ( + "dhcp_snooping", + models.BooleanField( + default=False, + help_text="Protect against rogue DHCP.", + verbose_name="DHCP snooping", + ), + ), + ( + "dhcpv6_snooping", + models.BooleanField( + default=False, + help_text="Protect against rogue DHCPv6.", + verbose_name="DHCPv6 snooping", + ), + ), + ( + "arp_protect", + models.BooleanField( + default=False, + help_text="Check if IP address is DHCP assigned.", + verbose_name="ARP protection", + ), + ), + ( + "ra_guard", + models.BooleanField( + default=False, + help_text="Protect against rogue RA.", + verbose_name="RA guard", + ), + ), + ( + "loop_protect", + models.BooleanField( + default=False, + help_text="Protect against loop.", + verbose_name="loop protection", + ), + ), + ], + options={ + "permissions": ( + ("view_portprofile", "Can view a port profile object"), + ), + "verbose_name": "port profile", + "verbose_name_plural": "port profiles", + }, + ), + migrations.CreateModel( + name="Room", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=255)), + ("details", models.CharField(blank=True, max_length=255)), + ], + options={ + "verbose_name": "room", + "verbose_name_plural": "rooms", + "ordering": ["building__name"], + "permissions": (("view_room", "Can view a room object"),), + }, + bases=(re2o.mixins.AclMixin, re2o.mixins.RevMixin, models.Model), + ), + ] diff --git a/topologie/migrations/0002_foreign_keys.py b/topologie/migrations/0002_foreign_keys.py new file mode 100644 index 00000000..9b2eb304 --- /dev/null +++ b/topologie/migrations/0002_foreign_keys.py @@ -0,0 +1,559 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-12-30 15:27 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import re2o.mixins + + +class Migration(migrations.Migration): + + dependencies = [ + ('machines', '0002_foreign_keys'), + ('preferences', '0001_model_creation'), + ('topologie', '0001_model_creation'), + ] + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + + operations = [ + migrations.AddField( + model_name='building', + name='dormitory', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='topologie.Dormitory'), + preserve_default=False, + ), + migrations.AddField( + model_name='modelswitch', + name='constructor', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='topologie.ConstructorSwitch'), + preserve_default=False, + ), + migrations.AddField( + model_name='moduleonswitch', + name='module', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='topologie.ModuleSwitch'), + preserve_default=False, + ), + migrations.AddField( + model_name='moduleonswitch', + name='switch', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='topologie.Switch'), + preserve_default=False, + ), + migrations.AddField( + model_name='port', + name='custom_profile', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='topologie.PortProfile'), + ), + migrations.AddField( + model_name='port', + name='machine_interface', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='machines.Interface'), + ), + migrations.AddField( + model_name='port', + name='related', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='related_port', to='topologie.Port'), + ), + migrations.AddField( + model_name='port', + name='switch', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='ports', to='topologie.Switch'), + preserve_default=False, + ), + migrations.AddField( + model_name='portprofile', + name='on_dormitory', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dormitory_ofprofil', to='topologie.Dormitory', verbose_name='profile on dormitory'), + ), + migrations.AddField( + model_name='portprofile', + name='vlan_tagged', + field=models.ManyToManyField(blank=True, related_name='vlan_tagged', to='machines.Vlan', verbose_name='VLAN(s) tagged'), + ), + migrations.AddField( + model_name='portprofile', + name='vlan_untagged', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vlan_untagged', to='machines.Vlan', verbose_name='VLAN untagged'), + ), + migrations.AddField( + model_name='switch', + name='management_creds', + field=models.ForeignKey(blank=True, help_text='Management credentials for the switch.', null=True, on_delete=django.db.models.deletion.PROTECT, to='preferences.SwitchManagementCred'), + ), + migrations.AddField( + model_name='switch', + name='model', + field=models.ForeignKey(blank=True, help_text='Switch model.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.ModelSwitch'), + ), + migrations.AddField( + model_name='switch', + name='radius_key', + field=models.ForeignKey(blank=True, help_text='RADIUS key of the switch.', null=True, on_delete=django.db.models.deletion.PROTECT, to='preferences.RadiusKey'), + ), + migrations.AddField( + model_name='switch', + name='stack', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.Stack'), + ), + migrations.AddField( + model_name='switch', + name='switchbay', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.SwitchBay'), + ), + migrations.AddField( + model_name='switchbay', + name='building', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='topologie.Building'), + preserve_default=False, + ), + migrations.AlterUniqueTogether( + name='moduleonswitch', + unique_together=set([('slot', 'switch')]), + ), + migrations.AddField( + model_name='port', + name='room', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='topologie.Room'), + ), + migrations.AlterUniqueTogether( + name='port', + unique_together=set([('switch', 'port')]), + ), + migrations.AlterUniqueTogether( + name='portprofile', + unique_together=set([('on_dormitory', 'profil_default')]), + ), + migrations.AlterUniqueTogether( + name='switch', + unique_together=set([('stack', 'stack_member_id')]), + ), + migrations.AddField( + model_name='room', + name='building', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='topologie.Building'), + ), + migrations.AlterUniqueTogether( + name='room', + unique_together=set([('name', 'building')]), + ), + ] diff --git a/users/admin.py b/users/admin.py index a18dae90..d083a951 100644 --- a/users/admin.py +++ b/users/admin.py @@ -46,10 +46,6 @@ from .models import ( Ban, Whitelist, Request, - LdapUser, - LdapServiceUser, - LdapServiceUserGroup, - LdapUserGroup, ) from .forms import ( UserAdminForm, @@ -57,57 +53,6 @@ from .forms import ( ) -class LdapUserAdmin(admin.ModelAdmin): - """LdapUser Admin view. Can't change password, manage - by User General model. - - Parameters: - Django ModelAdmin: Apply on django ModelAdmin - - """ - list_display = ("name", "uidNumber", "login_shell") - exclude = ("user_password", "sambat_nt_password") - search_fields = ("name",) - - -class LdapServiceUserAdmin(admin.ModelAdmin): - """LdapServiceUser Admin view. Can't change password, manage - by User General model. - - Parameters: - Django ModelAdmin: Apply on django ModelAdmin - - """ - - list_display = ("name",) - exclude = ("user_password",) - search_fields = ("name",) - - -class LdapUserGroupAdmin(admin.ModelAdmin): - """LdapUserGroup Admin view. - - Parameters: - Django ModelAdmin: Apply on django ModelAdmin - - """ - - list_display = ("name", "members", "gid") - search_fields = ("name",) - - -class LdapServiceUserGroupAdmin(admin.ModelAdmin): - """LdapServiceUserGroup Admin view. - - Parameters: - Django ModelAdmin: Apply on django ModelAdmin - - """ - - list_display = ("name",) - search_fields = ("name",) - - class SchoolAdmin(VersionAdmin): """School Admin view and management. @@ -338,10 +283,6 @@ class ServiceUserAdmin(VersionAdmin, BaseUserAdmin): admin.site.register(Adherent, AdherentAdmin) admin.site.register(Club, ClubAdmin) admin.site.register(ServiceUser, ServiceUserAdmin) -admin.site.register(LdapUser, LdapUserAdmin) -admin.site.register(LdapUserGroup, LdapUserGroupAdmin) -admin.site.register(LdapServiceUser, LdapServiceUserAdmin) -admin.site.register(LdapServiceUserGroup, LdapServiceUserGroupAdmin) admin.site.register(School, SchoolAdmin) admin.site.register(ListRight, ListRightAdmin) admin.site.register(ListShell, ListShellAdmin) diff --git a/users/migrations/0001_model_creation.py b/users/migrations/0001_model_creation.py new file mode 100644 index 00000000..6cdfd2e7 --- /dev/null +++ b/users/migrations/0001_model_creation.py @@ -0,0 +1,898 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +from django.conf import settings +import django.contrib.auth.models +import django.core.validators +import re2o.mixins +import re2o.field_permissions +import users.models + + +class Migration(migrations.Migration): + dependencies = [('auth', '0008_alter_user_username_max_length')] + initial = True + # We replace everything. + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + operations = [ + migrations.CreateModel( + name="User", + bases=( + re2o.mixins.RevMixin, + re2o.field_permissions.FieldPermissionModelMixin, + django.contrib.auth.models.AbstractBaseUser, + django.contrib.auth.models.PermissionsMixin, + re2o.mixins.AclMixin, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("surname", models.CharField(max_length=255)), + ( + "pseudo", + models.CharField( + max_length=32, + unique=True, + help_text="Must only contain letters, numerals or dashes.", + validators=[users.models.linux_user_validator], + ), + ), + ( + "email", + models.EmailField( + blank=True, + default="", + help_text="External email address allowing us to contact you.", + ), + ), + ( + "local_email_redirect", + models.BooleanField( + default=False, + help_text="Enable redirection of the local email messages to the main email address.", + ), + ), + ( + "local_email_enabled", + models.BooleanField( + default=False, help_text="Enable the local email account." + ), + ), + ( + "comment", + models.CharField( + help_text="Comment, school year.", max_length=255, blank=True + ), + ), + ("pwd_ntlm", models.CharField(max_length=255)), + ( + "state", + models.IntegerField( + choices=( + (0, "Active"), + (1, "Disabled"), + (2, "Archived"), + (3, "Not yet active"), + (4, "Fully archived"), + ), + default=3, + help_text="Account state.", + ), + ), + ( + "email_state", + models.IntegerField( + choices=( + (0, "Confirmed"), + (1, "Not confirmed"), + (2, "Waiting for email confirmation"), + ), + default=2, + ), + ), + ("registered", models.DateTimeField(auto_now_add=True)), + ("telephone", models.CharField(max_length=15, blank=True, null=True)), + ( + "uid_number", + models.PositiveIntegerField( + default=users.models.get_fresh_user_uid, unique=True + ), + ), + ( + "legacy_uid", + models.PositiveIntegerField( + unique=True, + blank=True, + null=True, + help_text="Optionnal legacy uid, for import and transition purpose", + ), + ), + ( + "shortcuts_enabled", + models.BooleanField( + verbose_name="enable shortcuts on Re2o website", default=True + ), + ), + ("email_change_date", models.DateTimeField(auto_now_add=True)), + ("theme", models.CharField(max_length=255, default="default.css")), + ( + "is_superuser", + models.BooleanField( + default=False, + help_text="Designates that this user has all permissions without explicitly assigning them.", + verbose_name="superuser status", + ), + ), + ( + "last_login", + models.DateTimeField( + blank=True, null=True, verbose_name="last login" + ), + ), + ( + "password", + models.CharField( + max_length=128, verbose_name="password" + ), + ), + ("groups", models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), + ("user_permissions", models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')) + ], + options={ + "permissions": ( + ("change_user_password", "Can change the password of a user"), + ("change_user_state", "Can edit the state of a user"), + ("change_user_force", "Can force the move"), + ("change_user_shell", "Can edit the shell of a user"), + ("change_user_pseudo", "Can edit the pseudo of a user"), + ( + "change_user_groups", + "Can edit the groups of rights of a user (critical permission)", + ), + ( + "change_all_users", + "Can edit all users, including those with rights", + ), + ("view_user", "Can view a user object"), + ), + "verbose_name": "user (member or club)", + "verbose_name_plural": "users (members or clubs)", + }, + ), + migrations.CreateModel( + name="Adherent", + fields=[ + ( + "user_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to=settings.AUTH_USER_MODEL, + ), + ), + ("name", models.CharField(max_length=255)), + ( + "gpg_fingerprint", + models.CharField(max_length=49, blank=True, null=True), + ), + ], + options={"verbose_name": "member", "verbose_name_plural": "members"}, + ), + migrations.CreateModel( + name="Club", + fields=[ + ( + "user_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to=settings.AUTH_USER_MODEL, + ), + ), + ("mailing", models.BooleanField(default=False)), + ], + options={"verbose_name": "club", "verbose_name_plural": "clubs"}, + ), + migrations.CreateModel( + name="ServiceUser", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + django.contrib.auth.models.AbstractBaseUser, + ), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "pseudo", + models.CharField( + max_length=32, + unique=True, + help_text="Must only contain letters, numerals or dashes.", + validators=[users.models.linux_user_validator], + ), + ), + ( + "access_group", + models.CharField( + choices=( + ("auth", "auth"), + ("readonly", "readonly"), + ("usermgmt", "usermgmt"), + ), + default="readonly", + max_length=32, + ), + ), + ( + "comment", + models.CharField(help_text="Comment.", max_length=255, blank=True), + ), + ( + "last_login", + models.DateTimeField( + blank=True, null=True, verbose_name="last login" + ), + ), + ( + "password", + models.CharField( + max_length=128, verbose_name="password" + ), + ), + ], + options={ + "permissions": ( + ("view_serviceuser", "Can view a service user object"), + ), + "verbose_name": "service user", + "verbose_name_plural": "service users", + }, + ), + migrations.CreateModel( + name="School", + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("name", models.CharField(max_length=255)), + ], + options={ + "permissions": (("view_school", "Can view a school object"),), + "verbose_name": "school", + "verbose_name_plural": "schools", + }, + ), + migrations.CreateModel( + name="ListRight", + bases=( + re2o.mixins.RevMixin, + re2o.mixins.AclMixin, + django.contrib.auth.models.Group, + ), + fields=[ + ( + "group_ptr", + models.OneToOneField( + parent_link=True, + auto_created=True, + primary_key=True, + on_delete=django.db.models.deletion.CASCADE, + serialize=False, + to="auth.Group", + ), + ), + ( + "unix_name", + models.CharField( + max_length=255, + unique=True, + validators=[ + django.core.validators.RegexValidator( + "^[a-z]+$", + message=( + "UNIX group names can only contain lower case letters." + ), + ) + ], + ), + ), + ("gid", models.PositiveIntegerField(unique=True, null=True)), + ("critical", models.BooleanField(default=False)), + ( + "details", + models.CharField( + help_text="Description.", max_length=255, blank=True + ), + ), + ], + options={ + "permissions": ( + ("view_listright", "Can view a group of rights object"), + ), + "verbose_name": "group of rights", + "verbose_name_plural": "groups of rights", + }, + ), + migrations.CreateModel( + name="ListShell", + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("shell", models.CharField(max_length=255, unique=True)), + ], + options={ + "permissions": (("view_listshell", "Can view a shell object"),), + "verbose_name": "shell", + "verbose_name_plural": "shells", + }, + ), + migrations.CreateModel( + name="Ban", + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("raison", models.CharField(max_length=255)), + ("date_start", models.DateTimeField(auto_now_add=True)), + ("date_end", models.DateTimeField()), + ( + "state", + models.IntegerField( + choices=( + (0, "HARD (no access)"), + (1, "SOFT (local access only)"), + (2, "RESTRICTED (speed limitation)"), + ), + default=0, + ), + ), + ], + options={ + "permissions": (("view_ban", "Can view a ban object"),), + "verbose_name": "ban", + "verbose_name_plural": "bans", + }, + ), + migrations.CreateModel( + name="Whitelist", + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ("raison", models.CharField(max_length=255)), + ("date_start", models.DateTimeField(auto_now_add=True)), + ("date_end", models.DateTimeField()), + ], + options={ + "permissions": (("view_whitelist", "Can view a whitelist object"),), + "verbose_name": "whitelist (free of charge access)", + "verbose_name_plural": "whitelists (free of charge access)", + }, + ), + migrations.CreateModel( + name="Request", + bases=(models.Model,), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "type", + models.CharField( + max_length=2, + choices=(("PW", "Password"), ("EM", "Email address")), + ), + ), + ("token", models.CharField(max_length=32)), + ("email", models.EmailField(blank=True, null=True)), + ("created_at", models.DateTimeField(auto_now_add=True, editable=False)), + ("expires_at", models.DateTimeField()), + ], + ), + migrations.CreateModel( + name="EMailAddress", + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + fields=[ + ( + "id", + models.AutoField( + verbose_name="ID", + serialize=False, + auto_created=True, + primary_key=True, + ), + ), + ( + "local_part", + models.CharField( + unique=True, + max_length=128, + help_text="Local part of the email address.", + ), + ), + ], + options={ + "permissions": ( + ("view_emailaddress", "Can view a local email account object"), + ), + "verbose_name": "local email account", + "verbose_name_plural": "local email accounts", + }, + ), + ] diff --git a/users/migrations/0002_foreign_keys.py b/users/migrations/0002_foreign_keys.py new file mode 100644 index 00000000..55358f03 --- /dev/null +++ b/users/migrations/0002_foreign_keys.py @@ -0,0 +1,494 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-12-30 15:27 +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 + + +class Migration(migrations.Migration): + + dependencies = [ + ('auth', '0008_alter_user_username_max_length'), + ('topologie', '0001_model_creation'), + ('users', '0001_model_creation'), + ] + + replaces = [ + ("users", "0001_initial"), + ("users", "0002_auto_20160630_2301"), + ("users", "0003_listrights_rights"), + ("users", "0004_auto_20160701_2312"), + ("users", "0005_auto_20160702_0006"), + ("users", "0006_ban"), + ("users", "0007_auto_20160702_2322"), + ("users", "0008_user_registered"), + ("users", "0009_user_room"), + ("users", "0010_auto_20160703_1226"), + ("users", "0011_auto_20160703_1227"), + ("users", "0012_auto_20160703_1230"), + ("users", "0013_auto_20160704_1547"), + ("users", "0014_auto_20160704_1548"), + ("users", "0015_whitelist"), + ("users", "0016_auto_20160706_1220"), + ("users", "0017_auto_20160707_0105"), + ("users", "0018_auto_20160707_0115"), + ("users", "0019_auto_20160708_1633"), + ("users", "0020_request"), + ("users", "0021_ldapuser"), + ("users", "0022_ldapuser_sambasid"), + ("users", "0023_auto_20160724_1908"), + ("users", "0024_remove_ldapuser_mac_list"), + ("users", "0025_listshell"), + ("users", "0026_user_shell"), + ("users", "0027_auto_20160726_0216"), + ("users", "0028_auto_20160726_0227"), + ("users", "0029_auto_20160726_0229"), + ("users", "0030_auto_20160726_0357"), + ("users", "0031_auto_20160726_0359"), + ("users", "0032_auto_20160727_2122"), + ("users", "0033_remove_ldapuser_loginshell"), + ("users", "0034_auto_20161018_0037"), + ("users", "0035_auto_20161018_0046"), + ("users", "0036_auto_20161022_2146"), + ("users", "0037_auto_20161028_1906"), + ("users", "0038_auto_20161031_0258"), + ("users", "0039_auto_20161119_0033"), + ("users", "0040_auto_20161119_1709"), + ("users", "0041_listright_details"), + ("users", "0042_auto_20161126_2028"), + ("users", "0043_auto_20161224_1156"), + ("users", "0043_ban_state"), + ("users", "0044_user_ssh_public_key"), + ("users", "0045_merge"), + ("users", "0046_auto_20170617_1433"), + ("users", "0047_auto_20170618_0156"), + ("users", "0048_auto_20170618_0210"), + ("users", "0049_auto_20170618_1424"), + ("users", "0050_serviceuser_comment"), + ("users", "0051_user_telephone"), + ("users", "0052_ldapuser_shadowexpire"), + ("users", "0053_auto_20170626_2105"), + ("users", "0054_auto_20170626_2219"), + ("users", "0055_auto_20171003_0556"), + ("users", "0056_auto_20171015_2033"), + ("users", "0057_auto_20171023_0301"), + ("users", "0058_auto_20171025_0154"), + ("users", "0059_auto_20171025_1854"), + ("users", "0060_auto_20171120_0317"), + ("users", "0061_auto_20171230_2033"), + ("users", "0062_auto_20171231_0056"), + ("users", "0063_auto_20171231_0140"), + ("users", "0064_auto_20171231_0150"), + ("users", "0065_auto_20171231_2053"), + ("users", "0066_grouppermissions"), + ("users", "0067_serveurpermission"), + ("users", "0068_auto_20180107_2245"), + ("users", "0069_club_mailing"), + ("users", "0070_auto_20180324_1906"), + ("users", "0071_auto_20180415_1252"), + ("users", "0072_auto_20180426_2021"), + ("users", "0073_auto_20180629_1614"), + ("users", "0074_auto_20180810_2104"), + ("users", "0074_auto_20180814_1059"), + ("users", "0075_merge_20180815_2202"), + ("users", "0076_auto_20180818_1321"), + ("users", "0077_auto_20180824_1750"), + ("users", "0078_auto_20181011_1405"), + ("users", "0079_auto_20181228_2039"), + ("users", "0080_auto_20190108_1726"), + ("users", "0081_auto_20190317_0302"), + ("users", "0082_auto_20190908_1338"), + ("users", "0083_user_shortcuts_enabled"), + ("users", "0084_auto_20191120_0159"), + ("users", "0085_user_email_state"), + ("users", "0086_user_email_change_date"), + ("users", "0087_request_email"), + ("users", "0088_auto_20200417_2312"), + ("users", "0089_auto_20200418_0112"), + ("users", "0090_auto_20200421_1825"), + ("users", "0091_auto_20200423_1256"), + ("users", "0092_auto_20200502_0057"), + ("users", "0093_user_profile_image"), + ("users", "0094_remove_user_profile_image"), + ("users", "0095_user_theme"), + ("users", "0096_auto_20210110_1811"), + ("cotisations", "0001_initial"), + ("cotisations", "0002_remove_facture_article"), + ("cotisations", "0003_auto_20160702_1448"), + ("cotisations", "0004_auto_20160702_1528"), + ("cotisations", "0005_auto_20160702_1532"), + ("cotisations", "0006_auto_20160702_1534"), + ("cotisations", "0007_auto_20160702_1543"), + ("cotisations", "0008_auto_20160702_1614"), + ("cotisations", "0009_remove_cotisation_user"), + ("cotisations", "0010_auto_20160702_1840"), + ("cotisations", "0011_auto_20160702_1911"), + ("cotisations", "0012_auto_20160704_0118"), + ("cotisations", "0013_auto_20160711_2240"), + ("cotisations", "0014_auto_20160712_0245"), + ("cotisations", "0015_auto_20160714_2142"), + ("cotisations", "0016_auto_20160715_0110"), + ("cotisations", "0017_auto_20170718_2329"), + ("cotisations", "0018_paiement_type_paiement"), + ("cotisations", "0019_auto_20170819_0055"), + ("cotisations", "0020_auto_20170819_0057"), + ("cotisations", "0021_auto_20170819_0104"), + ("cotisations", "0022_auto_20170824_0128"), + ("cotisations", "0023_auto_20170902_1303"), + ("cotisations", "0024_auto_20171015_2033"), + ("cotisations", "0025_article_type_user"), + ("cotisations", "0026_auto_20171028_0126"), + ("cotisations", "0027_auto_20171029_1156"), + ("cotisations", "0028_auto_20171231_0007"), + ("cotisations", "0029_auto_20180414_2056"), + ("cotisations", "0030_custom_payment"), + ("cotisations", "0031_comnpaypayment_production"), + ("cotisations", "0032_custom_invoice"), + ("cotisations", "0033_auto_20180818_1319"), + ("cotisations", "0034_auto_20180831_1532"), + ("cotisations", "0035_notepayment"), + ("cotisations", "0036_custominvoice_remark"), + ("cotisations", "0037_costestimate"), + ("cotisations", "0038_auto_20181231_1657"), + ("cotisations", "0039_freepayment"), + ("cotisations", "0040_auto_20191002_2335"), + ("cotisations", "0041_auto_20191103_2131"), + ("cotisations", "0042_auto_20191120_0159"), + ("cotisations", "0043_separation_membership_connection_p1"), + ("cotisations", "0044_separation_membership_connection_p2"), + ("cotisations", "0045_separation_membership_connection_p3"), + ("cotisations", "0046_article_need_membership"), + ("cotisations", "0047_article_need_membership_init"), + ("cotisations", "0048_auto_20201017_0018"), + ("cotisations", "0049_auto_20201102_2305"), + ("cotisations", "0050_auto_20201102_2342"), + ("cotisations", "0051_auto_20201228_1636"), + ("machines", "0001_initial"), + ("machines", "0002_auto_20160703_1444"), + ("machines", "0003_auto_20160703_1450"), + ("machines", "0004_auto_20160703_1451"), + ("machines", "0005_auto_20160703_1523"), + ("machines", "0006_auto_20160703_1813"), + ("machines", "0007_auto_20160703_1816"), + ("machines", "0008_remove_interface_ipv6"), + ("machines", "0009_auto_20160703_2358"), + ("machines", "0010_auto_20160704_0104"), + ("machines", "0011_auto_20160704_0105"), + ("machines", "0012_auto_20160704_0118"), + ("machines", "0013_auto_20160705_1014"), + ("machines", "0014_auto_20160706_1220"), + ("machines", "0015_auto_20160707_0105"), + ("machines", "0016_auto_20160708_1633"), + ("machines", "0017_auto_20160708_1645"), + ("machines", "0018_auto_20160708_1813"), + ("machines", "0019_auto_20160718_1141"), + ("machines", "0020_auto_20160718_1849"), + ("machines", "0021_auto_20161006_1943"), + ("machines", "0022_auto_20161011_1829"), + ("machines", "0023_iplist_ip_type"), + ("machines", "0024_machinetype_need_infra"), + ("machines", "0025_auto_20161023_0038"), + ("machines", "0026_auto_20161026_1348"), + ("machines", "0027_alias"), + ("machines", "0028_iptype_domaine_ip"), + ("machines", "0029_iptype_domaine_range"), + ("machines", "0030_auto_20161118_1730"), + ("machines", "0031_auto_20161119_1709"), + ("machines", "0032_auto_20161119_1850"), + ("machines", "0033_extension_need_infra"), + ("machines", "0034_iplist_need_infra"), + ("machines", "0035_auto_20161224_1201"), + ("machines", "0036_auto_20161224_1204"), + ("machines", "0037_domain_cname"), + ("machines", "0038_auto_20161224_1721"), + ("machines", "0039_auto_20161224_1732"), + ("machines", "0040_remove_interface_dns"), + ("machines", "0041_remove_ns_interface"), + ("machines", "0042_ns_ns"), + ("machines", "0043_auto_20170721_0350"), + ("machines", "0044_auto_20170808_0233"), + ("machines", "0045_auto_20170808_0348"), + ("machines", "0046_auto_20170808_1423"), + ("machines", "0047_auto_20170809_0606"), + ("machines", "0048_auto_20170823_2315"), + ("machines", "0049_vlan"), + ("machines", "0050_auto_20170826_0022"), + ("machines", "0051_iptype_vlan"), + ("machines", "0052_auto_20170828_2322"), + ("machines", "0053_text"), + ("machines", "0054_text_zone"), + ("machines", "0055_nas"), + ("machines", "0056_nas_port_access_mode"), + ("machines", "0057_nas_autocapture_mac"), + ("machines", "0058_auto_20171002_0350"), + ("machines", "0059_iptype_prefix_v6"), + ("machines", "0060_iptype_ouverture_ports"), + ("machines", "0061_auto_20171015_2033"), + ("machines", "0062_extension_origin_v6"), + ("machines", "0063_auto_20171020_0040"), + ("machines", "0064_auto_20171115_0253"), + ("machines", "0065_auto_20171115_1514"), + ("machines", "0066_srv"), + ("machines", "0067_auto_20171116_0152"), + ("machines", "0068_auto_20171116_0252"), + ("machines", "0069_auto_20171116_0822"), + ("machines", "0070_auto_20171231_1947"), + ("machines", "0071_auto_20171231_2100"), + ("machines", "0072_auto_20180108_1822"), + ("machines", "0073_auto_20180128_2203"), + ("machines", "0074_auto_20180129_0352"), + ("machines", "0075_auto_20180130_0052"), + ("machines", "0076_auto_20180130_1623"), + ("machines", "0077_auto_20180409_2243"), + ("machines", "0078_auto_20180415_1252"), + ("machines", "0079_auto_20180416_0107"), + ("machines", "0080_auto_20180502_2334"), + ("machines", "0081_auto_20180521_1413"), + ("machines", "0082_auto_20180525_2209"), + ("machines", "0083_remove_duplicate_rights"), + ("machines", "0084_dname"), + ("machines", "0085_sshfingerprint"), + ("machines", "0086_role"), + ("machines", "0087_dnssec"), + ("machines", "0088_iptype_prefix_v6_length"), + ("machines", "0089_auto_20180805_1148"), + ("machines", "0090_auto_20180805_1459"), + ("machines", "0091_auto_20180806_2310"), + ("machines", "0092_auto_20180807_0926"), + ("machines", "0093_auto_20180807_1115"), + ("machines", "0094_auto_20180815_1918"), + ("machines", "0095_auto_20180919_2225"), + ("machines", "0096_auto_20181013_1417"), + ("machines", "0097_extension_dnssec"), + ("machines", "0098_auto_20190102_1745"), + ("machines", "0099_role_recursive_dns"), + ("machines", "0100_auto_20190102_1753"), + ("machines", "0101_auto_20190108_1623"), + ("machines", "0102_auto_20190303_1611"), + ("machines", "0103_auto_20191002_2222"), + ("machines", "0104_auto_20191002_2231"), + ("machines", "0105_dname_ttl"), + ("machines", "0106_auto_20191120_0159"), + ("machines", "0107_fix_lowercase_domain"), + ("machines", "0108_ipv6list_active"), + ("preferences", "0001_initial"), + ("preferences", "0002_auto_20170625_1923"), + ("preferences", "0003_optionaluser_solde_negatif"), + ("preferences", "0004_assooption_services"), + ("preferences", "0005_auto_20170824_0139"), + ("preferences", "0006_auto_20170824_0143"), + ("preferences", "0007_auto_20170824_2056"), + ("preferences", "0008_auto_20170824_2122"), + ("preferences", "0009_assooption_utilisateur_asso"), + ("preferences", "0010_auto_20170825_0459"), + ("preferences", "0011_auto_20170825_2307"), + ("preferences", "0012_generaloption_req_expire_hrs"), + ("preferences", "0013_generaloption_site_name"), + ("preferences", "0014_generaloption_email_from"), + ("preferences", "0015_optionaltopologie_radius_general_policy"), + ("preferences", "0016_auto_20170902_1520"), + ("preferences", "0017_mailmessageoption"), + ("preferences", "0018_optionaltopologie_mac_autocapture"), + ("preferences", "0019_remove_optionaltopologie_mac_autocapture"), + ("preferences", "0020_optionalmachine_ipv6"), + ("preferences", "0021_auto_20171015_1741"), + ("preferences", "0022_auto_20171015_1758"), + ("preferences", "0023_auto_20171015_2033"), + ("preferences", "0024_optionaluser_all_can_create"), + ("preferences", "0025_auto_20171231_2142"), + ("preferences", "0025_generaloption_general_message"), + ("preferences", "0026_auto_20171216_0401"), + ("preferences", "0027_merge_20180106_2019"), + ("preferences", "0028_assooption_description"), + ("preferences", "0028_auto_20180111_1129"), + ("preferences", "0028_auto_20180128_2203"), + ("preferences", "0029_auto_20180111_1134"), + ("preferences", "0029_auto_20180318_0213"), + ("preferences", "0029_auto_20180318_1005"), + ("preferences", "0030_auto_20180111_2346"), + ("preferences", "0030_merge_20180320_1419"), + ("preferences", "0031_auto_20180323_0218"), + ("preferences", "0031_optionaluser_self_adhesion"), + ("preferences", "0032_optionaluser_min_online_payment"), + ("preferences", "0032_optionaluser_shell_default"), + ("preferences", "0033_accueiloption"), + ("preferences", "0033_generaloption_gtu_sum_up"), + ("preferences", "0034_auto_20180114_2025"), + ("preferences", "0034_auto_20180416_1120"), + ("preferences", "0035_auto_20180114_2132"), + ("preferences", "0035_optionaluser_allow_self_subscription"), + ("preferences", "0036_auto_20180114_2141"), + ("preferences", "0037_auto_20180114_2156"), + ("preferences", "0038_auto_20180114_2209"), + ("preferences", "0039_auto_20180115_0003"), + ("preferences", "0040_auto_20180129_1745"), + ("preferences", "0041_merge_20180130_0052"), + ("preferences", "0042_auto_20180222_1743"), + ("preferences", "0043_optionalmachine_create_machine"), + ("preferences", "0044_remove_payment_pass"), + ("preferences", "0045_remove_unused_payment_fields"), + ("preferences", "0046_optionaluser_mail_extension"), + ("preferences", "0047_mailcontact"), + ("preferences", "0048_auto_20180811_1515"), + ("preferences", "0049_optionaluser_self_change_shell"), + ("preferences", "0050_auto_20180818_1329"), + ("preferences", "0051_auto_20180919_2225"), + ("preferences", "0052_optionaluser_delete_notyetactive"), + ("preferences", "0053_optionaluser_self_change_room"), + ("preferences", "0055_generaloption_main_site_url"), + ("preferences", "0056_1_radiusoption"), + ("preferences", "0056_2_radiusoption"), + ("preferences", "0056_3_radiusoption"), + ("preferences", "0056_4_radiusoption"), + ("preferences", "0057_optionaluser_all_users_active"), + ("preferences", "0058_auto_20190108_1650"), + ("preferences", "0059_auto_20190120_1739"), + ("preferences", "0060_auto_20190712_1821"), + ("preferences", "0061_optionaluser_allow_archived_connexion"), + ("preferences", "0062_auto_20190910_1909"), + ("preferences", "0063_mandate"), + ("preferences", "0064_auto_20191008_1335"), + ("preferences", "0065_auto_20191010_1227"), + ("preferences", "0066_optionalmachine_default_dns_ttl"), + ("preferences", "0067_auto_20191120_0159"), + ("preferences", "0068_optionaluser_allow_set_password_during_user_creation"), + ("preferences", "0069_optionaluser_disable_emailnotyetconfirmed"), + ("preferences", "0070_auto_20200419_0225"), + ("preferences", "0071_optionaluser_self_change_pseudo"), + ("topologie", "0001_initial"), + ("topologie", "0002_auto_20160703_1118"), + ("topologie", "0003_room"), + ("topologie", "0004_auto_20160703_1122"), + ("topologie", "0005_auto_20160703_1123"), + ("topologie", "0006_auto_20160703_1129"), + ("topologie", "0007_auto_20160703_1148"), + ("topologie", "0008_port_room"), + ("topologie", "0009_auto_20160703_1200"), + ("topologie", "0010_auto_20160704_2148"), + ("topologie", "0011_auto_20160704_2153"), + ("topologie", "0012_port_machine_interface"), + ("topologie", "0013_port_related"), + ("topologie", "0014_auto_20160706_1238"), + ("topologie", "0015_auto_20160706_1452"), + ("topologie", "0016_auto_20160706_1531"), + ("topologie", "0017_auto_20160718_1141"), + ("topologie", "0018_room_details"), + ("topologie", "0019_auto_20161026_1348"), + ("topologie", "0020_auto_20161119_0033"), + ("topologie", "0021_port_radius"), + ("topologie", "0022_auto_20161211_1622"), + ("topologie", "0023_auto_20170817_1654"), + ("topologie", "0023_auto_20170826_1530"), + ("topologie", "0024_auto_20170818_1021"), + ("topologie", "0024_auto_20170826_1800"), + ("topologie", "0025_merge_20170902_1242"), + ("topologie", "0026_auto_20170902_1245"), + ("topologie", "0027_auto_20170905_1442"), + ("topologie", "0028_auto_20170913_1503"), + ("topologie", "0029_auto_20171002_0334"), + ("topologie", "0030_auto_20171004_0235"), + ("topologie", "0031_auto_20171015_2033"), + ("topologie", "0032_auto_20171026_0338"), + ("topologie", "0033_auto_20171231_1743"), + ("topologie", "0034_borne"), + ("topologie", "0035_auto_20180324_0023"), + ("topologie", "0036_transferborne"), + ("topologie", "0037_auto_20180325_0127"), + ("topologie", "0038_transfersw"), + ("topologie", "0039_port_new_switch"), + ("topologie", "0040_transferports"), + ("topologie", "0041_transferportsw"), + ("topologie", "0042_transferswitch"), + ("topologie", "0043_renamenewswitch"), + ("topologie", "0044_auto_20180326_0002"), + ("topologie", "0045_auto_20180326_0123"), + ("topologie", "0046_auto_20180326_0129"), + ("topologie", "0047_ap_machine"), + ("topologie", "0048_ap_machine"), + ("topologie", "0049_switchs_machine"), + ("topologie", "0050_port_new_switch"), + ("topologie", "0051_switchs_machine"), + ("topologie", "0052_transferports"), + ("topologie", "0053_finalsw"), + ("topologie", "0054_auto_20180326_1742"), + ("topologie", "0055_auto_20180329_0431"), + ("topologie", "0056_building_switchbay"), + ("topologie", "0057_auto_20180408_0316"), + ("topologie", "0058_remove_switch_location"), + ("topologie", "0059_auto_20180415_2249"), + ("topologie", "0060_server"), + ("topologie", "0061_portprofile"), + ("topologie", "0062_auto_20180815_1918"), + ("topologie", "0063_auto_20180919_2225"), + ("topologie", "0064_switch_automatic_provision"), + ("topologie", "0065_auto_20180927_1836"), + ("topologie", "0066_modelswitch_commercial_name"), + ("topologie", "0067_auto_20181230_1819"), + ("topologie", "0068_auto_20190102_1758"), + ("topologie", "0069_auto_20190108_1439"), + ("topologie", "0070_auto_20190218_1743"), + ("topologie", "0071_auto_20190218_1936"), + ("topologie", "0072_auto_20190720_2318"), + ("topologie", "0073_auto_20191120_0159"), + ("topologie", "0074_auto_20200419_1640"), + ] + + operations = [ + migrations.AddField( + model_name='adherent', + name='room', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='topologie.Room'), + ), + migrations.AddField( + model_name='ban', + name='user', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + migrations.AddField( + model_name='club', + name='administrators', + field=models.ManyToManyField(blank=True, related_name='club_administrator', to='users.Adherent'), + ), + migrations.AddField( + model_name='club', + name='members', + field=models.ManyToManyField(blank=True, related_name='club_members', to='users.Adherent'), + ), + migrations.AddField( + model_name='club', + name='room', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='topologie.Room'), + ), + migrations.AddField( + model_name='emailaddress', + name='user', + field=models.ForeignKey(default=None, help_text='User of the local email account.', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + migrations.AddField( + model_name='request', + name='user', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + migrations.AddField( + model_name='user', + name='school', + field=models.ForeignKey(blank=True, help_text='Education institute.', null=True, on_delete=django.db.models.deletion.PROTECT, to='users.School'), + ), + migrations.AddField( + model_name='user', + name='shell', + field=models.ForeignKey(blank=True, help_text='Unix shell.', null=True, on_delete=django.db.models.deletion.PROTECT, to='users.ListShell'), + ), + migrations.AddField( + model_name='whitelist', + name='user', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + ] diff --git a/users/migrations/0096_auto_20210110_1811.py b/users/migrations/0096_auto_20210110_1811.py new file mode 100644 index 00000000..6a6fd720 --- /dev/null +++ b/users/migrations/0096_auto_20210110_1811.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2021-01-10 17:11 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0095_user_theme'), + ] + + operations = [ + migrations.DeleteModel( + name='LdapServiceUser', + ), + migrations.DeleteModel( + name='LdapServiceUserGroup', + ), + migrations.DeleteModel( + name='LdapUser', + ), + migrations.DeleteModel( + name='LdapUserGroup', + ), + ] diff --git a/users/models.py b/users/models.py index 2b6eaacf..8313bfd7 100755 --- a/users/models.py +++ b/users/models.py @@ -39,14 +39,6 @@ Here are defined the following django models : * Schools (teaching structures) * Rights (Groups and ListRight) * ServiceUser (for ldap connexions) - -Also define django-ldapdb models : - * LdapUser - * LdapGroup - * LdapServiceUser - -These objects are sync from django regular models as auxiliary models from -sql data into ldap. """ @@ -82,8 +74,6 @@ from django.core.files.uploadedfile import InMemoryUploadedFile from reversion import revisions as reversion -import ldapdb.models -import ldapdb.models.fields from re2o.settings import LDAP, GID_RANGES, UID_RANGES from re2o.field_permissions import FieldPermissionModelMixin @@ -96,6 +86,8 @@ from machines.models import Domain, Interface, Machine, regen from preferences.models import GeneralOption, AssoOption, OptionalUser from preferences.models import OptionalMachine, MailMessageOption +from users import signals + from PIL import Image from io import BytesIO import sys @@ -1042,7 +1034,7 @@ class User( """ cls.mass_disable_email(queryset_users) Machine.mass_delete(Machine.objects.filter(user__in=queryset_users)) - cls.ldap_delete_users(queryset_users) + signals.remove_mass.send(sender=cls, queryset=queryset_users) def archive(self): """Method, archive user by unassigning ips. @@ -1072,7 +1064,7 @@ class User( def full_archive(self): """Method, full archive an user by unassigning ips, deleting data - and ldap deletion. + and authentication deletion. Parameters: self (user instance): user to full archive. @@ -1080,7 +1072,7 @@ class User( """ self.archive() self.delete_data() - self.ldap_del() + signals.remove.send(sender=User, instance=self) @classmethod def mass_full_archive(cls, users_list): @@ -1102,14 +1094,14 @@ class User( def unarchive(self): """Method, unarchive an user by assigning ips, and recreating - ldap user associated. + authentication user associated. Parameters: self (user instance): user to unarchive. """ self.assign_ips() - self.ldap_sync() + signals.synchronise.send(sender=self.__class__, instance=self) def state_sync(self): """Master Method, call unarchive, full_archive or archive method @@ -1135,109 +1127,6 @@ class User( ): self.full_archive() - def ldap_sync( - self, base=True, access_refresh=True, mac_refresh=True, group_refresh=False - ): - """Method ldap_sync, sync in ldap with self user attributes. - Each User instance is copy into ldap, via a LdapUser virtual objects. - This method performs a copy of several attributes (name, surname, mail, - hashed SSHA password, ntlm password, shell, homedirectory). - - Update, or create if needed a ldap entry related with the User instance. - - Parameters: - self (user instance): user to sync in ldap. - base (boolean): Default true, if base is true, perform a basic - sync of basic attributes. - access_refresh (boolean): Default true, if access_refresh is true, - update the dialup_access attributes based on has_access (is this user - has a valid internet access). - mac_refresh (boolean): Default true, if mac_refresh, update the mac_address - list of the user. - group_refresh (boolean): Default False, if true, update the groups membership - of this user. Onerous option, call ldap_sync() on every groups of the user. - - """ - if sys.version_info[0] >= 3 and ( - self.state == self.STATE_ACTIVE - or self.state == self.STATE_ARCHIVE - or self.state == self.STATE_DISABLED - ): - self.refresh_from_db() - try: - user_ldap = LdapUser.objects.get(uidNumber=self.uid_number) - except LdapUser.DoesNotExist: - user_ldap = LdapUser(uidNumber=self.uid_number) - base = True - access_refresh = True - mac_refresh = True - if base: - user_ldap.name = self.pseudo - user_ldap.sn = self.pseudo - user_ldap.dialupAccess = str(self.has_access()) - user_ldap.home_directory = self.home_directory - user_ldap.mail = self.get_mail - user_ldap.given_name = ( - self.surname.lower() + "_" + self.name.lower()[:3] - ) - user_ldap.gid = LDAP["user_gid"] - if "{SSHA}" in self.password or "{SMD5}" in self.password: - # We remove the extra $ added at import from ldap - user_ldap.user_password = self.password[:6] + self.password[7:] - elif "{crypt}" in self.password: - # depending on the length, we need to remove or not a $ - if len(self.password) == 41: - user_ldap.user_password = self.password - else: - user_ldap.user_password = self.password[:7] + self.password[8:] - - user_ldap.sambat_nt_password = self.pwd_ntlm.upper() - if self.get_shell: - user_ldap.login_shell = str(self.get_shell) - user_ldap.shadowexpire = self.get_shadow_expire - if access_refresh: - user_ldap.dialupAccess = str(self.has_access()) - if mac_refresh: - user_ldap.macs = [ - str(mac) - for mac in Interface.objects.filter(machine__user=self) - .values_list("mac_address", flat=True) - .distinct() - ] - if group_refresh: - # Need to refresh all groups because we don't know which groups - # were updated during edition of groups and the user may no longer - # be part of the updated group (case of group removal) - for group in Group.objects.all(): - if hasattr(group, "listright"): - group.listright.ldap_sync() - user_ldap.save() - - def ldap_del(self): - """Method, delete an user in ldap. - - Parameters: - self (user instance): user to delete in Ldap. - - """ - try: - user_ldap = LdapUser.objects.get(name=self.pseudo) - user_ldap.delete() - except LdapUser.DoesNotExist: - pass - - @classmethod - def ldap_delete_users(cls, queryset_users): - """Class method, delete several users in ldap (queryset). - - Parameters: - queryset_users (list of users queryset): users to delete - in ldap. - """ - LdapUser.objects.filter( - name__in=list(queryset_users.values_list("pseudo", flat=True)) - ) - ###### Send mail functions ###### def notif_inscription(self, request=None): @@ -2195,7 +2084,7 @@ class Club(User): @receiver(post_save, sender=User) def user_post_save(**kwargs): """Django signal, post save operations on Adherent, Club and User. - Sync pseudo, sync ldap, create mailalias and send welcome email if needed + Sync pseudo, sync authentication, create mailalias and send welcome email if needed (new user) """ @@ -2207,8 +2096,7 @@ def user_post_save(**kwargs): user.notif_inscription(user.request) user.set_active() user.state_sync() - user.ldap_sync( - base=True, access_refresh=True, mac_refresh=False, group_refresh=True + signals.synchronise.send(sender=User, instance=user, base=True, access_refresh=True, mac_refresh=False, group_refresh=True ) regen("mailing") @@ -2216,14 +2104,13 @@ def user_post_save(**kwargs): @receiver(m2m_changed, sender=User.groups.through) def user_group_relation_changed(**kwargs): """Django signal, used for User Groups change (related models). - Sync ldap, with calling group_refresh. + Sync authentication, with calling group_refresh. """ action = kwargs["action"] if action in ("post_add", "post_remove", "post_clear"): user = kwargs["instance"] - user.ldap_sync( - base=False, access_refresh=False, mac_refresh=False, group_refresh=True + signals.synchronise.send(sender=User, instance=user, base=False, access_refresh=False, mac_refresh=False, group_refresh=True ) @@ -2232,20 +2119,20 @@ def user_group_relation_changed(**kwargs): @receiver(post_delete, sender=User) def user_post_delete(**kwargs): """Django signal, post delete operations on Adherent, Club and User. - Delete user in ldap. + Delete user in authentication. """ user = kwargs["instance"] - user.ldap_del() + signals.remove.send(sender=User, instance=user) regen("mailing") class ServiceUser(RevMixin, AclMixin, AbstractBaseUser): """A class representing a serviceuser (it is considered as a user with special informations). - The serviceuser is a special user used with special access to ldap tree. It is + The serviceuser is a special user used with special access to authentication tree. It is its only usefullness, and service user can't connect to re2o. - Each service connected to ldap for auth (ex dokuwiki, owncloud, etc) should + Each service connected to authentication for auth (ex dokuwiki, owncloud, etc) should have a different service user with special acl (readonly, auth) and password. Attributes: @@ -2293,65 +2180,6 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser): """ return self.pseudo - def ldap_sync(self): - """Method ldap_sync, sync the serviceuser in ldap with its attributes. - Each ServiceUser instance is copy into ldap, via a LdapServiceUser virtual object. - This method performs a copy of several attributes (pseudo, access). - - Update, or create if needed a mirror ldap entry related with the ServiceUserinstance. - - Parameters: - self (serviceuser instance): ServiceUser to sync in ldap. - - """ - try: - user_ldap = LdapServiceUser.objects.get(name=self.pseudo) - except LdapServiceUser.DoesNotExist: - user_ldap = LdapServiceUser(name=self.pseudo) - user_ldap.user_password = self.password[:6] + self.password[7:] - user_ldap.save() - self.serviceuser_group_sync() - - def ldap_del(self): - """Method, delete an ServiceUser in ldap. - - Parameters: - self (ServiceUser instance): serviceuser to delete in Ldap. - - """ - try: - user_ldap = LdapServiceUser.objects.get(name=self.pseudo) - user_ldap.delete() - except LdapUser.DoesNotExist: - pass - self.serviceuser_group_sync() - - def serviceuser_group_sync(self): - """Method, update serviceuser group sync in ldap. - In LDAP, Acl depends on the ldapgroup (readonly, auth, or usermgt), - so the ldap group need to be synced with the accessgroup field on ServiceUser. - Called by ldap_sync and ldap_del. - - Parameters: - self (ServiceUser instance): serviceuser to update groups in LDAP. - - """ - try: - group = LdapServiceUserGroup.objects.get(name=self.access_group) - except: - group = LdapServiceUserGroup(name=self.access_group) - group.members = list( - LdapServiceUser.objects.filter( - name__in=[ - user.pseudo - for user in ServiceUser.objects.filter( - access_group=self.access_group - ) - ] - ).values_list("dn", flat=True) - ) - group.save() - def __str__(self): return self.pseudo @@ -2359,21 +2187,21 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser): @receiver(post_save, sender=ServiceUser) def service_user_post_save(**kwargs): """Django signal, post save operations on ServiceUser. - Sync or create serviceuser in ldap. + Sync or create serviceuser in authentication. """ service_user = kwargs["instance"] - service_user.ldap_sync() + signals.synchronise.send(sender=ServiceUser, instance=service_user) @receiver(post_delete, sender=ServiceUser) def service_user_post_delete(**kwargs): """Django signal, post delete operations on ServiceUser. - Delete service user in ldap. + Delete service user in authentication. """ service_user = kwargs["instance"] - service_user.ldap_del() + signals.remove.send(sender=ServiceUser, instance=service_user) class School(RevMixin, AclMixin, models.Model): @@ -2448,58 +2276,25 @@ class ListRight(RevMixin, AclMixin, Group): def __str__(self): return self.name - def ldap_sync(self): - """Method ldap_sync, sync the listright/group in ldap with its listright attributes. - Each ListRight/Group instance is copy into ldap, via a LdapUserGroup virtual objects. - This method performs a copy of several attributes (name, members, gid, etc). - The primary key is the gid, and should never change. - - Update, or create if needed a ldap entry related with the ListRight/Group instance. - - Parameters: - self (listright instance): ListRight/Group to sync in ldap. - - """ - try: - group_ldap = LdapUserGroup.objects.get(gid=self.gid) - except LdapUserGroup.DoesNotExist: - group_ldap = LdapUserGroup(gid=self.gid) - group_ldap.name = self.unix_name - group_ldap.members = [user.pseudo for user in self.user_set.all()] - group_ldap.save() - - def ldap_del(self): - """Method, delete an ListRight/Group in ldap. - - Parameters: - self (listright/Group instance): group to delete in Ldap. - - """ - try: - group_ldap = LdapUserGroup.objects.get(gid=self.gid) - group_ldap.delete() - except LdapUserGroup.DoesNotExist: - pass - @receiver(post_save, sender=ListRight) def listright_post_save(**kwargs): """Django signal, post save operations on ListRight/Group objects. - Sync or create group in ldap. + Sync or create group in authentication. """ right = kwargs["instance"] - right.ldap_sync() + signals.synchronise.send(sender=ListRight, instance=right) @receiver(post_delete, sender=ListRight) def listright_post_delete(**kwargs): """Django signal, post delete operations on ListRight/Group objects. - Delete group in ldap. + Delete group in authentication. """ right = kwargs["instance"] - right.ldap_del() + signals.remove.send(sender=ListRight, instance=right) class ListShell(RevMixin, AclMixin, models.Model): @@ -2649,13 +2444,13 @@ class Ban(RevMixin, AclMixin, models.Model): @receiver(post_save, sender=Ban) def ban_post_save(**kwargs): """Django signal, post save operations on Ban objects. - Sync user's access state in ldap, call email notification if needed. + Sync user's access state in authentication, call email notification if needed. """ ban = kwargs["instance"] is_created = kwargs["created"] user = ban.user - user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + signals.synchronise.send(sender=User, instance=user, base=False, access_refresh=True, mac_refresh=False) regen("mailing") if is_created: ban.notif_ban(ban.request) @@ -2669,11 +2464,11 @@ def ban_post_save(**kwargs): @receiver(post_delete, sender=Ban) def ban_post_delete(**kwargs): """Django signal, post delete operations on Ban objects. - Sync user's access state in ldap. + Sync user's access state in authentication. """ user = kwargs["instance"].user - user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + signals.synchronise.send(sender=User, instance=user, base=False, access_refresh=True, mac_refresh=False) regen("mailing") regen("dhcp") regen("mac_ip_list") @@ -2740,12 +2535,12 @@ class Whitelist(RevMixin, AclMixin, models.Model): @receiver(post_save, sender=Whitelist) def whitelist_post_save(**kwargs): """Django signal, post save operations on Whitelist objects. - Sync user's access state in ldap. + Sync user's access state in authentication. """ whitelist = kwargs["instance"] user = whitelist.user - user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + signals.synchronise.send(sender=User, instance=user, base=False, access_refresh=True, mac_refresh=False) is_created = kwargs["created"] regen("mailing") if is_created: @@ -2759,11 +2554,11 @@ def whitelist_post_save(**kwargs): @receiver(post_delete, sender=Whitelist) def whitelist_post_delete(**kwargs): """Django signal, post delete operations on Whitelist objects. - Sync user's access state in ldap. + Sync user's access state in authentication. """ user = kwargs["instance"].user - user.ldap_sync(base=False, access_refresh=True, mac_refresh=False) + signals.synchronise.send(sender=User, instance=user, base=False, access_refresh=True, mac_refresh=False) regen("mailing") regen("dhcp") regen("mac_ip_list") @@ -2996,171 +2791,3 @@ class EMailAddress(RevMixin, AclMixin, models.Model): raise ValidationError(reason) super(EMailAddress, self).clean(*args, **kwargs) - -class LdapUser(ldapdb.models.Model): - """A class representing a LdapUser in LDAP, its LDAP conterpart. - Synced from re2o django User model, (User django models), - with a copy of its attributes/fields into LDAP, so this class is a mirror - of the classic django User model. - - The basedn userdn is specified in settings. - - Attributes: - name: The name of this User - uid: The uid (login) for the unix user - uidNumber: Linux uid number - gid: The default gid number for this user - sn: The user "str" pseudo - login_shell: Linux shell for the user - mail: Email address contact for this user - display_name: Pretty display name for this user - dialupAccess: Boolean, True for valid membership - sambaSID: Identical id as uidNumber - user_password: SSHA hashed password of user - samba_nt_password: NTLM hashed password of user - macs: Multivalued mac address - shadowexpire: Set it to 0 to block access for this user and disabled - account - """ - - # LDAP meta-data - base_dn = LDAP["base_user_dn"] - object_classes = [ - "inetOrgPerson", - "top", - "posixAccount", - "sambaSamAccount", - "radiusprofile", - "shadowAccount", - ] - - # attributes - gid = ldapdb.models.fields.IntegerField(db_column="gidNumber") - name = ldapdb.models.fields.CharField( - db_column="cn", max_length=200, primary_key=True - ) - uid = ldapdb.models.fields.CharField(db_column="uid", max_length=200) - uidNumber = ldapdb.models.fields.IntegerField(db_column="uidNumber", unique=True) - sn = ldapdb.models.fields.CharField(db_column="sn", max_length=200) - login_shell = ldapdb.models.fields.CharField( - db_column="loginShell", max_length=200, blank=True, null=True - ) - mail = ldapdb.models.fields.CharField(db_column="mail", max_length=200) - given_name = ldapdb.models.fields.CharField(db_column="givenName", max_length=200) - home_directory = ldapdb.models.fields.CharField( - db_column="homeDirectory", max_length=200 - ) - display_name = ldapdb.models.fields.CharField( - db_column="displayName", max_length=200, blank=True, null=True - ) - dialupAccess = ldapdb.models.fields.CharField(db_column="dialupAccess") - sambaSID = ldapdb.models.fields.IntegerField(db_column="sambaSID", unique=True) - user_password = ldapdb.models.fields.CharField( - db_column="userPassword", max_length=200, blank=True, null=True - ) - sambat_nt_password = ldapdb.models.fields.CharField( - db_column="sambaNTPassword", max_length=200, blank=True, null=True - ) - macs = ldapdb.models.fields.ListField( - db_column="radiusCallingStationId", max_length=200, blank=True, null=True - ) - shadowexpire = ldapdb.models.fields.CharField( - db_column="shadowExpire", blank=True, null=True - ) - - def __str__(self): - return self.name - - def __unicode__(self): - return self.name - - def save(self, *args, **kwargs): - self.sn = self.name - self.uid = self.name - self.sambaSID = self.uidNumber - super(LdapUser, self).save(*args, **kwargs) - - -class LdapUserGroup(ldapdb.models.Model): - """A class representing a LdapUserGroup in LDAP, its LDAP conterpart. - Synced from UserGroup, (ListRight/Group django models), - with a copy of its attributes/fields into LDAP, so this class is a mirror - of the classic django ListRight model. - - The basedn usergroupdn is specified in settings. - - Attributes: - name: The name of this LdapUserGroup - gid: The gid number for this unix group - members: Users dn members of this LdapUserGroup - """ - - # LDAP meta-data - base_dn = LDAP["base_usergroup_dn"] - object_classes = ["posixGroup"] - - # attributes - gid = ldapdb.models.fields.IntegerField(db_column="gidNumber") - members = ldapdb.models.fields.ListField(db_column="memberUid", blank=True) - name = ldapdb.models.fields.CharField( - db_column="cn", max_length=200, primary_key=True - ) - - def __str__(self): - return self.name - - -class LdapServiceUser(ldapdb.models.Model): - """A class representing a ServiceUser in LDAP, its LDAP conterpart. - Synced from ServiceUser, with a copy of its attributes/fields into LDAP, - so this class is a mirror of the classic django ServiceUser model. - - The basedn userservicedn is specified in settings. - - Attributes: - name: The name of this ServiceUser - user_password: The SSHA hashed password of this ServiceUser - """ - - # LDAP meta-data - base_dn = LDAP["base_userservice_dn"] - object_classes = ["applicationProcess", "simpleSecurityObject"] - - # attributes - name = ldapdb.models.fields.CharField( - db_column="cn", max_length=200, primary_key=True - ) - user_password = ldapdb.models.fields.CharField( - db_column="userPassword", max_length=200, blank=True, null=True - ) - - def __str__(self): - return self.name - - -class LdapServiceUserGroup(ldapdb.models.Model): - """A class representing a ServiceUserGroup in LDAP, its LDAP conterpart. - Synced from ServiceUserGroup, with a copy of its attributes/fields into LDAP, - so this class is a mirror of the classic django ServiceUserGroup model. - - The basedn userservicegroupdn is specified in settings. - - Attributes: - name: The name of this ServiceUserGroup - members: ServiceUsers dn members of this ServiceUserGroup - """ - - # LDAP meta-data - base_dn = LDAP["base_userservicegroup_dn"] - object_classes = ["groupOfNames"] - - # attributes - name = ldapdb.models.fields.CharField( - db_column="cn", max_length=200, primary_key=True - ) - members = ldapdb.models.fields.ListField(db_column="member", blank=True) - - def __str__(self): - return self.name - - diff --git a/users/signals.py b/users/signals.py new file mode 100644 index 00000000..7336e5fc --- /dev/null +++ b/users/signals.py @@ -0,0 +1,33 @@ +""" +A set of signals used by users. Various classes in users emit these signals to signal the need to sync or +remove an object from optionnal authentication backends, e.g. LDAP. + +* `users.signals.synchronise`: + Expresses the need for an instance of a users class to be synchronised. `sender` and `instance` are + always set. It is up to the receiver to ensure the others are set correctly if they make sense. + Arguments: + * `sender` : The model class. + * `instance` : The actual instance being synchronised. + * `base` : Default `True`. When `True`, synchronise basic attributes. + * `access_refresh` : Default `True`. When `True`, synchronise the access time. + * `mac_refresh` : Default `True`. When True, synchronise the list of mac addresses. + * `group_refresh`: Default `False`. When `True` synchronise the groups of the instance. +* `users.signals.remove`: + Expresses the need for an instance of a users class to be removed. + Arguments: + * `sender` : The model class. + * `instance` : The actual instance being removed. +* `users.signals.remove_mass`: + Same as `users.signals.remove` except it removes a queryset. For now it is only used by `users.models.User`. + Arguments: + * `sender` : The model class. + * `queryset` : The actual instances being removed. + +""" + +import django.dispatch + +synchronise = django.dispatch.Signal(providing_args=["sender", "instance", "base", "access_refresh", "mac_refresh", "group_refresh"]) +remove = django.dispatch.Signal(providing_args=["sender", "instance"]) +remove_mass = django.dispatch.Signal(providing_args=["sender", "queryset"]) + diff --git a/users/templates/users/edit_listright.html b/users/templates/users/edit_listright.html index 76e3b756..3f23341c 100644 --- a/users/templates/users/edit_listright.html +++ b/users/templates/users/edit_listright.html @@ -54,6 +54,7 @@ with this program; if not, write to the Free Software Foundation, Inc., :data="treeData" :options="treeOptions" @node:checked="onNodeChecked" + @node:unchecked="onNodeUnchecked" />