add sso login button and manage errors

This commit is contained in:
Jérôme Schneider 2014-06-03 18:48:47 +02:00
parent 93f8b55a86
commit dfc24ce026
3 changed files with 51 additions and 76 deletions

View File

@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-
import urllib
import re
from urlparse import parse_qs
from mandaye.log import logger
from mandaye.template import serve_template
def associate(env, values, request, response):
if response.msg and "<form" in response.msg:
@ -20,6 +22,19 @@ def associate(env, values, request, response):
response.msg = sub[0]
if sub[1] != 1:
logger.warning('Filter portail_famille_ecitiz.associate: submit replacement failed !')
qs = parse_qs(env['QUERY_STRING'])
if qs.has_key('type'):
values['type'] = qs['type'][0]
else:
values['type'] = None
sub = re.subn(
re.compile('<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="MessageErreur-champcalcule75-6T9N-Box".*?</div>', re.MULTILINE|re.DOTALL),
serve_template(values.get('template'), **values),
response.msg)
response.msg = sub[0]
if sub[1] != 1:
logger.warning('Filter portail_famille_ecitiz.associate: error msg replacement failed !')
return response
@ -29,11 +44,21 @@ def clean_js(env, values, request, response):
'', response.msg)
return response
def add_sso_login_box(env, values, request, response):
if response.msg and "egoSubmitMeConnecter_action133_6T9N" in response.msg:
sub = re.subn(r' value="Me connecter"/>',
' value="Me connecter"/><a href="/mandaye/sso" class="teamnetButtonValid teamnetButtonValidLeftToRight">Me connecter avec mon.meyzieu.fr</a>',
response.msg)
response.msg = sub[0]
if sub[1] != 1:
logger.warning('Filter portail_famille_ecitiz.sso_login_box failed !')
return response
def rewrite_logout_form(env, values, request, response):
if response.msg and 'egoSubmitMeDeconnecter_action220_6T9N' in response.msg:
response.msg = re.sub(
re.compile('</form>\n<form enctype="multipart/form-data".*?<input type="submit" name="egoSubmitMeDeconnecter_action220_6T9N".*?</form>', re.MULTILINE|re.DOTALL),
'<a href="/mandaye/slo"><input type="button" name="egoSubmitMeDeconnecter_action220_6T9N" class="egoLabelButtonGuidgetStyle egoLabelButtonGuidgetStyleLeftToRight" title="" value="Me deconnecter"></a>',
'<span style="display: block; padding: 0;" class="egoLabelButtonGuidgetStyle egoLabelButtonGuidgetStyleLeftToRight"><a href="/mandaye/slo" style="color: white;" >Me déconnecter</a></span>',
response.msg)
return response

View File

@ -69,7 +69,12 @@ mapping = [
'on_response': [{
'content-types': ['text/html'],
'filter': portail_famille_ecitiz.rewrite_logout_form
}],
},
{
'content-types': ['text/html'],
'filter': portail_famille_ecitiz.add_sso_login_box
},
],
},
{
'path': r'/ffaxsslMeyzieu/workflow_url$',
@ -77,7 +82,8 @@ mapping = [
'on_response': [{
'content-types': ['text/html'],
'filter': portail_famille_ecitiz.rewrite_logout_form
}]
},
]
},
{
'path': r'/ffaxsslMeyzieu/mandaye_associate$',

View File

@ -1,73 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="fr-FR" xml:lang="fr-FR" dir="ltr">
<head><title>AUCT : Accès à l'espace personnel&nbsp;-&nbsp;
Portail-Familles de la Ville de Meyzieu
</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="Author" lang="fr" content="christophe ASTIER"/><script src="ckeditor/ckeditor.js" type="text/javascript">var ne_pas_effacer;</script><meta http-equiv="Content-Language" content="fr-FR"/>
<style type="text/css">
@import url(GRChopiStyle.css);
@import url(GRChopiLayout.css);
@import url(AuctAcce_Etape39Style.css);
@import url(AuctAcce_Etape39Layout.css);
@import url(CSS_collectivites/meyzieu.css);
</style><script type="text/javascript" src="/ffaxsslMeyzieu/libraries/calendar.js"></script><script type="text/javascript" src="/ffaxsslMeyzieu/libraries/tooltip.js"></script><script type="text/javascript"> alert("Veuillez, s'il vous plaît, ne pas utiliser les boutons de l'historique de votre navigateur. Utilisez les boutons proposés dans l'interface de l'application."); </script><link rel="SHORTCUT ICON" href="img/favicon.ico"/></head><body><img src="img/look/bandeau transparent.gif" alt="bandeau" class="bandeauImage bandeauImageLeftToRight" id="achampcalculrkjgdfhjfge38"/><div id="ecitizWrapperWrapperDecoration"><div id="ecitizWrapper"><div id="ecitizHeaderWrapper"><div id="ecitizHeader">
</div><div id="ecitizHeaderRight">
&nbsp;
</div><div class="spacer separator">&nbsp;</div></div><div id="ecitizLeft">&nbsp;</div><div id="ecitizCenterWrapper"><script type="text/javascript">function pageEvent(component, eventName, anchorName){ component.form.egoPage.name=eventName;component.form.action=component.form.action + "#" + anchorName;component.form.submit();}function pageEventWithConfirm(component,message,anchorName){if(confirm(message)){pageEvent(component, component.name, anchorName);}}function pageEventWithConfirmAndName(component,message,name,anchorName){if(confirm(message)){pageEvent(component,name,anchorName);}}</script><form action="/mandaye/associate" method="post" name="eCitiz" accept-charset="UTF-8" enctype="multipart/form-data" ><input type="hidden" name="egoPage" value="" /><input type="hidden" name="workflow" value="643bf7756d2fb05802e9400ddd2dad91" /><input type="hidden" name="egoToken" value="16352c7edba3d745e24f0165e38eb861" /><div id="ecitizCenter"><div id="ecitizHeaderTagZone"/><div id="ecitizContent"><div class="egoGroupAroundStyle egoGroupAroundStyleLeftToRight" id="GroupePrincipal-groupe534-6T9N" ><div class="ecitizGroupColumnFor2ColumnsLeftVide ecitizGroupColumnFor2ColumnsLeftVideLeftToRight" id="GroupeLeft-groupe535-6T9N" ><div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="achampcalcule134-6T9N-Box">
<div class="eCitizPrimaryBox eCitizPrimaryBoxLeftToRight" id="achampcalcule134-6T9N-Primary-Box"><label class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" for="achampcalcule134-6T9N" id="achampcalcule134-6T9N-label"></label></div><span class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" title="" id="achampcalcule134-6T9N" ></span><div class="spacer">&nbsp;</div></div>
</div><div class="ecitizGroupColumnFor2ColumnsRightVide ecitizGroupColumnFor2ColumnsRightVideLeftToRight" id="GroupeRight-groupe536-6T9N" ><div class="fieldsetWrapper"><fieldset class="egoGroupAroundStyle egoGroupAroundStyleLeftToRight" id="Connexion-groupe511-6T9N" ><legend>Connexion</legend><div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="TexteChampsObligatoire-champcalcule15-6T9N-Box">
<span class="teamnetTexteInformatif teamnetTexteInformatifLeftToRight" title="" id="TexteChampsObligatoire-champcalcule15-6T9N" ></span><div class="spacer">&nbsp;</div></div>
<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="MessageErreur-champcalcule75-6T9N-Box">
<span class="teamnetChampErreurGris teamnetChampErreurGrisLeftToRight" title="" id="MessageErreur-champcalcule75-6T9N" ></span><div class="spacer">&nbsp;</div></div>
<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="MonIdentifiant-champcalcule6-Box">
<div class="eCitizPrimaryBox eCitizPrimaryBoxLeftToRight" id="MonIdentifiant-champcalcule6-Primary-Box"><label class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" for="MonIdentifiant-champcalcule6" id="MonIdentifiant-champcalcule6-label">Mon identifiant</label></div><input type="text" name="MonIdentifiant_champcalcule6" value="" class="teamnetChampSaisieMoyen teamnetChampSaisieMoyenLeftToRight" title="" size="20" id="MonIdentifiant-champcalcule6" /><span class="egoInfoStyle egoInfoStyleLeftToRight">*</span><span class="egoErrorStyle egoErrorStyleLeftToRight"></span><div class="spacer">&nbsp;</div></div>
<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="MonMotDePasse-champcalcule9-Box">
<div class="eCitizPrimaryBox eCitizPrimaryBoxLeftToRight" id="MonMotDePasse-champcalcule9-Primary-Box"><label class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" for="MonMotDePasse-champcalcule9" id="MonMotDePasse-champcalcule9-label">Mon mot de passe</label></div><input type="password" name="MonMotDePasse_champcalcule9" value="" class="teamnetChampSaisieMoyen teamnetChampSaisieMoyenLeftToRight" title="" size="20" id="MonMotDePasse-champcalcule9" /><span class="egoInfoStyle egoInfoStyleLeftToRight">*</span><span class="egoErrorStyle egoErrorStyleLeftToRight"></span><div class="spacer">&nbsp;</div></div>
<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="achampcalcule159-6T9N-Box">
<div class="eCitizPrimaryBox eCitizPrimaryBoxLeftToRight" id="achampcalcule159-6T9N-Primary-Box"><label class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" for="achampcalcule159-6T9N" id="achampcalcule159-6T9N-label"></label></div><span class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" title="" id="achampcalcule159-6T9N" ><br/></span><div class="spacer">&nbsp;</div></div>
<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="achampcalcule171-6T9N-Box">
<div class="eCitizPrimaryBox eCitizPrimaryBoxLeftToRight" id="achampcalcule171-6T9N-Primary-Box"><label class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" for="achampcalcule171-6T9N" id="achampcalcule171-6T9N-label"></label></div><span class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" title="" id="achampcalcule171-6T9N" ><br/></span><div class="spacer">&nbsp;</div></div>
<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="achampcalcule129-6T9N-Box">
<div class="eCitizPrimaryBox eCitizPrimaryBoxLeftToRight" id="achampcalcule129-6T9N-Primary-Box"><label class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" for="achampcalcule129-6T9N" id="achampcalcule129-6T9N-label"></label></div><span class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" title="" id="achampcalcule129-6T9N" ><br/></span><div class="spacer">&nbsp;</div></div>
<a href="/ffaxsslMeyzieu/workflow_url?egoCommandIdentifiantOuMotDePasseOublie_action266_6T9N=notused&amp;egoToken=16352c7edba3d745e24f0165e38eb861&amp;workflow=643bf7756d2fb05802e9400ddd2dad91" class="egoLinkGuidgetStyle" title="" >Identifiant ou mot de passe oubli&eacute; ?</a>
<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="achampcalcule193-6T9N-Box">
<div class="eCitizPrimaryBox eCitizPrimaryBoxLeftToRight" id="achampcalcule193-6T9N-Primary-Box"><label class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" for="achampcalcule193-6T9N" id="achampcalcule193-6T9N-label"></label></div><span class="eCitizPrimaryBoxRightToLeft eCitizPrimaryBoxRightToLeftLeftToRight" title="" id="achampcalcule193-6T9N" ><span class="egoErrorStyle egoErrorStyleLeftToRight">*</span> champs obligatoires</span><div class="spacer">&nbsp;</div></div>
</fieldset><div class="shadowBottomDecoration">&nbsp;</div></div><a name="egoSubmitMeConnecter_action133_6T9N"></a><input type="submit" name="egoSubmitMeConnecter_action133_6T9N" class="teamnetButtonValid teamnetButtonValidLeftToRight" title="" value="Me connecter"/>
<div class="TeamnetGroupeSansLibelle TeamnetGroupeSansLibelleLeftToRight" id="Informations-groupe625-6T9N" ><div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" id="areferencechamp497-6T9N-Box">
<div class="eCitizPrimaryBox eCitizPrimaryBoxLeftToRight" id="areferencechamp497-6T9N-Primary-Box"><label class="egoReadOnlyLabelRenderer egoReadOnlyLabelRendererLeftToRight" for="areferencechamp497-6T9N" id="areferencechamp497-6T9N-label"></label></div><span class="teamnetTexteInformatif teamnetTexteInformatifLeftToRight" title="" id="areferencechamp497-6T9N" >
<br /> Le navigateur SAFARI, les tablettes et les smartphones ne sont pas compatibles avec le portail famille.<br />
<br />
<br />
<br />
<br /> <b style="font-family: verdana, geneva, sans-serif">Bienvenue&nbsp; sur votre Portail Famille !</b><br />
<br /> <span style="font-family: verdana, geneva, sans-serif">Cet espace personnalis&eacute; vous permet d&#39;acc&eacute;der 24h/24 et 7j/7 &agrave; de nombreuses d&eacute;marches en ligne d&eacute;di&eacute;es &agrave; la famille (p&eacute;ri et extra-scolaire, petite enfance...) : modification de vos donn&eacute;es personnelles, paiement en ligne, consultation de vos factures, inscription de certaines activit&eacute;s, ...<br />
<br /> Lors de votre premi&egrave;re visite, nous vous invitons &agrave; v&eacute;rifier vos donn&eacute;es personnelles.<br />
<br /> <br />
<br /> <b><span style="font-family: verdana, geneva, sans-serif"><font color="#0c95da">Vous pouvez aussi simuler vos tarifs applicables aux activit&eacute;s en cliquant <a href="http://simulation.meyzieu.fr/" target="_blank">ICI</a>.</font></span></b></span><br />
<br /> <b><span style="font-family: verdana,geneva,sans-serif">Vous pouvez s&eacute;lectionner ci-dessous la d&eacute;marche que vous souhaitez accomplir. <span style="font-family: verdana, geneva, sans-serif"><span style="font-family: verdana, geneva, sans-serif">Mairie de Meyzieu - Place de l&#39;Europe - BP 122 - 69883 Meyzieu - 04 72 45 16 16&nbsp;</span></span></span></b></p></span><div class="spacer">&nbsp;</div></div>
</div></div></div><br class="spacer" /></div><div id="ecitizBottom"><div id="actions">
</div></div><div id="ecitizFooterTagZone"/></div></form><div class="spacer">&nbsp;</div></div><div id="ecitizFooterWrapper"><div id="ecitizFooter"><div id="ecitizFooterTop"><div class="AccessibilityValid">
&nbsp;&nbsp;<img src="img/look/wcag1AA.gif" alt="ok"/></div><div class="xhtmlValidArea">
&nbsp;&nbsp;<img src="img/look/valid-xhtml10.png" alt="Valid XHTML 1.0"/></div>
&nbsp;</div></div><div id="ecitizFooterBottom"><div id="ecitizFooterBottomLeft"><p/></div><div id="ecitizFooterBottomCenter"><p>
<span style="font-size: 10px"><span style="font-family: verdana, geneva, sans-serif"><span data-scayt_word="Conformément" data-scaytid="821">Conform&eacute;ment</span> <span data-scayt_word="à" data-scaytid="652">&agrave;</span> la <span data-scayt_word="loi" data-scaytid="825">loi</span> <span data-scayt_word="informatique" data-scaytid="827">informatique</span> et <span data-scayt_word="libertés" data-scaytid="828">libert&eacute;s</span> du 6 <span data-scayt_word="janvier" data-scaytid="829">janvier</span> 1978, <span data-scayt_word="toutes" data-scaytid="830">toutes</span> les <span data-scayt_word="données" data-scaytid="309">donn&eacute;es</span> <span data-scayt_word="informatiques" data-scaytid="832">informatiques</span> <span data-scayt_word="vous" data-scaytid="487">vous</span> <span data-scayt_word="concernant" data-scaytid="834">concernant</span> <span data-scayt_word="sont" data-scaytid="160">sont</span> <span data-scayt_word="traitées" data-scaytid="837">trait&eacute;es</span> de <span data-scayt_word="manière" data-scaytid="838">mani&egrave;re</span> <span data-scayt_word="strictement" data-scaytid="839">strictement</span> confidentielle.Les <span data-scayt_word="informations" data-scaytid="658">informations</span> <span data-scayt_word="enregistrées" data-scaytid="841">enregistr&eacute;es</span> <span data-scayt_word="dans" data-scaytid="312">dans</span> les <span data-scayt_word="fichiers" data-scaytid="843">fichiers</span> <span data-scayt_word="sont" data-scaytid="161">sont</span> <span data-scayt_word="destinées" data-scaytid="844">destin&eacute;es</span> <span data-scayt_word="exclusivement" data-scaytid="845">exclusivement</span> <span data-scayt_word="à" data-scaytid="653">&agrave;</span> la Ville de <span data-scayt_word="Meyzieu" data-scaytid="37">Meyzieu</span>. <span data-scayt_word="Conformément" data-scaytid="822">Conform&eacute;ment</span> aux dispositions de la <span data-scayt_word="loi" data-scaytid="826">loi</span> <span data-scayt_word="Informatique" data-scaytid="847">Informatique</span> et <span data-scayt_word="Liberté" data-scaytid="848">Libert&eacute;</span> </span></span></p>
</div><div id="ecitizFooterBottomRight"><p/></div></div><div class="spacer" id="footerSpacer">&nbsp;</div></div></div></div>
</body></html>
<p style="padding-left: 0;">
% if type == 'first':
C'est votre première connexion sur le portail famille via Mon Meyzieu.fr.
Merci de saisir vos identifiants du portail famille pour pouvoir l'associer avec votre compte Mon Meyzieu.fr.
% else:
Associer votre compte portail famille avec votre compte Mon Meyzieu.fr
% endif
</p>
<div class="egoContainerTableStyle egoContainerTableStyleLeftToRight" style="margin-bottom: 10px;" id="MessageErreur-champcalcule75-6T9N-Box">
<span class="teamnetChampErreurGris teamnetChampErreurGrisLeftToRight" title="" id="MessageErreur-champcalcule75-6T9N" >
% if type == 'badlogin':
Le mot de passe ou l'identifiant saisi est incorrect, vérifiez la syntaxe et réessayez
% endif
% if type == 'failed':
Vos identifiants pour le Portail Famille ne fonctionnent plus ! Merci de saisir le nouvelle identifiant
% endif
</span>