c5d0b45c13a99438609ab0f024565004e5483f65
[platal.git] / templates / core / password_prompt.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2008 Polytechnique.org                             *}
4 {*  http://opensource.polytechnique.org/                                  *}
5 {*                                                                        *}
6 {*  This program is free software; you can redistribute it and/or modify  *}
7 {*  it under the terms of the GNU General Public License as published by  *}
8 {*  the Free Software Foundation; either version 2 of the License, or     *}
9 {*  (at your option) any later version.                                   *}
10 {*                                                                        *}
11 {*  This program is distributed in the hope that it will be useful,       *}
12 {*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
13 {*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
14 {*  GNU General Public License for more details.                          *}
15 {*                                                                        *}
16 {*  You should have received a copy of the GNU General Public License     *}
17 {*  along with this program; if not, write to the Free Software           *}
18 {*  Foundation, Inc.,                                                     *}
19 {*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23 {if $referer || $platal->pl_self() neq 'login'}
24 <h1>
25   Accès restreint
26 </h1>
27 <p>
28   Bonjour,<br />
29   la page que vous avez demandée
30   (<strong>{if $referer}{$smarty.server.HTTP_REFERER}{else}{$globals->baseurl}/{$platal->pl_self()}{/if}</strong>)
31   nécessite une authentification.
32 </p>
33 {else}
34 <h1>
35   Accès réservé aux polytechniciens
36 </h1>
37 {/if}
38 {if $smarty.session.auth ge AUTH_COOKIE}
39 <p>
40 <strong>Merci de rentrer ton mot de passe pour démarrer une connexion au site.</strong>
41 Si tu n'es pas {insert name="getName"}, change le login ci-dessous, ou rends-toi sur
42 <a href="register/">la page d'inscription</a>.
43 </p>
44 {/if}
45
46 {if $smarty.request.response}<!-- failed login code //-->
47 {include core=triggers.tpl text="Erreur d'identification. Essaie à nouveau !" type="errors"}
48 <br />
49 {/if}
50
51 <form action="{$smarty.server.REQUEST_URI}" method="post" id="login" onsubmit="doChallengeResponse(); return false;" style="display: none">
52   <table class="bicol" cellpadding="4" summary="Formulaire de login">
53     <tr>
54       <th colspan="2">{if $smarty.server.HTTPS}{icon name=lock}{/if} Identification
55       {if !$smarty.server.HTTPS && #globals.core.secure_domain#}
56       (<a href="https://{#globals.core.secure_domain#}{$smarty.server.REQUEST_URI}">{icon name=lock_add} Passer en connexion sécurisée</a>)
57       {/if}
58       </th>
59     </tr>
60     <tr style="white-space: nowrap">
61       <td class="titre">
62         Adresse email&nbsp;:
63       </td>
64       <td>
65         <input type="text" name="username" size="20" maxlength="50" value="{insert name="getUserName"}" />&nbsp;@&nbsp;<select name="domain">
66           <option value="login">{#globals.mail.domain#} / {#globals.mail.domain2#}</option>
67           <option value="alias" {if $smarty.cookies.ORGdomain eq alias}selected="selected"{/if}>
68           {#globals.mail.alias_dom#} / {#globals.mail.alias_dom2#}
69           </option>
70           {$smarty.cookies.domain}
71         </select>
72       </td>
73     </tr>
74     <tr>
75       <td class="titre">
76         Mot de passe&nbsp;:
77       </td>
78       <td>
79         <input type="password" name="password" size="10" maxlength="256" />
80       </td>
81     </tr>
82     <tr>
83       <td></td>
84       <td>
85         <script type="text/javascript">{literal}
86           function confirm_remember(input) {
87             if (input.checked && !confirm('Cocher cette case te permet d\'être automatiquement reconnu à ta prochaine connexion depuis cet ordinateur. '
88             + 'Il n\'est pas conseillé de cocher la case si cette machine n\'est pas strictement personnelle.\n\nVeux-tu vraiment cocher cette case ?')) {
89               input.checked = false;
90               return false;
91             }
92             return true;
93           }
94         {/literal}</script>
95         <input type="checkbox" name="remember" id="remember" onchange="return confirm_remember(this);" /><label for="remember">Garder l'accès aux services après déconnexion.</label>
96       </td>
97     </tr>
98     <tr>
99       <td colspan="2">
100       <table width="100%"><tr>
101       <td>
102         <a href="recovery">Mot de passe perdu ?</a>
103       </td>
104       <td class="right">
105         <input type="submit" name="submitbtn" value="Me connecter" />
106       </td>
107       </tr></table>
108       </td>
109     </tr>
110   </table>
111 </form>
112
113 {if !$smarty.session.auth}
114 <p>
115 <strong>Tu ne connais pas ton mot de passe ?</strong>
116 </p>
117 <ul>
118   <li>
119   Si tu viens de terminer ta pré-inscription, <strong>il est dans l'email</strong> que
120   nous t'avons envoyé (expéditeur pre-inscription@{#globals.mail.domain#}).
121   </li>
122   <li>
123   Si tu n'es jamais venu sur le site, <strong>il faut t'enregistrer auprès de
124     nous</strong> pour obtenir un accès. {#globals.core.sitename#} c'est l'email des X,
125   l'annuaire en ligne, plus un tas d'autres services.  Nous te fournirons un accès le plus
126   rapidement possible. <strong> <a href="register/">Clique ici pour nous demander tes
127       paramètres personnels.</a></strong>
128   </li>
129 </ul>
130 {/if}
131
132 <div id="nologin" style="background: #fcc; color: red">
133   Pour assurer la confidentialité de ton mot de passe, il est chiffré sur ta machine
134   avant de nous être transmis. Pour cela, il faut
135   <a href="Xorg/FAQ?display=light#connect" class="popup2">activer javascript</a>
136   dans ton navigateur, ce qui n'est actuellement pas le cas.
137   <div class="center" style="margin-top: 1ex">
138     <strong>Active le javascript et recharge cette page pour pouvoir te connecter.</strong>
139   </div>
140 </div>
141
142 <p>     
143   <strong>Problème de connexion ?</strong> <a href="Xorg/FAQ?display=light#connect" class="popup2">La réponse est là.</a>
144 </p>
145
146 <script type="text/javascript">
147   document.getElementById('login').style.display="";
148   document.getElementById('nologin').style.display="none";
149 </script>
150
151 <hr />
152
153 <div class="smaller">
154   {if $smarty.server.HTTPS}
155   {icon name=lock} Tu utilises actuellement une connexion HTTPS sécurisée. Aucune information ne circule
156   en clair entre chez toi et Polytechnique.org, ce qui assure une confidentialité maximale.
157   {else}
158   {icon name=lock_open} Tu utilises actuellement une connexion HTTP non sécurisée. Toutes les informations
159   (<strong>excepté le mot de passe de connexion au site</strong>) circulent en clair entre chez toi et 
160   Polytechnique.org. Tu peux basculer sur une connexion sécurisée en cliquant sur le lien
161   <div class="center">
162   <a href="https://{#globals.core.secure_domain#}{$smarty.server.REQUEST_URI}">
163     {icon name=lock_add} Passer en connexion sécurisée</a>
164   </div><br />
165   Plus d'informations sur la connexion sécurisée se trouvent
166   <a href="Xorg/CertificatDeSécurité?display=light" class="popup2">sur cette page</a>.
167   {/if}
168 </div>
169
170 <!-- Set up the form with the challenge value and an empty reply value //-->
171 <form action="{$smarty.server.REQUEST_URI}" method="post" id="loginsub">
172   <div>
173     {xsrf_token_field}
174     <input type="hidden" name="challenge" value="{$smarty.session.challenge}" />
175     <input type="hidden" name="response"  value="" />
176     <input type="hidden" name="xorpass"  value="" />
177     <input type="hidden" name="username"  value="" />
178     <input type="hidden" name="remember"  value="" />
179     <input type="hidden" name="domain"    value="" />
180   </div>
181 </form>
182
183 {literal}
184 <script type="text/javascript">
185   <!--
186   // Activate the appropriate input form field.
187   if (document.forms.login.username.value == '') {
188     document.forms.login.username.focus();
189   } else {
190     document.forms.login.password.focus();
191   }
192   // -->
193 </script>
194 {/literal}
195
196 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}