templates: add way to set a link to the global administration portal
This commit is contained in:
parent
8bd135e36a
commit
dc93570ab4
96
README
96
README
|
@ -64,98 +64,4 @@ local_settings.py file or in the environment.
|
|||
Name Description
|
||||
================================ ============================================
|
||||
TEMPLATE_VARS dictionnary of variables passed to templates
|
||||
FAVICON_URL URL pointing to the favicon
|
||||
WCSINST_DEFAULT_VARIABLES default value for WCSINST new instances
|
||||
PROFILE_FORM_PLUGIN_FORM_CLASS form class to use instead of the default one
|
||||
for editing user profile
|
||||
|
||||
Migrating users from W.C.S. to portail-citoyen
|
||||
----------------------------------------------
|
||||
|
||||
You must use the management command named load-wcs-users. You must first link
|
||||
your W.C.S. instance to the portail-citoyen as a new SAML 2.0 service provider.
|
||||
The command accept the following options::
|
||||
|
||||
|
||||
--provider=<provider_name>
|
||||
|
||||
The name of the SAML 2.0 service provider in the portail citoyen configuratio.
|
||||
This option is mandatory.
|
||||
|
||||
--mapping=<wcs_field_name>:<user_field_name>
|
||||
|
||||
Map a user field identifier from W.C.S. to a local user model field. This
|
||||
option is mandatory.
|
||||
|
||||
--extra=<package_path>
|
||||
|
||||
The path to a W.C.S. extra package to load (AuQuotidien for example).
|
||||
|
||||
--verbose
|
||||
|
||||
Display information logged on the console
|
||||
|
||||
--debug
|
||||
|
||||
display debugging information on the console
|
||||
|
||||
--fake
|
||||
|
||||
Launch a dry run, i.e. do not save new user and new federation
|
||||
|
||||
--help-mapping
|
||||
|
||||
Display the list of field available in the local user model and in the
|
||||
W.C.S. user model
|
||||
|
||||
--allow-not-mapped
|
||||
|
||||
Do not fail when a W.C.S. user field is not mapped to a local user field
|
||||
|
||||
|
||||
Importing role from W.C.S. into portail-citoyen
|
||||
-----------------------------------------------
|
||||
|
||||
Your must first decide on a prefix for naming roles on the portail-citoyen
|
||||
side, default is 'AuQuo::'. Then federated roles must be actived and the
|
||||
prefix be configured in the `site-options.cfg` file of the W.C.S. host
|
||||
directory like this::
|
||||
|
||||
[options]
|
||||
saml2_use_role = true
|
||||
saml2_role_prefix = MyPrefix::
|
||||
|
||||
Then you can use the `load-wcs-roles` command which accept the following options::
|
||||
|
||||
--url=<url>
|
||||
|
||||
URL of the W.C.S. instance from which we want to import roles (mandatory)
|
||||
|
||||
--prefix
|
||||
|
||||
The chosen federated role name prefix (mandatory)
|
||||
|
||||
--orig
|
||||
|
||||
The web-service identifier configured in `site-options.cfg` (mandatory)
|
||||
|
||||
--key
|
||||
|
||||
The web-service signature secret configured in `site-options.cfg` (mandatory)
|
||||
|
||||
--email
|
||||
|
||||
The email of the admin user used to access the fole list (mandatory)
|
||||
|
||||
--deleted-orphaned-roles
|
||||
|
||||
If actived delete federation roles starting with the given prefix which
|
||||
does not exist on W.C.S. side.
|
||||
|
||||
--verbose
|
||||
|
||||
Display logs on console
|
||||
|
||||
--debug
|
||||
|
||||
Display logs on console and set log level to DEBUG
|
||||
PORTAIL_ADMIN_URL URL of the global administration portal
|
||||
|
|
|
@ -3,7 +3,9 @@ import sys
|
|||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
class AppSettings(object):
|
||||
__defaults = {}
|
||||
__defaults = {
|
||||
'PORTAIL_ADMIN_URL': None,
|
||||
}
|
||||
|
||||
def __init__(self, prefix):
|
||||
self.prefix = prefix
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
from . import app_settings
|
||||
|
||||
def template_vars(request):
|
||||
return app_settings.TEMPLATE_VARS
|
||||
ctx = app_settings.TEMPLATE_VARS.copy()
|
||||
if app_settings.PORTAIL_ADMIN_URL:
|
||||
ctx['PORTAIL_ADMIN_URL'] = app_settings.PORTAIL_ADMIN_URL
|
||||
return ctx
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
{% extends "admin/base.html" %}
|
||||
{% load i18n admin_tools_menu_tags %}
|
||||
|
||||
{% block title %}{{ title }} | {% trans 'Django site admin' %}{% endblock %}
|
||||
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
{% if user.is_active and user.is_staff %}
|
||||
{% if not is_popup %}
|
||||
{% admin_tools_render_menu_css %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block branding %}
|
||||
{% if PORTAIL_ADMIN_URL %}
|
||||
<h1 id="site-name"><a href="{{ PORTAIL_ADMIN_URL }}">{% trans 'Administration portal' %}</a></h1>
|
||||
{% else %}
|
||||
<h1 id="site-name">{% trans 'Django administration' %}</h1>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block nav-global %}
|
||||
{% if user.is_active and user.is_staff %}
|
||||
{% if not is_popup %}
|
||||
{% admin_tools_render_menu %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
Reference in New Issue