Révision 80bce782
Ajouté par Jérôme Schneider il y a plus de 12 ans
mandaye/configs/biblio_vincennes.py | ||
---|---|---|
104 | 104 |
'values': { |
105 | 105 |
'connection_url': '/mandaye/connection', |
106 | 106 |
'template': 'biblio/login.html', |
107 |
'title': 'Connexion via votre compte citoyen', |
|
108 |
'msg': "En cliquant sur le lien ci-dessous, vous vous connecterez " + \ |
|
109 |
"en utilisant votre compte citoyen créé sur " + \ |
|
110 |
"le site vincennes.fr. Pour plus d'information, " + \ |
|
111 |
"<a href=\"http://test.vincennes.fr/Vos-demarches/Compte-citoyen/Aide\" " + \ |
|
112 |
"target=\"_blank\">cliquer ici</a>." |
|
107 |
'title': 'Connexion via votre compte citoyen' |
|
113 | 108 |
} |
114 | 109 |
}] |
115 | 110 |
}, |
mandaye/configs/duonet_vincennes.py | ||
---|---|---|
117 | 117 |
'values': { |
118 | 118 |
'connection_url': '/vincennes/connection', |
119 | 119 |
'template': 'duonet/login.html', |
120 |
'msg': "En cliquant sur le lien ci-dessous, vous vous connecterez " + \ |
|
121 |
"<br />en utilisant votre compte citoyen créé sur " + \ |
|
122 |
"le site vincennes.fr.<br />Pour plus d'information, " + \ |
|
123 |
"<a href=\"http://test.vincennes.fr/Vos-demarches/Compte-citoyen/Aide\" " + \ |
|
124 |
"target=\"_blank\">cliquer ici</a>." |
|
125 | 120 |
} |
126 | 121 |
}] |
127 | 122 |
}, |
... | ... | |
134 | 129 |
'values': { |
135 | 130 |
'connection_url': '/vincennes/connection', |
136 | 131 |
'template': 'duonet/login.html', |
137 |
'msg': "En cliquant sur le lien ci-dessous, vous vous connecterez " + \ |
|
138 |
"<br />en utilisant votre compte citoyen créé sur " + \ |
|
139 |
"le site vincennes.fr.<br />Pour plus d'information, " + \ |
|
140 |
"<a href=\"http://test.vincennes.fr/Vos-demarches/Compte-citoyen/Aide\" " + \ |
|
141 |
"target=\"_blank\">cliquer ici</a>." |
|
142 | 132 |
} |
143 | 133 |
}] |
144 | 134 |
}, |
mandaye/configs/famille_vincennes.py | ||
---|---|---|
80 | 80 |
}] |
81 | 81 |
}, |
82 | 82 |
{ |
83 |
'path': r'%s/index.do$' % folder_target,
|
|
83 |
'path': (r'%s/index.do$' % folder_target, r'%s/deconnexion.do$' % folder_target),
|
|
84 | 84 |
'method': 'GET', |
85 | 85 |
'on_response': [{ |
86 | 86 |
'filter': filters.resp_login_page, |
87 | 87 |
'values': { |
88 | 88 |
'connection_url': '/mandaye/connection', |
89 | 89 |
'template': 'famille/login.html', |
90 |
'title': 'Connexion via votre compte citoyen', |
|
91 |
'msg': "En cliquant sur le lien ci-dessous, vous vous connecterez " + \ |
|
92 |
"en utilisant votre compte citoyen créé sur " + \ |
|
93 |
"le site vincennes.fr.<br />Pour plus d'information, " + \ |
|
94 |
"<a href=\"http://test.vincennes.fr/Vos-demarches/Compte-citoyen/Aide\" " + \ |
|
95 |
"target=\"_blank\">cliquer ici</a>." |
|
96 |
} |
|
97 |
}] |
|
98 |
}, |
|
99 |
{ |
|
100 |
'path': r'%s/deconnexion.do$' % folder_target, |
|
101 |
'method': 'GET', |
|
102 |
'on_response': [{ |
|
103 |
'filter': filters.resp_login_page, |
|
104 |
'values': { |
|
105 |
'connection_url': '/mandaye/connection', |
|
106 |
'template': 'famille/login.html', |
|
107 |
'title': 'Connexion via votre compte citoyen', |
|
108 |
'msg': "En cliquant sur le lien ci-dessous, vous vous connecterez " + \ |
|
109 |
"en utilisant votre compte citoyen créé sur " + \ |
|
110 |
"le site vincennes.fr.<br />Pour plus d'information, " + \ |
|
111 |
"<a href=\"http://test.vincennes.fr/Vos-demarches/Compte-citoyen/Aide\" " + \ |
|
112 |
"target=\"_blank\">cliquer ici</a>." |
|
90 |
'title': 'Connexion via votre compte citoyen' |
|
113 | 91 |
} |
114 | 92 |
}] |
115 | 93 |
}, |
mandaye/dispatcher.py | ||
---|---|---|
44 | 44 |
self.filter = MandayeFilter(self.env, self.target) |
45 | 45 |
self.req_mapping = self._parse_mapping(self.mapping) |
46 | 46 |
|
47 |
def __get_mappings_hooks(self, mapper, req_mapping): |
|
48 |
""" fill the request mapping with the right hooks |
|
49 |
return req_mapping |
|
50 |
""" |
|
51 |
if not mapper.has_key('method') or \ |
|
52 |
mapper['method'] == self.env['REQUEST_METHOD']: |
|
53 |
for hookname in req_mapping: |
|
54 |
if mapper.has_key(hookname): |
|
55 |
if isinstance(req_mapping[hookname], list): |
|
56 |
req_mapping[hookname].extend(mapper[hookname]) |
|
57 |
else: |
|
58 |
req_mapping[hookname] = mapper[hookname] |
|
59 |
return req_mapping |
|
60 |
|
|
61 |
|
|
47 | 62 |
def _parse_mapping(self, mapping): |
48 | 63 |
""" parse the mapping on every request |
49 | 64 |
""" |
65 |
if not mapping: |
|
66 |
return req_mapping |
|
67 |
|
|
50 | 68 |
req_mapping = { |
51 | 69 |
'on_request': [], |
52 | 70 |
'on_response': [], |
... | ... | |
55 | 73 |
'redirect': None, |
56 | 74 |
} |
57 | 75 |
|
58 |
if not mapping: |
|
59 |
return req_mapping |
|
60 |
|
|
61 |
for conf in mapping: |
|
62 |
if conf.has_key('path') and \ |
|
63 |
re.match(conf['path'], self.env['PATH_INFO']): |
|
64 |
if not conf.has_key('method') \ |
|
65 |
or conf['method'] == self.env['REQUEST_METHOD']: |
|
66 |
for hookname in req_mapping: |
|
67 |
if conf.has_key(hookname): |
|
68 |
if isinstance(req_mapping[hookname], list): |
|
69 |
req_mapping[hookname].extend(conf[hookname]) |
|
70 |
else: |
|
71 |
req_mapping[hookname] = conf[hookname] |
|
76 |
for mapper in mapping: |
|
77 |
if mapper.has_key('path'): |
|
78 |
if isinstance(mapper['path'], str): |
|
79 |
if re.match(mapper['path'], self.env['PATH_INFO']): |
|
80 |
req_mapping = self.__get_mappings_hooks(mapper, req_mapping) |
|
81 |
else: |
|
82 |
for path in mapper['path']: |
|
83 |
if re.match(path, self.env['PATH_INFO']): |
|
84 |
req_mapping = self.__get_mappings_hooks(mapper, req_mapping) |
|
85 |
else: |
|
86 |
logging.warning('Config error: you need to specify paths in your mapping') |
|
72 | 87 |
return req_mapping |
73 | 88 |
|
74 | 89 |
def _call_hook(self, hook, *args): |
mandaye/templates/biblio/login.html | ||
---|---|---|
5 | 5 |
|
6 | 6 |
<div class="content"> |
7 | 7 |
<center> |
8 |
% if msg: |
|
9 |
<p>${msg}</p> |
|
10 |
% endif |
|
8 |
<p> |
|
9 |
En cliquant sur le lien ci-dessous, vous vous connecterez en utilisant |
|
10 |
votre compte citoyen créé sur le site vincennes.fr. Pour plus d'information, |
|
11 |
<a href="http://test.vincennes.fr/Vos-demarches/Compte-citoyen/Aide" target="_blank">cliquer ici</a>. |
|
12 |
</p> |
|
11 | 13 |
<a href="${connection_url}"><input type="button" value="Se connecter"></input></a> |
12 | 14 |
</center> |
13 | 15 |
</div> |
mandaye/templates/duonet/login.html | ||
---|---|---|
12 | 12 |
<tr> |
13 | 13 |
<td> |
14 | 14 |
<h3 style="margin:0 0 5px 0; padding:0;">Connexion via le compte citoyen</h3> |
15 |
${msg} |
|
15 |
En cliquant sur le lien ci-dessous, vous vous connecterez |
|
16 |
<br />en utilisant votre compte citoyen créé sur le site vincennes.fr.<br />Pour plus d'information, |
|
17 |
<a href="http://test.vincennes.fr/Vos-demarches/Compte-citoyen/Aide" target="_blank">cliquer ici</a>. |
|
16 | 18 |
</td> |
17 | 19 |
</tr> |
18 | 20 |
<tr> |
mandaye/templates/famille/login.html | ||
---|---|---|
1 | 1 |
<div class="bloc-model-1"> |
2 | 2 |
<h2>${title}</h2> |
3 | 3 |
<div class="bloc-gris" style='text-align:center'> |
4 |
<div style='margin-bottom:8px'>${msg}</div> |
|
4 |
<div style='margin-bottom:8px'> |
|
5 |
En cliquant sur le lien ci-dessous, vous vous connecterez en utilisant votre |
|
6 |
compte citoyen créé sur le site vincennes.fr. |
|
7 |
<br />Pour plus d'information, <a href=\"http://test.vincennes.fr/Vos-demarches/Compte-citoyen/Aide" target="_blank">cliquer ici</a>. |
|
8 |
</div> |
|
5 | 9 |
<a href="${connection_url}"><input type="button" value="Se connecter"></input></a> |
6 | 10 |
</div> |
7 | 11 |
</div> |
Formats disponibles : Unified diff
Fix #777 (manage muli paths) and move some messages from the config to
the templates