Merge branch 'platal-0.10.0'
authorVincent Zanotti <vincent.zanotti@m4x.org>
Wed, 17 Jun 2009 21:02:31 +0000 (23:02 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Wed, 17 Jun 2009 21:02:31 +0000 (23:02 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
483 files changed:
AUTHORS
ChangeLog
Makefile
bin/check_security_fixes.py [new file with mode: 0755]
bin/connect.db.inc.php
bin/cron/axletter.send.php
bin/cron/checkdb.php
bin/cron/clean.php
bin/cron/cron_ml_moderate.php
bin/cron/cron_validations.php
bin/cron/emails.check.php
bin/cron/google_apps.php
bin/cron/homonymes.php
bin/cron/notifs.birthday.php
bin/cron/notifs.send.php
bin/csv2sql.php
bin/devel/xhtml.classes.pl
bin/devel/xhtml.validate.pl
bin/emails.broken.helper.php
bin/emails.broken.php
bin/lists.rpc.py
bin/newsletter.bounces.processor.py
bin/newsletter.send.php
bin/search.rebuild_db.php
classes/platalglobals.php.in
classes/platallogger.php
classes/user.php
classes/xnet.php
classes/xnetpage.php
classes/xnetsession.php
classes/xorg.php
classes/xorgpage.php
classes/xorgsession.php
core
htdocs/css/ax.css
htdocs/css/bandeau.css
htdocs/css/base.css
htdocs/css/default.css
htdocs/css/espace.css
htdocs/css/humlinux.css
htdocs/css/igoogle.css
htdocs/css/keynote.css
htdocs/css/linux.css
htdocs/css/liteskin.css
htdocs/css/nbviolet.css
htdocs/css/newxorg.css
htdocs/css/nl.css
htdocs/css/oldtimes.css
htdocs/css/openweb.css
htdocs/css/sharky.css
htdocs/css/spectral.css
htdocs/css/trapped.css
htdocs/css/xnet.css
htdocs/images/medals/eufor.jpg [new file with mode: 0644]
htdocs/images/medals/onorificenza_quadro.jpg [new file with mode: 0644]
htdocs/javascript/ajax.js
htdocs/javascript/close_on_esc.js
htdocs/javascript/do_challenge_response.js
htdocs/javascript/do_challenge_response_logged.js
htdocs/javascript/igoogle.js
htdocs/javascript/motdepasse.js
htdocs/javascript/profile.js
htdocs/javascript/secure_hash.js
htdocs/javascript/wiki.js
htdocs/javascript/xorg.js
htdocs/listes_redirect.php
htdocs/webredirect.php
htdocs/xnet.php
htdocs/xorg.php
include/applis.func.inc.php
include/banana/forum.inc.php
include/banana/hooks.inc.php
include/banana/ml.inc.php
include/banana/moderate.inc.php
include/common.inc.php
include/emails.inc.php
include/geoloc.inc.php
include/googleapps.inc.php
include/homonymes.inc.php
include/ical.inc.php
include/marketing.inc.php
include/massmailer.inc.php
include/newsletter.inc.php
include/notifs.inc.php
include/profil.func.inc.php
include/reminder.inc.php [new file with mode: 0644]
include/reminder/ax_letter.inc.php [new file with mode: 0644]
include/reminder/email_backup.inc.php [new file with mode: 0644]
include/reminder/email_warning.inc.php [new file with mode: 0644]
include/reminder/gapps.inc.php [new file with mode: 0644]
include/reminder/ml.inc.php [new file with mode: 0644]
include/reminder/nl.inc.php [new file with mode: 0644]
include/reminder/no_redirection.inc.php [new file with mode: 0644]
include/reminder/profile_update.inc.php [new file with mode: 0644]
include/reminder/promotion_ml.inc.php [new file with mode: 0644]
include/rss.inc.php
include/secure_hash.inc.php
include/security.inc.php
include/synchro_ax.inc.php
include/user.func.inc.php
include/userset.inc.php
include/validations.inc.php
include/validations/aliases.inc.php
include/validations/broken.inc.php
include/validations/evts.inc.php
include/validations/googleapps.inc.php
include/validations/homonymes.inc.php
include/validations/listes.inc.php
include/validations/marketing.inc.php
include/validations/medals.inc.php
include/validations/nl.inc.php
include/validations/nomusage.inc.php
include/validations/orange.inc.php
include/validations/paiements.inc.php
include/validations/photos.inc.php
include/validations/surveys.inc.php
include/vcard.inc.php
include/webservices/manageurs.inc.php
include/xnet.inc.php
include/xorg.inc.php
modules/admin.php
modules/auth.php
modules/auth/auth.inc.php
modules/axletter.php
modules/axletter/axletter.inc.php
modules/bandeau.php
modules/carnet.php
modules/carnet/contacts.pdf.inc.php
modules/carnet/feed.inc.php
modules/email.php
modules/events.php
modules/events/feed.inc.php
modules/forums.php
modules/gadgets.php
modules/gadgets/gadgets.inc.php
modules/geoloc.php
modules/googleapps.php
modules/lists.php
modules/lists/lists.inc.php
modules/lists/mail_templates/accept.txt [new file with mode: 0644]
modules/marketing.php
modules/newsletter.php
modules/openid.php
modules/openid/openid.inc.php
modules/payment.php
modules/payment/money.inc.php
modules/payment/money/cyberpaiement.inc.php
modules/payment/money/paypal.inc.php
modules/platal.php
modules/platal/review.inc.php
modules/poison.php
modules/poison/poison.inc.php
modules/profile.php
modules/profile/addresses.inc.php
modules/profile/decos.inc.php
modules/profile/general.inc.php
modules/profile/groups.inc.php
modules/profile/jobs.inc.php
modules/profile/mentor.inc.php
modules/profile/page.inc.php
modules/profile/skills.inc.php
modules/register.php
modules/register/register.inc.php
modules/reminder.php [new file with mode: 0644]
modules/search.php
modules/search/classes.inc.php
modules/search/search.inc.php
modules/stats.php
modules/survey.php
modules/survey/survey.inc.php
modules/xnet.php
modules/xnetevents.php
modules/xnetevents/xnetevents.inc.php
modules/xnetgrp.php
modules/xnetgrp/feed.inc.php
modules/xnetgrp/mail.inc.php
modules/xnetlists.php
plugins/function.display_address.php
plugins/function.geoloc_country.php
plugins/function.geoloc_region.php
plugins/function.poison.php
plugins/function.select_nat.php
plugins/function.test_email.php
plugins/insert.getName.php
plugins/insert.getUserName.php
templates/admin/accounts.tpl
templates/admin/ax-xorg.tpl
templates/admin/dead_but_active.tpl
templates/admin/deces_promo.tpl
templates/admin/emails_bounces_re.tpl
templates/admin/forums-promo.mail.tpl
templates/admin/homonymes.tpl
templates/admin/icons.tpl
templates/admin/index.tpl
templates/admin/ipwatcher.tpl
templates/admin/logger-view.tpl
templates/admin/postfix_delayed.tpl
templates/admin/promo.tpl
templates/admin/synchro_ax.tpl
templates/admin/useredit.mail.tpl
templates/admin/utilisateurs.tpl
templates/admin/valider.tpl
templates/admin/wiki.tpl
templates/axletter/admin.tpl
templates/axletter/edit.tpl
templates/axletter/index.tpl
templates/axletter/letter.mail.tpl
templates/axletter/show.tpl
templates/axletter/unsubscribe.tpl
templates/banana/index.tpl
templates/carnet/calendar.tpl
templates/carnet/index.tpl
templates/carnet/mescontacts.tpl
templates/carnet/notif.mail.tpl
templates/carnet/notifs.tpl
templates/carnet/panel.tpl
templates/carnet/rss.tpl
templates/carnet/tricontacts.tpl
templates/core/password_prompt.tpl
templates/core/password_prompt_logged.tpl
templates/emails/alias.tpl
templates/emails/antispam.tpl
templates/emails/broken.mail.tpl
templates/emails/broken.tpl
templates/emails/duplicated.tpl
templates/emails/imap_register.tpl
templates/emails/index.tpl
templates/emails/lost.tpl
templates/emails/redirect.tpl
templates/emails/rewrite-in.mail.tpl
templates/emails/rewrite.tpl
templates/emails/send.tpl
templates/emails/submit_spam.tpl
templates/emails/test.mail.tpl
templates/events/admin.tpl
templates/events/admin_tips.tpl
templates/events/form.tpl
templates/events/index.tpl
templates/events/preview.tpl
templates/events/submit.tpl
templates/forums/admin.tpl
templates/gadgets/ig-events.tpl
templates/gadgets/ig-events.xml.tpl
templates/gadgets/ig-login.tpl
templates/gadgets/ig-minifiche.tpl
templates/gadgets/ig-search.tpl
templates/gadgets/ig-search.xml.tpl
templates/gadgets/ig-skin.tpl
templates/geoloc/address.tpl
templates/geoloc/admin.tpl
templates/geoloc/admin_dynamap.tpl
templates/geoloc/city.tpl
templates/geoloc/country.tpl
templates/geoloc/form.address.tpl
templates/geoloc/geoloc.mail.tpl
templates/geoloc/init.tpl
templates/googleapps/admin.job.tpl
templates/googleapps/admin.tpl
templates/googleapps/admin.user.tpl
templates/googleapps/create.mail.tpl
templates/googleapps/index.tpl
templates/googleapps/unsuspend.mail.tpl
templates/include/emploi.tpl
templates/include/field.promo.tpl
templates/include/field.select.tpl
templates/include/flags.radio.tpl
templates/include/form.valid.aliases.tpl
templates/include/form.valid.broken.tpl
templates/include/form.valid.edit-evts.tpl
templates/include/form.valid.edit-listes.tpl
templates/include/form.valid.edit-nl.tpl
templates/include/form.valid.edit-paiements.tpl
templates/include/form.valid.edit-photo.tpl
templates/include/form.valid.evts.tpl
templates/include/form.valid.gapps-unsuspend.tpl
templates/include/form.valid.homonymes.tpl
templates/include/form.valid.listes.tpl
templates/include/form.valid.mark.tpl
templates/include/form.valid.medals.tpl
templates/include/form.valid.nl.tpl
templates/include/form.valid.nomusage.tpl
templates/include/form.valid.orange.tpl
templates/include/form.valid.paiements.tpl
templates/include/form.valid.photos.tpl
templates/include/form.valid.surveys.tpl
templates/include/massmailer-nav.tpl
templates/include/minifiche.tpl
templates/include/plview.geoloc.tpl
templates/include/plview.minifiche.tpl
templates/include/plview.referent.tpl
templates/include/plview.trombi.tpl
templates/include/tips.tpl
templates/include/trombi.tpl
templates/lists/admin.tpl
templates/lists/admin_all.tpl
templates/lists/annu.tpl
templates/lists/archives.tpl
templates/lists/check.tpl
templates/lists/create.tpl
templates/lists/delete.tpl
templates/lists/header_listes.tpl
templates/lists/index.tpl
templates/lists/liste.inc.tpl
templates/lists/listes.inc.tpl
templates/lists/members.tpl
templates/lists/moderate.tpl
templates/lists/moderate_mail.tpl
templates/lists/moderate_sub.tpl
templates/lists/options.tpl
templates/lists/soptions.tpl
templates/marketing/broken.tpl
templates/marketing/index.tpl
templates/marketing/marketing.mail.tpl
templates/marketing/private.tpl
templates/marketing/promo.tpl
templates/marketing/public.tpl
templates/marketing/relance.mail.tpl
templates/marketing/relance.tpl
templates/marketing/this_week.tpl
templates/marketing/volontaire.tpl
templates/newsletter/admin.tpl
templates/newsletter/edit.tpl
templates/newsletter/index.tpl
templates/newsletter/nl.mail.tpl
templates/newsletter/show.tpl
templates/newsletter/submit.tpl
templates/openid/idp_xrds.tpl
templates/openid/openid.tpl
templates/openid/trust.tpl
templates/openid/user_xrds.tpl
templates/payment/index.tpl
templates/payment/retour_paypal.tpl
templates/payment/xnet.tpl
templates/platal/acces_smtp.tpl
templates/platal/changeLog.tpl
templates/platal/exit.tpl
templates/platal/filrss.tpl
templates/platal/index.tpl
templates/platal/motdepasse.success.tpl
templates/platal/motdepasse.tpl
templates/platal/preferences.tpl
templates/platal/recovery.tpl
templates/platal/review.tpl
templates/platal/skins.tpl
templates/platal/tmpPWD.success.tpl
templates/platal/webredirect.tpl
templates/profile/admin_decos.tpl
templates/profile/admin_trombino.tpl
templates/profile/adresses.address.tpl
templates/profile/adresses.tel.tpl
templates/profile/adresses.tpl
templates/profile/applis.js.tpl
templates/profile/base.tpl
templates/profile/deco.medal.tpl
templates/profile/deco.tpl
templates/profile/fiche_referent.tpl
templates/profile/general.tpl
templates/profile/grades.js.tpl
templates/profile/groupesx.tpl
templates/profile/groups.tpl
templates/profile/jobs.job.tpl
templates/profile/jobs.secteur.tpl
templates/profile/jobs.tpl
templates/profile/mentor.tpl
templates/profile/nomusage.tpl
templates/profile/orange.tpl
templates/profile/profile.tpl
templates/profile/referent.tpl
templates/profile/skill.skill.tpl
templates/profile/skill.tpl
templates/profile/trombino.tpl
templates/register/breadcrumb.tpl
templates/register/end.tpl
templates/register/inscription.reussie.tpl
templates/register/inscrire.mail.tpl
templates/register/step0.tpl
templates/register/step1.tpl
templates/register/step2.tpl
templates/register/step3.tpl
templates/register/step4.tpl
templates/register/success.tpl
templates/reminder/base.tpl [new file with mode: 0644]
templates/reminder/email_warning.tpl [new file with mode: 0644]
templates/reminder/ml.tpl [new file with mode: 0644]
templates/reminder/no_redirection.tpl [new file with mode: 0644]
templates/reminder/profile_update.tpl [new file with mode: 0644]
templates/search/adv.form.tpl
templates/search/adv.grade.form.tpl
templates/search/adv.links.tpl
templates/search/index.tpl
templates/search/quick.form.tpl
templates/search/quick.tpl
templates/skin/common.bandeau.head.tpl
templates/skin/common.bandeau.tpl
templates/skin/common.doctype.tpl
templates/skin/common.footer.tpl
templates/skin/common.header.tpl
templates/skin/common.menu.tpl
templates/skin/common.title.header.tpl
templates/skin/default.tpl
templates/skin/espace.tpl
templates/skin/humlinux.tpl
templates/skin/keynote.tpl
templates/skin/linux.tpl
templates/skin/liteskin.tpl
templates/skin/nbviolet.tpl
templates/skin/newxorg.tpl
templates/skin/oldtimes.tpl
templates/skin/openweb.tpl
templates/skin/register.tpl
templates/skin/sharky.tpl
templates/skin/spectral.tpl
templates/skin/trapped.tpl
templates/stats/coupure.tpl
templates/stats/evolution_inscrits.tpl
templates/stats/index.tpl
templates/stats/nb_by_promo.tpl
templates/stats/profile.tpl
templates/survey/admin.tpl
templates/survey/confirm.tpl
templates/survey/edit_checkbox.tpl
templates/survey/edit_checkboxtable.tpl
templates/survey/edit_new.tpl
templates/survey/edit_newsurvey.tpl
templates/survey/edit_num.tpl
templates/survey/edit_question.tpl
templates/survey/edit_radio.tpl
templates/survey/edit_radiotable.tpl
templates/survey/edit_root.tpl
templates/survey/edit_survey.tpl
templates/survey/edit_text.tpl
templates/survey/edit_textarea.tpl
templates/survey/error.tpl
templates/survey/index.tpl
templates/survey/show_checkbox.tpl
templates/survey/show_checkboxtable.tpl
templates/survey/show_num.tpl
templates/survey/show_question.tpl
templates/survey/show_radio.tpl
templates/survey/show_radiotable.tpl
templates/survey/show_root.tpl
templates/survey/show_text.tpl
templates/survey/show_textarea.tpl
templates/survey/success.tpl
templates/xnet/admin.tpl
templates/xnet/deconnexion.tpl
templates/xnet/groupes.tpl
templates/xnet/include/descr.tpl
templates/xnet/index.tpl
templates/xnet/plan.tpl
templates/xnet/skin.tpl
templates/xnetevents/admin.tpl
templates/xnetevents/calendar.tpl
templates/xnetevents/csv.tpl
templates/xnetevents/edit.tpl
templates/xnetevents/index.tpl
templates/xnetevents/newpayment.mail.tpl
templates/xnetevents/subscribe.tpl
templates/xnetgrp/announce-admin.tpl
templates/xnetgrp/announce-edit.tpl
templates/xnetgrp/annuaire-admin.tpl
templates/xnetgrp/annuaire-csv.tpl
templates/xnetgrp/annuaire.tpl
templates/xnetgrp/asso.tpl
templates/xnetgrp/edit.tpl
templates/xnetgrp/form.announce.tpl
templates/xnetgrp/forum.tpl
templates/xnetgrp/inscrire.tpl
templates/xnetgrp/mail.tpl
templates/xnetgrp/membres-add.tpl
templates/xnetgrp/membres-del.tpl
templates/xnetgrp/membres-edit.tpl
templates/xnetgrp/membres-new-search.tpl
templates/xnetgrp/subscribe-valid.tpl
templates/xnetgrp/unsubscription-notif.mail.tpl
templates/xnetlists/alias-admin.tpl
templates/xnetlists/alias-create.tpl
templates/xnetlists/create.tpl
templates/xnetlists/index.tpl
templates/xnetlists/sync.tpl
upgrade/0.10.1/00_inscription.sql [new file with mode: 0644]
upgrade/0.10.1/01_groupex.sql [new file with mode: 0644]
upgrade/0.9.16/connect.db.inc.php

diff --git a/AUTHORS b/AUTHORS
index ff5290b..095d849 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -9,11 +9,13 @@ Polytechnique.org TEAM :
     Jean-Marc Coic          <jean-marc.coic@m4x.org>
     Pascal Corpet           <pascal.corpet@m4x.org>
     Guillaume Gommard       <guillaume.gommard@m4x.org>
+    Stéphane Jacob          <stephane.jacob@m4x.org>
     Fabien Laborde          <fabien.laborde@m4x.org>
     Jeremy Lainé            <jeremy.laine@m4x.org>
     Olivier Le Floch        <olivier.le-floch@m4x.org>
     Raphael Marichez        <raphael.marichez@m4x.org>
     Vincent Palatin         <vincent.palatin@m4x.org>
+    Vincent Zanotti         <vincent.zanotti@m4x.org>
 
 
 XML-RPC stuff :
index dc8d558..4b9bcb4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,22 @@
 ================================================================================
+VERSION 0.10.1                                                        XX XX XXXX
+
+From 0.10.0 branch:
+
+    * Auth:
+        - Fix use of deprecated PlLogger in password recovery              -JAC
+
+    * Lists:
+        - #942: Fix missing MLs in ML listing                              -FRU
+        - #943: Fix adding member to a list                                -FRU
+
+    * Profile:
+        - Fix malformed query leading to error when adding an address      -FRU
+
+    * XnetGrp:
+        - #861: Fix adding non-registered X with compound name to a group  -JAC
+
+================================================================================
 VERSION 0.10.0                                                        11 12 2008
 
 New:
index 01d0b19..ba24d7e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ q:
 ##
 
 core:
-       [ -d core ] || ( git submodule init && git submodule update )
+       [ -d core/.git ] || ( git submodule init && git submodule update )
        make -C core all
 
 ##
@@ -115,20 +115,20 @@ get-wiki:
 openid: get-openid spool/openid/store
 
 # There is no obvious way to automatically use the latest version
+OPENID_VERSION = 2.1.3
 get-openid:
        @if ! test -d include/Auth; then                                  \
-           wget http://openidenabled.com/files/php-openid/packages/php-openid-2.1.2.tar.bz2; \
-           tar -xjf php-openid-2.1.2.tar.bz2;                            \
-           mv php-openid-2.1.2/Auth include/;                            \
-           rm php-openid-2.1.2.tar.bz2;                                  \
-           rm -r php-openid-2.1.2;                                       \
+           wget http://openidenabled.com/files/php-openid/packages/php-openid-$(OPENID_VERSION).tar.bz2; \
+           tar -xjf php-openid-$(OPENID_VERSION).tar.bz2;                \
+           mv php-openid-$(OPENID_VERSION)/Auth include/;                \
+           rm php-openid-$(OPENID_VERSION).tar.bz2;                      \
+           rm -r php-openid-$(OPENID_VERSION);                           \
        fi
 
 spool/openid/store:
        mkdir -p $@
        chmod o+w $@
 
-
 ##
 ## banana
 ##
diff --git a/bin/check_security_fixes.py b/bin/check_security_fixes.py
new file mode 100755 (executable)
index 0000000..4d87c93
--- /dev/null
@@ -0,0 +1,177 @@
+#!/usr/bin/env python
+#***************************************************************************
+#*  Copyright (C) 2003-2009 Polytechnique.org                              *
+#*  http://opensource.polytechnique.org/                                   *
+#*                                                                         *
+#*  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   *
+#*  the Free Software Foundation; either version 2 of the License, or      *
+#*  (at your option) any later version.                                    *
+#*                                                                         *
+#*  This program is distributed in the hope that it will be useful,        *
+#*  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+#*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+#*  GNU General Public License for more details.                           *
+#*                                                                         *
+#*  You should have received a copy of the GNU General Public License      *
+#*  along with this program; if not, write to the Free Software            *
+#*  Foundation, Inc.,                                                      *
+#*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+#***************************************************************************/
+
+"""Checks that a working copy of plat/al has all the latest security patches
+applied. It uses the local SECURITY file to determine the list of mandatory
+patches.
+
+Important notice: do not execute this script directly from an automatic checkout
+of plat/al. It would be extremely unwise to execute it with root privileges from
+a place where everybody can change it !
+
+Usage (-w updates the local .htaccess to disable guilty working copies):
+  check_security_fixes.py [-w] -b REFERENCE_PLATAL PLATAL_TO_CHECK ...
+"""
+
+import optparse
+import os
+import re
+import sys
+import time
+
+
+class WorkingCopy(object):
+  """Helper class for analyzing the state of a working copy, and eventually
+  disabling it if an issue is found.
+
+  It disables the local checkout by updating its .htaccess file to deny all
+  requests with an explicit message which states how to fix the issue.
+  """
+
+  CORE_SECURITY_FILE = 'core/SECURITY'
+  MASTER_SECURITY_FILE = 'SECURITY'
+  SECURITY_FIX_RE = re.compile('^-[0-9]{4}')
+
+  HTACCESS_FILE = 'htdocs/.htaccess'
+  HTACCESS_TEMPLATE = 'Deny from all\nErrorDocument 403 "%s"\n'
+  HTACCESS_MTIME_DELTA = 86400 * 365 * 10
+  ERROR_MESSAGE_LINE = '<li>%s</li>\n'
+  ERROR_MESSAGE_TEMPLATE = """
+    Your local checkout of plat/al has been disabled for security reasons. It
+    appears that several critical flaws known in the plat/al codebase have not
+    been patched in your working copy. These flaws are listed below:
+    <ul>%s</ul>
+
+    Please have a look at the SECURITY and core/SECURITY files in any recent
+    plat/al checkout to get more details on which commits did fix those flaws.
+    <br/><br/>
+
+    <em>Note:</em> you can re-enable your working copy by typing
+    <code>make</code> in the root directory of your checkout (usually in
+    <code>~/dev/platal</code>).
+  """
+
+  def __init__(self, reference_path, checkout_path):
+    self.reference_path = reference_path
+    self.checkout_path = checkout_path
+
+  def GetPartialSecurityDiff(self, security_file):
+    """Diffs the reference and a local SECURITY file to find missing security
+    fixes. It filters out the diff result to extract the list of fixes."""
+
+    ref_file = os.path.join(self.reference_path, security_file)
+    wc_file = os.path.join(self.checkout_path, security_file)
+
+    diff = os.popen('diff -NBwu0 %s %s' % (ref_file, wc_file))
+    for line in diff.readlines():
+      if self.SECURITY_FIX_RE.match(line):
+        yield line[1:-1]
+
+  def GetSecurityDiff(self):
+    """Retrieves the missing security patches for various parts of plat/al."""
+
+    missing_fixes = []
+    missing_fixes.extend(self.GetPartialSecurityDiff(self.CORE_SECURITY_FILE))
+    missing_fixes.extend(self.GetPartialSecurityDiff(self.MASTER_SECURITY_FILE))
+    return missing_fixes
+
+  def GetErrorMessage(self, missing_fixes):
+    """Returns a the .htaccess HTML error message.
+
+    It builds an HTML message explaining why the working copy was disabled, how
+    to fix the underlying issues, and how to re-enable it."""
+
+    fixes_list = map(lambda item: self.ERROR_MESSAGE_LINE % item, missing_fixes)
+    return self.ERROR_MESSAGE_TEMPLATE % '\n'.join(fixes_list)
+
+  def Write403Htaccess(self, html_content):
+    """Updates the .htaccess to disable all requests, using |html_content| as
+    the error message. It also sets a modification time in the past to ensure
+    that any subsquent call to 'make' on the wc will actually overwrite the
+    .htaccess file."""
+
+    htaccess = os.path.join(self.checkout_path, self.HTACCESS_FILE)
+    ht_fd = open(htaccess, 'w')
+    ht_fd.write(self.HTACCESS_TEMPLATE % (html_content
+        .replace('\\', '\\\\')
+        .replace('"', '\\"')
+        .replace('\n', '\\\n')))
+    ht_fd.close()
+
+    mtime = time.time() - self.HTACCESS_MTIME_DELTA
+    os.utime(htaccess, (mtime, mtime))
+
+  def CheckAndDisableWorkingCopy(self, disable_when_flawed):
+    """Checks that the local working copy is in a sane state. If not, warns the
+    user by printing a message to the console, and disables the wc if
+    |disable_when_flawed| is set to true."""
+
+    missing_fixes = self.GetSecurityDiff()
+    if len(missing_fixes):
+      # Warn the user on the standard output.
+      print "Found %d missing security fixes in %s:" % (len(missing_fixes),
+                                                        self.checkout_path)
+      for issue in missing_fixes:
+        print "  * %s" % issue
+
+      # Disable the working copy.
+      if disable_when_flawed:
+        print "Disabling working copy in %s." % self.checkout_path
+        self.Write403Htaccess(self.GetErrorMessage(missing_fixes))
+
+def SelfCheckIsLatestVersion(base_path):
+  """Checks that this script is the latest available by comparing itself to
+  the reference script in |base_path|. It is important to do that check as
+  most deployment will want to execute this script with root privileges,
+  which implies that this script is deployed in a safe directory, and not
+  just executed from an automatically updated checkout of plat/al (how
+  unsafe would that be ...)."""
+
+  base_script = os.path.join(base_path, 'bin/check_security_fixes.py')
+  local_script = os.path.abspath(sys.argv[0])
+
+  if os.system('diff -q %s %s' % (base_script, local_script)) != 0:
+    sys.stderr.write('Please upgrade this script to the latest version.\n')
+
+def main():
+  parser = optparse.OptionParser()
+  parser.add_option('-b', '--base_path', action='store', dest='base_path')
+  parser.add_option('-w', '--write_htaccess', action='store_true',
+                    dest='write_htaccess', default=False)
+  (options, args) = parser.parse_args()
+
+  if options.base_path is None:
+    print "Error: option --base_path (or -b) is required for the script to run."
+    sys.exit(1)
+  if not os.path.exists(os.path.join(options.base_path,
+                                     WorkingCopy.MASTER_SECURITY_FILE)):
+    print "The base plat/al (%s) is too old to be used." % options.base_path
+    sys.exit(1)
+
+  SelfCheckIsLatestVersion(options.base_path)
+  for platal in args:
+    wc = WorkingCopy(options.base_path, platal)
+    wc.CheckAndDisableWorkingCopy(options.write_htaccess)
+
+if __name__ == '__main__':
+  main()
+
+# vim:set et sw=2 sts=2 sws=2 enc=utf-8:
index 0d8015e..4cf7894 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 47366a5..1cb2b0e 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index f70e566..60970dc 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 9744d97..ce90f01 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 30ffde8..e91d6e0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -100,7 +100,7 @@ while ($sent_mails < $globals->lists->max_mail_per_min
     // send feedback to the mailing list owners
     if ($client->handle_request($list, $mid, $action, utf8_decode($reason))) {
         $sent_mails += $count;
-        $texte = "le message suivant :\n\n"
+        $texte = "Le message suivant :\n\n"
                . "    Auteur: {$mail['sender']}\n"
                . "    Sujet : « {$mail['subj']} »\n"
                . "    Date  : ".strftime("le %d %b %Y à %H:%M:%S", (int)$mail['stamp'])."\n\n"
index 535dcf5..bdf7330 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -37,17 +37,17 @@ list($nb, $age, $nbold, $nbveryold) = $res->fetchOneRow();
 $age = (time() - intval($age)) / 86400;
 $head = "";
 if ($age > 15) {
-    $head = "[autodestruction du serveur] ";
+    $head = "[Autodestruction du serveur] ";
 } elseif ($age > 7) {
-    $head = "[armageddon imminent] ";
+    $head = "[Armageddon imminent] ";
 } elseif ($age > 5) {
-    $head = "[guerre nucléaire] ";
+    $head = "[Guerre nucléaire] ";
 } elseif ($age > 3) {
     $head = "[ET Téléphone maison] ";
 } elseif ($age > 1) {
-    $head = "[réveil !] ";
+    $head = "[Réveil !] ";
 } elseif (!empty($nbveryold)) {
-    $head = "[urgent] ";
+    $head = "[Urgent] ";
 }
 
 
@@ -60,10 +60,10 @@ $plural = $nb == 1 ? "" : "s";
 $mymail = new PlMailer();
 $mymail->setFrom('validation@' . $globals->mail->domain);
 $mymail->addTo("validation@" . $globals->mail->domain);
-$mymail->setSubject($head . "il y a $nb validation$plural non effectuée$plural");
+$mymail->setSubject($head . "Il y a $nb validation$plural non effectuée$plural");
 
 $message =
-       "il y a $nb validation$plural à effectuer \n"
+       "Il y a $nb validation$plural à effectuer\n"
        .(empty($nbold)?"":"dont $nbold depuis le dernier mail !!!\n")
        .(empty($nbveryold)?"":"et dont *$nbveryold* ".($nbveryold == 1 ? "est" : "sont")." en retard de plus de 6h !!!")
        ."\n"
@@ -74,7 +74,7 @@ $res = XDB::iterRow("SELECT  type, count(*)
                    GROUP BY  type
                    ORDER BY  type");
 while (list($type, $nb) = $res->next()) {
-    $message .= "- $type: $nb\n";
+    $message .= "- $type : $nb\n";
 }
 
 $message = wordwrap($message,78);
index d930338..b237e52 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 82c62a2..a9b8b81 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 608e3ba..c8c57c4 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 542f67f..46c2ae0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 4995ad2..1d5ceca 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 9820fbf..17d1d0e 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index f385b03..78ad292 100755 (executable)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl -w
 #***************************************************************************
-#*  Copyright (C) 2003-2008 Polytechnique.org                              *
+#*  Copyright (C) 2003-2009 Polytechnique.org                              *
 #*  http://opensource.polytechnique.org/                                   *
 #*                                                                         *
 #*  This program is free software; you can redistribute it and/or modify   *
index 9abba72..8ae4f73 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #***************************************************************************
-#*  Copyright (C) 2003-2008 Polytechnique.org                              *
+#*  Copyright (C) 2003-2009 Polytechnique.org                              *
 #*  http://opensource.polytechnique.org/                                   *
 #*                                                                         *
 #*  This program is free software; you can redistribute it and/or modify   *
index 9534e0e..2e7f08c 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 6f3b4af..ef9cb39 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 6f5f3fc..694cee9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #***************************************************************************
-#*  Copyright (C) 2004-2008 polytechnique.org                              *
+#*  Copyright (C) 2004-2009 polytechnique.org                              *
 #*  http://opensource.polytechnique.org/                                   *
 #*                                                                         *
 #*  This program is free software; you can redistribute it and/or modify   *
index 91a249a..0bc4b1a 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python2.5
 # -*- coding: utf-8 -*-
 #***************************************************************************
-#*  Copyright (C) 2004-2008 polytechnique.org                              *
+#*  Copyright (C) 2004-2009 Polytechnique.org                              *
 #*  http://opensource.polytechnique.org/                                   *
 #*                                                                         *
 #*  This program is free software; you can redistribute it and/or modify   *
index 3e23af5..01f47aa 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index c201f21..81fa957 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 0528913..94803e8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -60,12 +60,14 @@ class PlatalGlobals extends PlGlobals
             }
 
             if ($gp) {
-                $res = XDB::query('SELECT  a.*, d.nom AS domnom,
-                                           FIND_IN_SET(\'wiki_desc\', a.flags) AS wiki_desc,
-                                           FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub
+                $res = XDB::query("SELECT  a.*, d.nom AS domnom,
+                                           FIND_IN_SET('wiki_desc', a.flags) AS wiki_desc,
+                                           FIND_IN_SET('notif_unsub', a.flags) AS notif_unsub,
+                                           FIND_IN_SET('has_ml', a.flags) AS has_ml
                                      FROM  groupex.asso AS a
                                 LEFT JOIN  groupex.dom  AS d ON d.id = a.dom
-                                    WHERE  diminutif = {?}', $gp);
+                                    WHERE  diminutif = {?}",
+                                  $gp);
                 if (!($aid = $res->fetchOneAssoc())) {
                     $aid = array();
                 }
index 462783b..7ebdab0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /*
- * Copyright (C) 2003-2004 Polytechnique.org
+ * Copyright (C) 2003-2009 Polytechnique.org
  * http://opensource.polytechnique.org/
  *
  * This program is free software; you can redistribute it and/or modify
@@ -96,6 +96,9 @@ class PlatalLogger extends PlLogger
                      $this->uid, $this->session);
     }
 
+    public function isValid($uid) {
+        return $uid == $this->uid;
+    }
 
     /** Logs an action and its related data.
      *
index eb112ca..eb8390d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -26,6 +26,10 @@ class User extends PlUser
     {
         global $globals;
 
+        if (!$login) {
+            throw new UserNotFoundException();
+        }
+
         // If $data is an integer, fetches directly the result.
         if (is_numeric($login)) {
             $res = XDB::query("SELECT user_id FROM auth_user_md5 WHERE user_id = {?}", $login);
@@ -186,6 +190,14 @@ class User extends PlUser
         $this->perm_flags = self::makePerms($this->perms);
     }
 
+    // Return the password of the user
+    public function password()
+    {
+        return XDB::fetchOneCell('SELECT  u.password
+                                    FROM  auth_user_md5 AS u
+                                   WHERE  u.user_id = {?}', $this->id());
+    }
+
     // Return permission flags for a given permission level.
     public static function makePerms($perms)
     {
@@ -204,7 +216,7 @@ class User extends PlUser
     public static function _default_user_callback($login, $results)
     {
         $result_count = count($results);
-        if ($result_count == 0 || !S::has_perms()) {
+        if ($result_count == 0 || !S::admin()) {
             Platal::page()->trigError("Il n'y a pas d'utilisateur avec l'identifiant : $login");
         } else {
             Platal::page()->trigError("Il y a $result_count utilisateurs avec cet identifiant : " . join(', ', $results));
index 9e5096b..b0bfe8b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index f23cac2..9f86aca 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -114,12 +114,12 @@ class XnetPage extends PlPage
                 $sub['créer une liste']     = "$dim/lists/create";
                 $sub['créer un alias']      = "$dim/alias/create";
             }
-            if (S::has_perms()) {
+            if (S::admin()) {
                 $sub['gérer les groupes'] = array('href' => 'admin', 'style' => 'color: gray;');
                 $sub['clear cache'] = array('href' => 'purge_cache?token=' . S::v('xsrf_token'), 'style' => 'color: gray;');
             }
             $menu['Administrer'] = $sub;
-        } elseif (S::has_perms()) {
+        } elseif (S::admin()) {
             $sub = array();
             $sub['gérer les groupes'] = 'admin';
             $sub['clear cache'] = 'purge_cache?token=' . S::v('xsrf_token');
index 068e6b2..e69e6eb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -162,7 +162,7 @@ function may_update($force = false, $lose = false)
         return false;
     } elseif ($lose) {
         $may_update[$asso_id] = false;
-    } elseif (S::has_perms() || (S::has('suid') && $force)) {
+    } elseif (S::admin() || (S::has('suid') && $force)) {
         $may_update[$asso_id] = true;
     } elseif (!isset($may_update[$asso_id]) || $force) {
         $res = XDB::query("SELECT  perms
index 1049ca6..2c7e2d2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 3db3379..ad73b1d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index cf2413f..f150fdd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -47,19 +47,19 @@ class XorgSession extends PlSession
     private function tryCookie()
     {
         S::kill('auth_by_cookie');
-        if (Cookie::v('ORGaccess') == '' || !Cookie::has('ORGuid')) {
+        if (Cookie::v('access') == '' || !Cookie::has('uid')) {
             return -1;
         }
 
         $res = XDB::query('SELECT  user_id, password
                              FROM  auth_user_md5
                             WHERE  user_id = {?} AND perms IN(\'admin\', \'user\')',
-                         Cookie::i('ORGuid'));
+                         Cookie::i('uid'));
         if ($res->numRows() != 0) {
             list($uid, $password) = $res->fetchOneRow();
             require_once 'secure_hash.inc.php';
             $expected_value = hash_encrypt($password);
-            if ($expected_value == Cookie::v('ORGaccess')) {
+            if ($expected_value == Cookie::v('access')) {
                 S::set('auth_by_cookie', $uid);
                 return 0;
             } else {
@@ -102,11 +102,17 @@ class XorgSession extends PlSession
                 }
             }
             if ($response != $expected_response) {
+                if (!S::logged()) {
+                    Platal::page()->trigError('Mot de passe ou nom d\'utilisateur invalide');
+                } else {
+                    Platal::page()->trigError('Mot de passe invalide');
+                }
                 S::logger($uid)->log('auth_fail', 'bad password');
                 return null;
             }
             return $uid;
         }
+        Platal::page()->trigError('Mot de passe ou nom d\'utilisateur invalide');
         return null;
     }
 
@@ -176,12 +182,10 @@ class XorgSession extends PlSession
             if (!S::has('suid')) {
                 if (Post::has('domain')) {
                     if (($domain = Post::v('domain', 'login')) == 'alias') {
-                        setcookie('ORGdomain', "alias", (time() + 25920000), '/', '', 0);
+                        Cookie::set('domain', 'alias', 300);
                     } else {
-                        setcookie('ORGdomain', '', (time() - 3600), '/', '', 0);
+                        Cookie::kill('domain');
                     }
-                    // pour que la modification soit effective dans le reste de la page
-                    $_COOKIE['ORGdomain'] = $domain;
                 }
             }
             S::kill('challenge');
@@ -199,7 +203,6 @@ class XorgSession extends PlSession
         }
         if ($level == AUTH_SUID) {
             S::set('auth', AUTH_MDP);
-            unset($_SESSION['log']);
         }
 
         // Retrieves main user properties.
@@ -233,17 +236,12 @@ class XorgSession extends PlSession
         } else {
             $logger = S::logger($uid);
             $logger->saveLastSession();
-            setcookie('ORGuid', $uid, (time() + 25920000), '/', '', 0);
+            Cookie::set('uid', $uid, 300);
 
             if (S::i('auth_by_cookie') == $uid || Post::v('remember', 'false') == 'true') {
-                $cookie = hash_encrypt($sess['password']);
-                setcookie('ORGaccess', $cookie, (time() + 25920000), '/', '', 0);
-                if (S::i('auth_by_cookie') != $uid) {
-                    $logger->log("cookie_on");
-                }
+                $this->setAccessCookie(false, S::i('auth_by_cookie') != $uid);
             } else {
-                setcookie('ORGaccess', '', time() - 3600, '/', '', 0);
-                $logger->log("cookie_off");
+                $this->killAccessCookie();
             }
         }
 
@@ -310,7 +308,7 @@ class XorgSession extends PlSession
         return null;
     }
 
-    public function makePerms($perm)
+    protected function makePerms($perm, $is_admin)
     {
         $flags = new PlFlagSet();
         if ($perm == 'disabled' || $perm == 'ext') {
@@ -353,6 +351,29 @@ class XorgSession extends PlSession
         $n = select_notifs(false, S::i('uid'), S::v('watch_last'), false);
         S::set('notifs', $n->numRows());
     }
+
+    public function setAccessCookie($replace = false, $log = true) {
+        if (S::has('suid') || ($replace && !Cookie::blank('access'))) {
+            return;
+        }
+        require_once('secure_hash.inc.php');
+        Cookie::set('access', hash_encrypt(S::v('password')), 300, true);
+        if ($log) {
+            S::logger()->log('cookie_on');
+        }
+    }
+
+    public function killAccessCookie($log = true) {
+        Cookie::kill('access');
+        if ($log) {
+            S::logger()->log('cookie_off');
+        }
+    }
+
+    public function killLoginFormCookies() {
+        Cookie::kill('uid');
+        Cookie::kill('domain');
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
diff --git a/core b/core
index 2b1ac5a..31ac496 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 2b1ac5abd3eafffdc01beb88a90ca0ba88c6ad18
+Subproject commit 31ac496f284cd21164e05d1472ad1ceca9fe1095
index bdee05b..59ac1ab 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index eef91ce..c6aba2a 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index a8e2a1e..d2ee6db 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 9a526ff..ca33953 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index e001c5e..91b2bd0 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 96c0b04..e1b6409 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 4fe8ada..c28906d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 7b38afa..3965dee 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index ae46031..a677b42 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index e7b8940..1e5ea8d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 6e269de..9751cd2 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 7178429..b298f5b 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 3094358..481fcbf 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 34f060c..33c696a 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index e1654e2..0485009 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index be8cd13..9fbe89b 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 247fffb..2f4d4b7 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index bf7f9f9..526d7b5 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 47029e8..800b9f9 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
diff --git a/htdocs/images/medals/eufor.jpg b/htdocs/images/medals/eufor.jpg
new file mode 100644 (file)
index 0000000..5956b25
Binary files /dev/null and b/htdocs/images/medals/eufor.jpg differ
diff --git a/htdocs/images/medals/onorificenza_quadro.jpg b/htdocs/images/medals/onorificenza_quadro.jpg
new file mode 100644 (file)
index 0000000..759f301
Binary files /dev/null and b/htdocs/images/medals/onorificenza_quadro.jpg differ
index 0f55506..fa2849d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 0ff10ad..503c572 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 1156c0b..14d5e34 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 35805d3..f96f7c9 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -36,7 +36,7 @@ function doChallengeResponse() {
     var new_pass = hash_encrypt(document.forms.login.password.value);
     var old_pass = MD5(document.forms.login.password.value);
     
-    str = readCookie('ORGuid') + ":" +
+    str = document.forms.loginsub.username.value + ":" +
         hash_encrypt(document.forms.login.password.value) + ":" +
         document.forms.loginsub.challenge.value;
 
index abea945..3e26fba 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 314b857..353a8ad 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 6e71e95..067845a 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 66dca47..a1708e0 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************\r
- *  Copyright (C) 2003-2008 Polytechnique.org                              *\r
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *\r
  *  http://opensource.polytechnique.org/                                   *\r
  *                                                                         *\r
  *  This program is free software; you can redistribute it and/or modify   *\r
index cf2cc18..9dbd8c0 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 39508a8..3ea7bec 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -212,6 +212,7 @@ function auto_links() {
     url  = document.URL;
     fqdn = url.replace(/^https?:\/\/([^\/]*)\/.*$/,'$1');
     light = (url.indexOf('display=light') > url.indexOf('?'));
+    resource_page = (url.indexOf('rss') > -1 || url.indexOf('ical') > -1);
 
     $("a,link").each(
         function(i) {
@@ -235,7 +236,7 @@ function auto_links() {
                     href = 'http://' + fqdn + '/' + href;
                 }
             }
-            if (this.nodeName.toLowerCase() == 'a') {
+            if (this.nodeName.toLowerCase() == 'a' && !resource_page) {
                 if (rss && href.indexOf('prefs/rss') < 0 &&  (href.indexOf('xml') > -1 || href.indexOf('hash'))) {
                     goodiesPopup(this, __goodies_rss);
                 } else if (ical) {
index e92260d..29ad13f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index dc7e761..3b96319 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 5847fff..78817d0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 6098a04..c177d1c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -25,7 +25,7 @@ $platal = new Xorg('auth', 'carnet', 'email', 'events', 'forums',
                    'geoloc', 'lists', 'marketing', 'payment', 'platal',
                    'profile', 'register', 'search', 'stats', 'admin',
                    'newsletter', 'axletter', 'bandeau', 'survey',
-                   'gadgets', 'googleapps', 'poison', 'openid');
+                   'gadgets', 'googleapps', 'poison', 'openid', 'reminder');
 
 if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) {
     $platal->run();
index 82235db..d7ef7be 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index e9dff7e..7ccabd7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,7 +24,7 @@ require_once 'banana/hooks.inc.php';
 
 function hook_checkcancel($_headers)
 {
-    return ($_headers['x-org-id'] == S::v('hruid') or S::has_perms());
+    return ($_headers['x-org-id'] == S::v('hruid') or S::admin());
 }
 
 class ForumsBanana extends Banana
@@ -41,7 +41,7 @@ class ForumsBanana extends Banana
         array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail');
         Banana::$nntp_host = 'news://web_' . $user->login()
                            . ":{$globals->banana->password}@{$globals->banana->server}:{$globals->banana->port}/";
-        if (S::has_perms()) {
+        if (S::admin()) {
             Banana::$msgshow_mimeparts[] = 'source';
         }
         Banana::$debug_nntp = ($globals->debug & DEBUG_BT);
index 69c5c37..6f9e8f0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -209,7 +209,7 @@ function make_Organization()
     global $globals;
     $perms = S::v('perms');
     $group = $globals->asso('nom');
-    if (S::has_perms()) {
+    if (S::admin()) {
         return "Administrateur de Polytechnique.org";
     } else if ($group && $perms->hasFlag('groupadmin')) {
         return "Animateur de $group";
index 9a3174f..1bf497a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -59,7 +59,7 @@ class MLBanana extends Banana
         Banana::$debug_smarty = ($globals->debug & DEBUG_SMARTY);
         Banana::$mbox_helper = $globals->banana->mbox_helper;
         Banana::$feed_updateOnDemand = true;
-        if (S::has_perms()) {
+        if (S::admin()) {
             Banana::$msgshow_mimeparts[] = 'source';
         }
         array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail');
index a6439b0..d789360 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -25,7 +25,7 @@ require_once 'banana/hooks.inc.php';
 
 function hook_checkcancel($_headers)
 {
-    return ($_headers['x-org-id'] == S::v('hruid') or S::has_perms());
+    return ($_headers['x-org-id'] == S::v('hruid') or S::admin());
 }
 
 function hook_makeLink($params)
index 35296b4..f524ec8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 0ba8cf3..73d539a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -252,7 +252,7 @@ class EmailRedirection extends Email
 
     public function clean_errors()
     {
-        if (!S::has_perms()) {
+        if (!S::admin()) {
             return false;
         }
         $this->panne       = 0;
@@ -328,7 +328,7 @@ class EmailStorage extends Email
 
         // IMAP storage is always visible to administrators, and is allowed for
         // everyone when the service is marked as 'active'.
-        if ($globals->mailstorage->imap_active || S::has_perms()) {
+        if ($globals->mailstorage->imap_active || S::admin()) {
             $storages[] = 'imap';
         }
 
index 85687bc..00e8fa9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -78,10 +78,30 @@ function geoloc_region($country, $current, $avail_only = false)
 function get_address_infos($txt)
 {
     global $globals;
+
     $url = $globals->geoloc->webservice_url."address.php?precise=1&txt=" . urlencode($txt);
-    if (!($f = @fopen($url, 'r'))) return false;
+    if ($globals->debug & DEBUG_BT) {
+        if (!isset(PlBacktrace::$bt['Geoloc'])) {
+            new PlBacktrace('Geoloc');
+        }
+        PlBacktrace::$bt['Geoloc']->start($url);
+    }
+    $f = @fopen($url, 'r');
+    if ($f === false) {
+        if ($globals->debug & DEBUG_BT) {
+            PlBacktrace::$bt['Geoloc']->stop(0, 'Can\'t fetch result');
+        }
+        return false;
+    }
     $keys = explode('|',fgets($f));
     $vals = explode('|',fgets($f));
+    if ($globals->debug & DEBUG_BT) {
+        $data = array();
+        for ($i = 0 ; $i < count($keys) ; ++$i) {
+            $data[] = array($keys[$i], $vals[$i]);
+        }
+        PlBacktrace::$bt['Geoloc']->stop(count($keys), null, $data);
+    }
     $infos = empty_address();
     foreach ($keys as $i=>$key) {
         if($vals[$i]) {
index bc1549c..accc779 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -119,6 +119,9 @@ class GoogleAppsAccount
     public $r_last_webmail;
     public $reporting_date;
 
+    // Nicknames (aliases) registered for that user, lazily loaded.
+    public $nicknames;
+
     // Pending requests in the gappsd job queue (cf. top note).
     public $pending_create;
     public $pending_delete;
@@ -272,6 +275,21 @@ class GoogleAppsAccount
         return $this->g_status == 'disabled';
     }
 
+    // Loads and returns the list of nicknames for the user.
+    public function nicknames()
+    {
+        if ($this->nicknames == null) {
+            $res = XDB::query(
+                "SELECT  g_nickname
+                   FROM  gapps_nicknames
+                  WHERE  g_account_name = {?}
+               ORDER BY  g_nickname",
+                $this->g_account_name);
+            $this->nicknames = $res->fetchColumn();
+        }
+        return $this->nicknames;
+    }
+
 
     // Changes the GoogleApps password.
     public function set_password($password) {
index 13a3076..881f676 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index e9b0db1..6450c4f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index de95b4c..7a53989 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 261fb8b..3f7bcdd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
+// {{{ class MailNotFound
+
+class MailNotFound extends Exception {
+}
+
+// }}}
+
 // {{{ class MassMailer
 
 abstract class MassMailer
index 9e1a59b..c58844e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -45,6 +45,9 @@ class NewsLetter extends MassMailer
             }
             $res = XDB::query("SELECT * FROM newsletter WHERE bits='new'");
         }
+        if ($res->numRows() != 1) {
+            throw new MailNotFound();
+        }
         $nl = $res->fetchOneAssoc();
 
         $this->_id        = $nl['id'];
index 8427bf9..eb70cc8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 8a5edbf..7b418d7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
diff --git a/include/reminder.inc.php b/include/reminder.inc.php
new file mode 100644 (file)
index 0000000..a28d839
--- /dev/null
@@ -0,0 +1,212 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+// Base class for a reminder; it offers the factory for creating valid reminders
+// tailored for a given user, as well as base methods for reminder impls.
+// Sub-classes should define at least the abstract methods, and the static
+// IsCandidate method (prototype: (User &$user)).
+//
+// Usage:
+//   // Instantiates and returns a valid Reminder object for the user.
+//   $reminder = Reminder::GetCandidateReminder($user);
+//
+//   // Returns the named Reminder object.
+//   $reminder = Reminder::GetByName($user, 'ax_letter');
+abstract class Reminder
+{
+    // Details about the reminder.
+    public $name;
+    protected $type_id;
+    protected $weight;
+    protected $remind_delay_yes;
+    protected $remind_delay_no;
+    protected $remind_delay_dismiss;
+
+    // Details about the user.
+    protected $user;
+    protected $current_status;
+    protected $last_ask;
+
+    // Constructs the Reminder object from a mandatory User instance, a list of
+    // key-value pairs from the `reminder_type` and `reminder` tables.
+    function __construct(User &$user, array $type)
+    {
+        $this->user = &$user;
+
+        $this->type_id              = $type['type_id'];
+        $this->name                 = $type['name'];
+        $this->weight               = $type['weight'];
+        $this->remind_delay_yes     = $type['remind_delay_yes'];
+        $this->remind_delay_no      = $type['remind_delay_no'];
+        $this->remind_delay_dismiss = $type['remind_delay_dismiss'];
+
+        if (isset($type['status'])) {
+            $this->current_status = $type['status'];
+        }
+        if (isset($type['remind_last'])) {
+            $this->last_ask = $type['remind_last'];
+        }
+    }
+
+    // Updates (or creates) the reminder line for the pair (|user|, |reminder_id|)
+    // using the |status| as status, and the |next_ask| as the delay between now
+    // and the next ask (if any).
+    private static function UpdateStatus($user_id, $type_id, $status, $next_ask)
+    {
+        XDB::execute('REPLACE INTO  reminder
+                               SET  uid = {?}, type_id = {?}, status = {?},
+                                    remind_last = NOW(), remind_next = FROM_UNIXTIME({?})',
+                     $user_id, $type_id, $status,
+                     ($next_ask > 0 ? time() + $next_ask * 24 * 60 * 60 : null));
+    }
+
+    // Updates the status of the reminder for the current user.
+    protected function UpdateOnYes()
+    {
+        $this->UpdateStatus($this->user->id(), $this->type_id,
+                            'yes', $this->remind_delay_yes);
+    }
+    protected function UpdateOnNo()
+    {
+        $this->UpdateStatus($this->user->id(), $this->type_id,
+                            'no', $this->remind_delay_no);
+    }
+    protected function UpdateOnDismiss()
+    {
+        $this->UpdateStatus($this->user->id(), $this->type_id,
+                            'dismiss', $this->remind_delay_dismiss);
+    }
+
+    // Display and http handling helpers --------------------------------------
+
+    // Handles a hit on the reminder onebox (for links made using the GetBaseUrl
+    // method below).
+    abstract public function HandleAction($action);
+
+    // Displays the reminder as a standalone html snippet. It should be used
+    // when the reminder is the only output of a page.
+    public function DisplayStandalone(&$page)
+    {
+        header('Content-Type: text/html; charset=utf-8');
+        $page->changeTpl('reminder/base.tpl', NO_SKIN);
+        $this->Prepare($page);
+    }
+
+    // Prepares the display by assigning template variables.
+    public function Prepare(&$page)
+    {
+        $page->assign_by_ref('reminder', $this);
+    }
+
+    // Returns the name of the inner template, or null if a simple text obtained
+    // from GetText should be printed.
+    public function template() { return null; }
+
+    // Returns the text to display in the onebox, or null if a
+    public function text() { return ''; }
+
+    // Returns the title of the onebox.
+    public function title() { return ''; }
+
+    // Should return true if this onebox needs to be considered as a warning and
+    // not just as a subscription offer.
+    public function warning() { return false; }
+
+    // Returns the base url for the reminder module.
+    public function baseurl()
+    {
+        return 'ajax/reminder/' . $this->name;
+    }
+
+    // Static status update methods -------------------------------------------
+
+    // Marks the candidate reminder as having been accepted for user |user_id|.
+    // It is intended to be used when a reminder box has been bypassed, and when
+    // it should behave as if the user had clicked on 'yes'.
+    protected static function MarkCandidateAsAccepted($user_id, $candidate)
+    {
+        Reminder::UpdateStatus($user_id, $candidate['type_id'],
+                               'yes', $candidate['remind_delay_yes']);
+    }
+
+    // Static factories -------------------------------------------------------
+
+    // Returns a chosen class using the user data from |user|, and from the database.
+    public static function GetCandidateReminder(User &$user)
+    {
+        $res = XDB::query('SELECT  rt.*, r.status, r.remind_last
+                             FROM  reminder_type AS rt
+                        LEFT JOIN  reminder      AS r ON (rt.type_id = r.type_id AND r.uid = {?})
+                            WHERE  r.uid IS NULL OR r.remind_next < NOW()',
+                          $user->id());
+        $candidates  = $res->fetchAllAssoc();
+
+        $weight_map = create_function('$a', 'return $a["weight"];');
+        while (count($candidates) > 0) {
+            $position = rand(1, array_sum(array_map($weight_map, $candidates)));
+            foreach ($candidates as $key => $candidate) {
+                $position -= $candidate['weight'];
+                if ($position <= 0) {
+                    $class = self::GetClassName($candidate['name']);
+                    if ($class && call_user_func(array($class, 'IsCandidate'), $user, $candidate)) {
+                        return new $class($user, $candidate);
+                    }
+                    unset($candidates[$key]);
+                }
+            }
+        }
+
+        return null;
+    }
+
+    // Returns an instantiation of the reminder class which name is |name|, using
+    // user data from |user|, and from the database.
+    public static function GetByName(User &$user, $name)
+    {
+        if (!($class = self::GetClassName($name))) {
+            return null;
+        }
+
+        $res = XDB::query('SELECT  rt.*, r.status, r.remind_last
+                             FROM  reminder_type AS rt
+                        LEFT JOIN  reminder      AS r ON (rt.type_id = r.type_id AND r.uid = {?})
+                            WHERE  rt.name = {?}',
+                          $user->id(), $name);
+        if ($res->numRows() > 0) {
+            return new $class($user, $res->fetchOneAssoc());
+        }
+
+        return null;
+    }
+
+    // Computes the name of the class for reminder named |name|, and preloads
+    // the class.
+    private static function GetClassName($name)
+    {
+        include_once "reminder/$name.inc.php";
+        $class = 'Reminder' . str_replace(' ', '', ucwords(str_replace('_', ' ', $name)));
+        return (class_exists($class) ? $class : null);
+    }
+}
+
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/ax_letter.inc.php b/include/reminder/ax_letter.inc.php
new file mode 100644 (file)
index 0000000..b0b112e
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderAxLetter extends Reminder
+{
+    public function HandleAction($action)
+    {
+        if ($action == 'yes') {
+            Platal::load('axletter', 'axletter.inc.php');
+            AXLetter::subscribe();
+            $this->UpdateOnYes();
+        }
+
+        if ($action == 'dismiss') {
+            $this->UpdateOnDismiss();
+        }
+
+        if ($action == 'no') {
+            $this->UpdateOnNo();
+        }
+    }
+
+    public function text()
+    {
+        return "La lettre de l'AX te permet de recevoir régulièrement les
+            informations importantes de l'AX.";
+    }
+    public function title()
+    {
+        return "Inscription à la lettre de l'AX";
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        Platal::load('axletter', 'axletter.inc.php');
+        $isSubscribed = AXLetter::subscriptionState();
+        if ($isSubscribed) {
+            Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
+        }
+        return !$isSubscribed;
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/email_backup.inc.php b/include/reminder/email_backup.inc.php
new file mode 100644 (file)
index 0000000..cdf266e
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderEmailBackup extends Reminder
+{
+    public function HandleAction($action)
+    {
+        if ($action == 'yes') {
+            require_once 'emails.inc.php';
+            $storage = new EmailStorage($this->user, 'imap');
+            $storage->activate();
+
+            $this->UpdateOnYes();
+        }
+
+        if ($action == 'dismiss') {
+            $this->UpdateOnDismiss();
+        }
+
+        if ($action == 'no') {
+            $this->UpdateOnNo();
+        }
+    }
+
+    public function text()
+    {
+        return "Tu peux bénéficier d'une sauvegarde des emails. Cela permet
+            d'avoir un accès de secours aux 30 derniers jours d'emails reçus
+            sur ton adresse Polytechnique.org.";
+    }
+    public function title()
+    {
+        return 'Sauvegarde de tes emails';
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        require_once 'emails.inc.php';
+        $storage  = new EmailStorage($user, 'imap');
+        if ($storage->active) {
+            Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
+        }
+        return !$storage->active;
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/email_warning.inc.php b/include/reminder/email_warning.inc.php
new file mode 100644 (file)
index 0000000..1b8f901
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderEmailWarning extends Reminder
+{
+    public function HandleAction($action)
+    {
+        if ($action == 'dismiss') {
+            $this->UpdateOnDismiss();
+        }
+    }
+
+    public function template()
+    {
+        return 'reminder/email_warning.tpl';
+    }
+    public function title()
+    {
+        return "Problème avec ta redirections d'emails";
+    }
+    public function warning()
+    {
+        return true;
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        return count(S::v('mx_failures', array())) > 0;
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/gapps.inc.php b/include/reminder/gapps.inc.php
new file mode 100644 (file)
index 0000000..8df4c46
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderGapps extends Reminder
+{
+    public function HandleAction($action)
+    {
+        switch ($action) {
+          case 'yes':
+            $this->UpdateOnYes();
+            pl_redirect('googleapps');
+            break;
+
+          case 'dismiss':
+            $this->UpdateOnDismiss();
+            break;
+
+          case 'no':
+            $this->UpdateOnNo();
+            break;
+        }
+    }
+
+    public function text()
+    {
+        return "Polytechnique.org te fournit un compte Google Apps qui te permet
+            de disposer des applications web de Google (GMail, Google Calendar,
+            Google Docs, et bien d'autres) sur ton adresse Polytechnique.org
+            habituelle (en savoir plus).";
+    }
+    public function title()
+    {
+        return "Création d'un compte Google Apps";
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        require_once 'googleapps.inc.php';
+        $isSubscribed = GoogleAppsAccount::account_status($user->id());
+        if ($isSubscribed) {
+            Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
+        }
+        return !$isSubscribed;
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/ml.inc.php b/include/reminder/ml.inc.php
new file mode 100644 (file)
index 0000000..9732bb2
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderMl extends Reminder
+{
+    public function HandleAction($action)
+    {
+        switch ($action) {
+          case 'suscribe':
+            S::assert_xsrf_token();
+            $subs = array_keys(Post::v('sub_ml'));
+            $current_domain = null;
+
+            $res = XDB::iterRow("SELECT  sub, domain
+                                   FROM  register_subs
+                                  WHERE  uid = {?} AND type = 'list'
+                               ORDER BY  domain",
+                                S::i('uid'));
+            while (list($sub, $domain) = $res->next()) {
+                if (array_shift($subs) == "$sub@$domain") {
+                    list($sub, $domain) = explode('@', $list);
+                    if ($domain != $current_domain) {
+                        $current_domain = $domain;
+                        $client = new MMList(S::v('uid'), S::v('password'), $domain);
+                    }
+                    $client->subscribe($sub);
+                }
+            }
+
+            $this->UpdateOnYes();
+            pl_redirect('lists');
+            break;
+
+          case 'dismiss':
+            $this->UpdateOnDismiss();
+            break;
+
+          case 'no':
+            $this->UpdateOnNo();
+            break;
+        }
+    }
+
+    public function Prepare(&$page)
+    {
+        parent::Prepare($page);
+
+        $res = XDB::iterRow("SELECT  sub, domain
+                               FROM  register_subs
+                              WHERE  uid = {?} AND type = 'list'
+                           ORDER BY  domain",
+                            S::i('uid'));
+        $current_domain = null;
+        $lists = array();
+        while (list($sub, $domain) = $res->next()) {
+            if ($current_domain != $domain) {
+                $current_domain = $domain;
+                $client = new MMList(S::v('uid'), S::v('password'), $domain);
+            }
+            list($details, ) = $client->get_members($sub);
+            $lists["$sub@$domain"] = $details;
+        }
+        $page->assign_by_ref('lists', $lists);
+    }
+
+    public function template()
+    {
+        return 'reminder/ml.tpl';
+    }
+    public function title()
+    {
+        return "Inscription aux listes de diffusion";
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        $res = XDB::query("SELECT  COUNT(*) AS lists
+                             FROM  register_subs
+                            WHERE  uid = {?} AND type = 'list'",
+                          $user->id());
+
+        $mlCount = $res->fetchOneCell();
+        if (!$mlCount) {
+            Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
+        }
+        return ($mlCount > 0);
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/nl.inc.php b/include/reminder/nl.inc.php
new file mode 100644 (file)
index 0000000..ba924c4
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderNl extends Reminder
+{
+    public function HandleAction($action)
+    {
+        if ($action == 'yes') {
+            require_once 'newsletter.inc.php';
+            Newsletter::subscribe();
+            $this->UpdateOnYes();
+        }
+
+        if ($action == 'dismiss') {
+            $this->UpdateOnDismiss();
+        }
+
+        if ($action == 'no') {
+            $this->UpdateOnNo();
+        }
+    }
+
+    public function text()
+    {
+        return "La lettre mensuelle de Polytechnique.org te permet de recevoir
+            chaque mois des informations sur les activités et nouvelles de la
+            communauté des X.";
+    }
+    public function title()
+    {
+        return "Inscription à la lettre mensuelle";
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        require_once 'newsletter.inc.php';
+        $isSubscribed = Newsletter::subscriptionState();
+        if ($isSubscribed) {
+            Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
+        }
+        return !$isSubscribed;
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/no_redirection.inc.php b/include/reminder/no_redirection.inc.php
new file mode 100644 (file)
index 0000000..706bfb2
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderNoRedirection extends Reminder
+{
+    public function HandleAction($action)
+    {
+        if ($action == 'dismiss') {
+            $this->UpdateOnDismiss();
+        }
+    }
+
+    public function template()
+    {
+        return 'reminder/no_redirection.tpl';
+    }
+    public function title()
+    {
+        return "Problème avec ta redirection d'emails";
+    }
+    public function warning()
+    {
+        return true;
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        return S::v('no_redirect');
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/profile_update.inc.php b/include/reminder/profile_update.inc.php
new file mode 100644 (file)
index 0000000..c07e741
--- /dev/null
@@ -0,0 +1,104 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderProfileUpdate extends Reminder
+{
+    public function HandleAction($action)
+    {
+        switch ($action) {
+          case 'dismiss':
+            $this->UpdateOnDismiss();
+            break;
+
+          case 'profile':
+            $this->UpdateOnDismiss();
+            pl_redirect('profile/edit');
+            break;
+
+          case 'photo':
+            $this->UpdateOnDismiss();
+            pl_redirect('photo/change');
+            break;
+
+          case 'geoloc':
+            $this->UpdateOnDismiss();
+            pl_redirect('profile/edit/adresses');
+            break;
+        }
+    }
+
+    public function Prepare(&$page)
+    {
+        parent::Prepare($page);
+
+        $res = XDB::query('SELECT  date < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_profile_old,
+                                   date AS profile_date, LENGTH(p.attach) > 0 AS photo
+                             FROM  auth_user_md5 AS u
+                        LEFT JOIN  photo         AS p ON (u.user_id = p.uid)
+                            WHERE  user_id = {?}',
+                          $this->user->id());
+        list($is_profile_old, $profile_date, $has_photo) = $res->fetchOneRow();
+
+        $page->assign('profile_incitation', $is_profile_old);
+        $page->assign('profile_last_update', $profile_date);
+        $page->assign('photo_incitation', $has_photo);
+
+        require_once 'geoloc.inc.php';
+        $res = localize_addresses($this->user->id());
+        $page->assign('geocoding_incitation', count($res));
+
+        $page->assign('incitations_count',
+                      ($is_profile_old ? 1 : 0) +
+                      ($has_photo ? 0 : 1) +
+                      (count($res) > 0 ? 1 : 0));
+    }
+
+    public function template()
+    {
+        return 'reminder/profile_update.tpl';
+    }
+    public function title()
+    {
+        return "Mise à jour de ton profil";
+    }
+    public function warning()
+    {
+        return true;
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        $res = XDB::query('SELECT  date < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_profile_old,
+                                   p.attach AS photo
+                             FROM  auth_user_md5 AS u
+                        LEFT JOIN  photo         AS p ON (u.user_id = p.uid)
+                            WHERE  user_id = {?}',
+                          $user->id());
+        list($is_profile_old, $has_photo) = $res->fetchOneRow();
+        require_once 'geoloc.inc.php';
+        $res = localize_addresses($user->id());
+
+        return (count($res) || !$has_photo || $is_profile_old);
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
diff --git a/include/reminder/promotion_ml.inc.php b/include/reminder/promotion_ml.inc.php
new file mode 100644 (file)
index 0000000..4cac8e7
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderPromotionMl extends Reminder
+{
+    public function HandleAction($action)
+    {
+        switch ($action) {
+          case 'yes':
+            $res = XDB::query('SELECT  id
+                               FROM  groupex.asso
+                              WHERE  diminutif = {?}',
+                            S::v('promo'));
+            $asso_id = $res->fetchOneCell();
+            XDB::execute('REPLACE INTO  groupex.membres (uid, asso_id)
+                                VALUES  ({?}, {?})',
+                         S::v('uid'), $asso_id);
+            $mmlist = new MMList(S::v('uid'), S::v('password'));
+            $mmlist->subscribe('promo' . S::v('promo'));
+
+            $this->UpdateOnYes();
+            break;
+
+          case 'dismiss':
+            $this->UpdateOnDismiss();
+            break;
+
+          case 'no':
+            $this->UpdateOnNo();
+            break;
+        }
+    }
+
+    public function text()
+    {
+        return "La liste de diffusion de ta promotion permet de recevoir les
+            informations plus spécifiques de ta promotion pour pouvoir
+            participer plus facilement aux événements qu'elle organise. Tu
+            seras aussi inscrit dans le groupe de la promotion " .
+            $this->user->promo() . '.';
+    }
+    public function title()
+    {
+        return "Inscription à la liste de diffusion de ta promotion";
+    }
+
+    public static function IsCandidate(User &$user, $candidate)
+    {
+        // We only test if the user is in her promotion group for it is too
+        // expensive to check if she is in the corresponding ML as well.
+        $res = XDB::query('SELECT  COUNT(*)
+                             FROM  groupex.membres
+                            WHERE  uid = {?} AND asso_id = (SELECT  id
+                                                              FROM  groupex.asso
+                                                             WHERE  diminutif = {?})',
+                          $user->id(), S::v('promo'));
+
+        $mlCount = $res->fetchOneCell();
+        if ($mlCount) {
+            Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
+        }
+        return ($mlCount == 0);
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
index e45a822..eb78f63 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 52a62cf..ff0d3a2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index b202df4..e5c0b19 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -108,7 +108,7 @@ function send_warning_mail($title)
 
 function kill_sessions()
 {
-    assert(S::has_perms());
+    assert(S::admin());
     shell_exec('sudo -u root ' . dirname(dirname(__FILE__)) . '/bin/kill_sessions.sh');
 }
 
index 6b06c12..798b4dd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 4c43731..1cbd1f9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 1fddfc3..3a357e4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 31078e6..085fffc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index c5f555c..461b969 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index da22479..8dc35f7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 73ec0ca..41896cb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 5932e14..a9e5926 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 44f0234..10663c5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 7b803fa..ab60fb1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index a81d0a2..9f2161c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index dd58bbd..e448358 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 3008be3..c0eecdd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index df5bee3..3bdf153 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 2cd3918..802d3d7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 3c50e83..2612f3b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 7194e04..2a2fec7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 2d1ef52..b9967b8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 22bfcac..59eb6f5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -113,7 +113,7 @@ class VCard extends PlVCard
         // Pro
         if (!empty($user['adr_pro'])) {
             foreach ($user['adr_pro'] as $pro) {
-                $street = array($adr['adr1']);
+                $street = array($pro['adr1']);
                 if (!empty($pro['adr2'])) {
                     $street[] = $pro['adr2'];
                 }
index 3c7f3b5..112ebaf 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 0247b26..d0d1aef 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 75f9af5..282ba96 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 1a21a5b..73ae584 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,30 +24,30 @@ class AdminModule extends PLModule
     function handlers()
     {
         return array(
-            'phpinfo'                      => $this->make_hook('phpinfo', AUTH_MDP, 'admin'),
-            'admin'                        => $this->make_hook('default', AUTH_MDP, 'admin'),
-            'admin/ax-xorg'                => $this->make_hook('ax_xorg', AUTH_MDP, 'admin'),
-            'admin/dead-but-active'        => $this->make_hook('dead_but_active', AUTH_MDP, 'admin'),
-            'admin/deaths'                 => $this->make_hook('deaths', AUTH_MDP, 'admin'),
-            'admin/downtime'               => $this->make_hook('downtime', AUTH_MDP, 'admin'),
-            'admin/homonyms'               => $this->make_hook('homonyms', AUTH_MDP, 'admin'),
-            'admin/logger'                 => $this->make_hook('logger', AUTH_MDP, 'admin'),
-            'admin/logger/actions'         => $this->make_hook('logger_actions', AUTH_MDP, 'admin'),
-            'admin/postfix/blacklist'      => $this->make_hook('postfix_blacklist', AUTH_MDP, 'admin'),
-            'admin/postfix/delayed'        => $this->make_hook('postfix_delayed', AUTH_MDP, 'admin'),
+            'phpinfo'                      => $this->make_hook('phpinfo',                AUTH_MDP, 'admin'),
+            'admin'                        => $this->make_hook('default',                AUTH_MDP, 'admin'),
+            'admin/ax-xorg'                => $this->make_hook('ax_xorg',                AUTH_MDP, 'admin'),
+            'admin/dead-but-active'        => $this->make_hook('dead_but_active',        AUTH_MDP, 'admin'),
+            'admin/deaths'                 => $this->make_hook('deaths',                 AUTH_MDP, 'admin'),
+            'admin/downtime'               => $this->make_hook('downtime',               AUTH_MDP, 'admin'),
+            'admin/homonyms'               => $this->make_hook('homonyms',               AUTH_MDP, 'admin'),
+            'admin/logger'                 => $this->make_hook('logger',                 AUTH_MDP, 'admin'),
+            'admin/logger/actions'         => $this->make_hook('logger_actions',         AUTH_MDP, 'admin'),
+            'admin/postfix/blacklist'      => $this->make_hook('postfix_blacklist',      AUTH_MDP, 'admin'),
+            'admin/postfix/delayed'        => $this->make_hook('postfix_delayed',        AUTH_MDP, 'admin'),
             'admin/postfix/regexp_bounces' => $this->make_hook('postfix_regexpsbounces', AUTH_MDP, 'admin'),
-            'admin/postfix/whitelist'      => $this->make_hook('postfix_whitelist', AUTH_MDP, 'admin'),
-            'admin/mx/broken'              => $this->make_hook('mx_broken', AUTH_MDP, 'admin'),
-            'admin/skins'                  => $this->make_hook('skins', AUTH_MDP, 'admin'),
-            'admin/synchro_ax'             => $this->make_hook('synchro_ax', AUTH_MDP, 'admin'),
-            'admin/user'                   => $this->make_hook('user', AUTH_MDP, 'admin'),
-            'admin/promo'                  => $this->make_hook('promo', AUTH_MDP, 'admin'),
-            'admin/validate'               => $this->make_hook('validate', AUTH_MDP, 'admin'),
-            'admin/validate/answers'       => $this->make_hook('validate_answers', AUTH_MDP, 'admin'),
-            'admin/wiki'                   => $this->make_hook('wiki', AUTH_MDP, 'admin'),
-            'admin/ipwatch'                => $this->make_hook('ipwatch', AUTH_MDP, 'admin'),
-            'admin/icons'                  => $this->make_hook('icons', AUTH_MDP, 'admin'),
-            'admin/accounts'               => $this->make_hook('accounts', AUTH_MDP, 'admin'),
+            'admin/postfix/whitelist'      => $this->make_hook('postfix_whitelist',      AUTH_MDP, 'admin'),
+            'admin/mx/broken'              => $this->make_hook('mx_broken',              AUTH_MDP, 'admin'),
+            'admin/skins'                  => $this->make_hook('skins',                  AUTH_MDP, 'admin'),
+            'admin/synchro_ax'             => $this->make_hook('synchro_ax',             AUTH_MDP, 'admin'),
+            'admin/user'                   => $this->make_hook('user',                   AUTH_MDP, 'admin'),
+            'admin/promo'                  => $this->make_hook('promo',                  AUTH_MDP, 'admin'),
+            'admin/validate'               => $this->make_hook('validate',               AUTH_MDP, 'admin'),
+            'admin/validate/answers'       => $this->make_hook('validate_answers',       AUTH_MDP, 'admin'),
+            'admin/wiki'                   => $this->make_hook('wiki',                   AUTH_MDP, 'admin'),
+            'admin/ipwatch'                => $this->make_hook('ipwatch',                AUTH_MDP, 'admin'),
+            'admin/icons'                  => $this->make_hook('icons',                  AUTH_MDP, 'admin'),
+            'admin/accounts'               => $this->make_hook('accounts',               AUTH_MDP, 'admin'),
         );
     }
 
@@ -80,11 +80,11 @@ class AdminModule extends PLModule
 
         $sql = XDB::iterator(
                 "SELECT  crc, nb, update_time, create_time,
-                         FIND_IN_SET('del', release) AS del,
-                         FIND_IN_SET('ok', release) AS ok
-                   FROM  postfix_mailseen
+                         FIND_IN_SET('del', p.release) AS del,
+                         FIND_IN_SET('ok', p.release) AS ok
+                   FROM  postfix_mailseen AS p
                   WHERE  nb >= 30
-               ORDER BY  release != ''");
+               ORDER BY  p.release != ''");
 
         $page->assign_by_ref('mails', $sql);
     }
@@ -553,6 +553,10 @@ class AdminModule extends PLModule
                     // however suits our needs.
                     if ($perms == 'disabled' && $old_fields['perms'] != 'disabled') {
                         kill_sessions();
+
+                        // Also serve a reminder to the admin: disabling an account
+                        // does not deactivate email forwarding.
+                        $page->trigWarning("N'oubliez pas, le cas échéant, de désactiver les redirections et le compte GoogleApps de l'utilisateur.");
                     }
 
                     // Updates the user profile with the new values.
@@ -569,6 +573,12 @@ class AdminModule extends PLModule
                         user_reindex($user->id());
                         $new_fields = XDB::query($watch_query, $user->id())->fetchOneAssoc();
 
+                        // Redacts the password in the notification, to avoid transmitting
+                        // sensitive information by email.
+                        $new_fields['password'] = ($old_fields['password'] != $new_fields['password'] ? 'new' : 'old');
+                        $old_fields['password'] = 'old';
+
+                        // Notifies the admins of the profile update.
                         $mailer = new PlMailer("admin/useredit.mail.tpl");
                         $mailer->assign("admin", S::user()->login());
                         $mailer->assign("user", $user->login());
@@ -604,14 +614,6 @@ class AdminModule extends PLModule
                                 $account->set_password($pass_encrypted);
                             }
                         }
-
-                        // If the update did disable the user account, disables
-                        // the Google Apps account as well.
-                        if ($new_fields['perms'] == 'disabled' && $new_fields['perms'] != $old_fields['perms']) {
-                            require_once 'googleapps.inc.php';
-                            $account = new GoogleAppsAccount($user);
-                            $account->suspend();
-                        }
                     }
 
 
index e68ca82..424361c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,18 +24,15 @@ class AuthModule extends PLModule
     function handlers()
     {
         return array(
-            'groupex/donne-chall.php'
-                                => $this->make_hook('chall',      AUTH_PUBLIC),
-            'groupex/export-econfiance.php'
-                                => $this->make_hook('econf',      AUTH_PUBLIC, 'user', NO_HTTPS),
-
-            'webservices/manageurs.php'
-                                => $this->make_hook('manageurs',  AUTH_PUBLIC, 'user', NO_HTTPS),
-
-            'auth-redirect.php' => $this->make_hook('redirect',   AUTH_COOKIE),
-            'auth-groupex.php'  => $this->make_hook('groupex_old',    AUTH_COOKIE),
-            'auth-groupex'      => $this->make_hook('groupex',    AUTH_COOKIE),
-            'admin/auth-groupes-x'         => $this->make_hook('admin_authgroupesx', AUTH_MDP, 'admin'),
+            'groupex/donne-chall.php'       => $this->make_hook('chall',              AUTH_PUBLIC),
+            'groupex/export-econfiance.php' => $this->make_hook('econf',              AUTH_PUBLIC, 'user', NO_HTTPS),
+
+            'webservices/manageurs.php'     => $this->make_hook('manageurs',          AUTH_PUBLIC, 'user', NO_HTTPS),
+
+            'auth-redirect.php'             => $this->make_hook('redirect',           AUTH_COOKIE),
+            'auth-groupex.php'              => $this->make_hook('groupex_old',        AUTH_COOKIE),
+            'auth-groupex'                  => $this->make_hook('groupex',            AUTH_COOKIE),
+            'admin/auth-groupes-x'          => $this->make_hook('admin_authgroupesx', AUTH_MDP,    'admin'),
         );
     }
 
@@ -143,34 +140,39 @@ class AuthModule extends PLModule
             $gpex_url .= "&PHPSESSID=" . $_GET["session"];
         }
 
-        /* a-t-on besoin d'ajouter le http:// ? */
+        // Normalize the return URL.
         if (!preg_match("/^(http|https):\/\/.*/",$gpex_url)) {
             $gpex_url = "http://$gpex_url";
         }
         $gpex_challenge = $_GET["challenge"];
 
-        // mise à jour de l'heure et de la machine de dernier login sauf quand on est en suid
+        // Update the last login information (unless the user is in SUID).
         $uid = S::i('uid');
         if (!isset($_SESSION['suid'])) {
             global $platal;
-            S::logger(uid)->log('connexion_auth_ext', $platal->path);
+            S::logger($uid)->log('connexion_auth_ext', $platal->path);
         }
 
-        /* on parcourt les entrees de groupes_auth */
+        // Iterate over the auth token to find which one did sign the request.
         $res = XDB::iterRow('SELECT privkey, name, datafields, returnurls FROM groupesx_auth');
-
         while (list($privkey,$name,$datafields,$returnurls) = $res->next()) {
             if (md5($gpex_challenge.$privkey) == $gpex_pass) {
                 $returnurls = trim($returnurls);
+                // We check that the return url matches a per-key regexp to prevent
+                // replay attacks (more exactly to force replay attacks to redirect
+                // the user to the real GroupeX website, which defeats the attack).
                 if (empty($returnurls) || @preg_match($returnurls, $gpex_url)) {
                     $returl = $gpex_url . gpex_make_params($gpex_challenge, $privkey, $datafields, $charset);
                     http_redirect($returl);
+                } else if (S::admin()) {
+                    $page->kill("La requête d'authentification a échouée (url de retour invalide).");
                 }
             }
         }
 
-        /* si on n'a pas trouvé, on renvoit sur x.org */
-        http_redirect('https://www.polytechnique.org/');
+        // Otherwise (if no valid request was found, or if the return URL is not
+        // acceptable), the user is redirected back to our homepage.
+        pl_redirect('/');
     }
 
     function handler_admin_authgroupesx(&$page, $action = 'list', $id = null)
index 45b41a2..c2b5737 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -43,7 +43,7 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
     foreach ($fieldarr as $val) {
         // Determine the requested value, and add it to the answer.
         if ($val == 'perms') {
-            $params .= gpex_prepare_param($val, S::has_perms() ? 'admin' : 'user', $tohash, $charset);
+            $params .= gpex_prepare_param($val, S::admin() ? 'admin' : 'user', $tohash, $charset);
         } else if ($val == 'forlife') {
             $params .= gpex_prepare_param($val, S::v('hruid'), $tohash, $charset);
         } else if (S::has($val)) {
@@ -66,7 +66,7 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
                 $perms = $res->fetchOneCell();
             } else {
                 // if no group asked, return main rights
-                $perms = S::has_perms() ? 'admin' : 'membre';
+                $perms = S::admin() ? 'admin' : 'membre';
             }
             $params .= gpex_prepare_param($val, $perms, $tohash, $charset);
         }
index 89aba0d..ea4d2f4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,13 +24,13 @@ class AXLetterModule extends PLModule
     function handlers()
     {
         return array(
-            'ax'             => $this->make_hook('index',        AUTH_COOKIE),
+            'ax'             => $this->make_hook('index',  AUTH_COOKIE),
             'ax/out'         => $this->make_hook('out',    AUTH_PUBLIC),
             'ax/show'        => $this->make_hook('show',   AUTH_COOKIE),
             'ax/edit'        => $this->make_hook('submit', AUTH_MDP),
             'ax/edit/cancel' => $this->make_hook('cancel', AUTH_MDP),
             'ax/edit/valid'  => $this->make_hook('valid',  AUTH_MDP),
-            'admin/axletter' => $this->make_hook('admin', AUTH_MDP, 'admin'),
+            'admin/axletter' => $this->make_hook('admin',  AUTH_MDP, 'admin'),
         );
     }
 
@@ -206,7 +206,7 @@ class AXLetterModule extends PLModule
         $page->assign('echeance_time', $echeance_time);
         $page->assign('saved', $saved);
         $page->assign('new', $new);
-        $page->assign('is_xorg', S::has_perms());
+        $page->assign('is_xorg', S::admin());
 
         if (!$saved) {
             $select = '';
@@ -240,7 +240,7 @@ class AXLetterModule extends PLModule
             return;
         }
 
-        $page->kill("L'envoi de l'annonce {$al->title()} est annulé");
+        $page->killSuccess("L'envoi de l'annonce {$al->title()} est annulé.");
     }
 
     function handler_valid(&$page, $force = null)
@@ -260,7 +260,7 @@ class AXLetterModule extends PLModule
             return;
         }
 
-        $page->kill("L'envoi de l'annonce aura lieu dans l'heure qui vient.");
+        $page->killSuccess("L'envoi de l'annonce aura lieu dans l'heure qui vient.");
     }
 
     function handler_show(&$page, $nid = 'last')
@@ -268,16 +268,20 @@ class AXLetterModule extends PLModule
         $this->load('axletter.inc.php');
         $page->changeTpl('axletter/show.tpl');
 
-        $nl  = new AXLetter($nid);
-        if (Get::has('text')) {
-            $nl->toText($page, S::v('prenom'), S::v('nom'), S::v('femme'));
-        } else {
-            $nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme'));
-        }
-        if (Post::has('send')) {
-            $nl->sendTo(S::user()->login(), S::user()->bestEmail(),
-                        S::v('prenom'), S::v('nom'),
-                        S::v('femme'), S::v('mail_fmt') != 'texte');
+        try {
+            $nl = new AXLetter($nid);
+            if (Get::has('text')) {
+                $nl->toText($page, S::v('prenom'), S::v('nom'), S::v('femme'));
+            } else {
+                $nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme'));
+            }
+            if (Post::has('send')) {
+                $nl->sendTo(S::user()->login(), S::user()->bestEmail(),
+                            S::v('prenom'), S::v('nom'),
+                            S::v('femme'), S::v('mail_fmt') != 'texte');
+            }
+        } catch (MailNotFound $e) {
+            return PL_NOT_FOUND;
         }
     }
 
index eed37b6..924447a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -48,8 +48,7 @@ class AXLetter extends MassMailer
                                     WHERE  id = {?} OR short_name = {?}", $id, $id);
             }
             if (!$res->numRows()) {
-                $this->_id = null;
-                return;
+                throw new MailNotFound();
             }
             $id = $res->fetchOneRow();
         }
@@ -153,13 +152,13 @@ class AXLetter extends MassMailer
 
     static public function hasPerms()
     {
-        if (S::has_perms()) {
+        if (S::admin()) {
             return true;
         }
-        $res = XDB::query("SELECT  1
+        $res = XDB::query("SELECT  COUNT(*)
                              FROM  axletter_rights
                             WHERE  user_id = {?}", S::i('uid'));
-        return $res->fetchOneCell();
+        return ($res->fetchOneCell() > 0);
     }
 
     static public function grantPerms($uid)
index 2a3e34c..4a226ac 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,9 +24,9 @@ class BandeauModule extends PLModule
     function handlers()
     {
         return array(
-            'bandeau/icone.png'  => $this->make_hook('icone',AUTH_PUBLIC, 'user', NO_HTTPS),
-            'bandeau'            => $this->make_hook('html', AUTH_PUBLIC, 'user', NO_HTTPS),
-            'bandeau.css'                               => $this->make_hook('css', AUTH_PUBLIC, 'user', NO_HTTPS),
+            'bandeau/icone.png'  => $this->make_hook('icone', AUTH_PUBLIC, 'user', NO_HTTPS),
+            'bandeau'            => $this->make_hook('html',  AUTH_PUBLIC, 'user', NO_HTTPS),
+            'bandeau.css'                               => $this->make_hook('css',   AUTH_PUBLIC, 'user', NO_HTTPS),
         );
     }
 
index b57f994..5ac29ba 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -29,9 +29,9 @@ class CarnetModule extends PLModule
             'carnet/notifs'         => $this->make_hook('notifs',   AUTH_COOKIE),
 
             'carnet/contacts'       => $this->make_hook('contacts', AUTH_COOKIE),
-            'carnet/contacts/pdf'   => $this->make_hook('pdf',      AUTH_COOKIE, 'user', NO_HTTPS),
+            'carnet/contacts/pdf'   => $this->make_hook('pdf',      AUTH_COOKIE),
+            'carnet/contacts/vcard' => $this->make_hook('vcard',    AUTH_COOKIE),
             'carnet/contacts/ical'  => $this->make_hook('ical',     AUTH_PUBLIC, 'user', NO_HTTPS),
-            'carnet/contacts/vcard' => $this->make_hook('vcard',    AUTH_COOKIE, 'user', NO_HTTPS),
 
             'carnet/rss'            => $this->make_hook('rss',      AUTH_PUBLIC, 'user', NO_HTTPS),
         );
index 0ef1509..e45fc3a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 362f23a..3172b4a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 6f1e98d..489a364 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,23 +24,23 @@ class EmailModule extends PLModule
     function handlers()
     {
         return array(
-            'emails' => $this->make_hook('emails', AUTH_COOKIE),
-            'emails/alias'    => $this->make_hook('alias', AUTH_MDP),
-            'emails/antispam' => $this->make_hook('antispam', AUTH_MDP),
-            'emails/broken'   => $this->make_hook('broken', AUTH_COOKIE),
-            'emails/redirect' => $this->make_hook('redirect', AUTH_MDP),
-            'emails/send'     => $this->make_hook('send', AUTH_MDP),
-            'emails/antispam/submit'  => $this->make_hook('submit', AUTH_COOKIE),
-            'emails/test'     => $this->make_hook('test', AUTH_COOKIE, 'user', NO_AUTH),
-
-            'emails/rewrite/in' => $this->make_hook('rewrite_in', AUTH_PUBLIC),
-            'emails/rewrite/out' => $this->make_hook('rewrite_out', AUTH_PUBLIC),
-
-            'emails/imap/in'  => $this->make_hook('imap_in', AUTH_PUBLIC),
-
-            'admin/emails/duplicated' => $this->make_hook('duplicated', AUTH_MDP, 'admin'),
-            'admin/emails/watch'      => $this->make_hook('duplicated', AUTH_MDP, 'admin'),
-            'admin/emails/lost'       => $this->make_hook('lost', AUTH_MDP, 'admin'),
+            'emails'                  => $this->make_hook('emails',      AUTH_COOKIE),
+            'emails/alias'            => $this->make_hook('alias',       AUTH_MDP),
+            'emails/antispam'         => $this->make_hook('antispam',    AUTH_MDP),
+            'emails/broken'           => $this->make_hook('broken',      AUTH_COOKIE),
+            'emails/redirect'         => $this->make_hook('redirect',    AUTH_MDP),
+            'emails/send'             => $this->make_hook('send',        AUTH_MDP),
+            'emails/antispam/submit'  => $this->make_hook('submit',      AUTH_COOKIE),
+            'emails/test'             => $this->make_hook('test',        AUTH_COOKIE, 'user', NO_AUTH),
+
+            'emails/rewrite/in'       => $this->make_hook('rewrite_in',  AUTH_PUBLIC),
+            'emails/rewrite/out'      => $this->make_hook('rewrite_out', AUTH_PUBLIC),
+
+            'emails/imap/in'          => $this->make_hook('imap_in',     AUTH_PUBLIC),
+
+            'admin/emails/duplicated' => $this->make_hook('duplicated',  AUTH_MDP,    'admin'),
+            'admin/emails/watch'      => $this->make_hook('duplicated',  AUTH_MDP,    'admin'),
+            'admin/emails/lost'       => $this->make_hook('lost',        AUTH_MDP,    'admin'),
         );
     }
 
@@ -235,8 +235,9 @@ class EmailModule extends PLModule
         $email = str_replace(' ', '+', $email);
 
         // Apply email redirection change requests.
+        $result = SUCCESS;
         if ($action == 'remove' && $email) {
-            $retour = $redirect->delete_email($email);
+            $result = $redirect->delete_email($email);
         }
 
         if ($action == 'active' && $email) {
@@ -258,15 +259,15 @@ class EmailModule extends PLModule
             $actifs = Env::v('emails_actifs', Array());
             print_r(Env::v('emails_rewrite'));
             if (Env::v('emailop') == "ajouter" && Env::has('email')) {
-                $retour = $redirect->add_email(Env::v('email'));
+                $result = $redirect->add_email(Env::v('email'));
             } elseif (empty($actifs)) {
-                $retour = ERROR_INACTIVE_REDIRECTION;
+                $result = ERROR_INACTIVE_REDIRECTION;
             } elseif (is_array($actifs)) {
-                $retour = $redirect->modify_email($actifs, Env::v('emails_rewrite', Array()));
+                $result = $redirect->modify_email($actifs, Env::v('emails_rewrite', Array()));
             }
         }
 
-        switch ($retour) {
+        switch ($result) {
           case ERROR_INACTIVE_REDIRECTION:
             $page->trigError('Tu ne peux pas avoir aucune adresse de redirection active, sinon ton adresse '
                              . $user->forlifeEmail() . ' ne fonctionnerait plus.');
@@ -487,7 +488,7 @@ class EmailModule extends PLModule
         }
 
         // Retrieves the User object for the test email recipient.
-        if (S::has_perms() && $hruid) {
+        if (S::admin() && $hruid) {
             $user = User::getSilent($hruid);
         } else {
             $user = S::user();
index 33f1c6d..5ee7b81 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,15 +24,15 @@ class EventsModule extends PLModule
     function handlers()
     {
         return array(
-            'events'         => $this->make_hook('ev',        AUTH_COOKIE),
-            'rss'            => $this->make_hook('rss', AUTH_PUBLIC, 'user', NO_HTTPS),
-            'events/preview' => $this->make_hook('preview', AUTH_PUBLIC, 'user', NO_AUTH),
-            'events/photo'   => $this->make_hook('photo', AUTH_PUBLIC),
-            'events/submit'  => $this->make_hook('ev_submit', AUTH_MDP),
-            'admin/events'   => $this->make_hook('admin_events',     AUTH_MDP, 'admin'),
-
-            'ajax/tips'      => $this->make_hook('tips',      AUTH_COOKIE, 'user', NO_AUTH),
-            'admin/tips'     => $this->make_hook('admin_tips', AUTH_MDP, 'admin'),
+            'events'         => $this->make_hook('ev',           AUTH_COOKIE),
+            'rss'            => $this->make_hook('rss',          AUTH_PUBLIC, 'user', NO_HTTPS),
+            'events/preview' => $this->make_hook('preview',      AUTH_PUBLIC, 'user', NO_AUTH),
+            'events/photo'   => $this->make_hook('photo',        AUTH_PUBLIC),
+            'events/submit'  => $this->make_hook('ev_submit',    AUTH_MDP),
+            'admin/events'   => $this->make_hook('admin_events', AUTH_MDP,    'admin'),
+
+            'ajax/tips'      => $this->make_hook('tips',         AUTH_COOKIE, 'user', NO_AUTH),
+            'admin/tips'     => $this->make_hook('admin_tips',   AUTH_MDP,    'admin'),
         );
     }
 
@@ -106,31 +106,21 @@ class EventsModule extends PLModule
         $page->addJsLink('ajax.js');
         $page->assign('tips', $this->get_tips());
 
-        // Profile update (appears when profile is > 400d old), and birthday
-        // oneboxes.
-        $res = XDB::query(
-            "SELECT  date < DATE_SUB(NOW(), INTERVAL 400 DAY) AS is_profile_old,
-                     MONTH(naissance) = MONTH(NOW()) AND DAYOFMONTH(naissance) = DAYOFMONTH(NOW()) AS is_birthday,
-                     date AS profile_date, YEAR(NOW()) - YEAR(naissance) AS age
-               FROM  auth_user_md5
-              WHERE  user_id = {?}", S::user()->id());
-        list($is_profile_old, $is_birthday, $profile_date, $age) = $res->fetchOneRow();
-
-        if ($is_profile_old) {
-            $page->assign('fiche_incitation', $profile_date);
-        }
-        if ($is_birthday) {
-            $page->assign('birthday', $age);
+        // Adds a reminder onebox to the page.
+        $user = S::user();
+        require_once 'reminder.inc.php';
+        if (($reminder = Reminder::GetCandidateReminder($user))) {
+            $reminder->Prepare($page);
         }
 
-        // No-photo onebox.
-        $res = XDB::query("SELECT COUNT(*) FROM photo WHERE uid = {?}", S::user()->id());
-        $page->assign('photo_incitation', $res->fetchOneCell() == 0);
-
-        // Geo-location onebox.
-        require_once 'geoloc.inc.php';
-        $res = localize_addresses(S::user()->id());
-        $page->assign('geoloc_incitation', count($res));
+        // Wishes "Happy birthday" when required
+        $res = XDB::query(
+            'SELECT  MONTH(naissance) = MONTH(NOW())
+                     AND DAYOFMONTH(naissance) = DAYOFMONTH(NOW()) AS is_birthday
+               FROM  auth_user_md5
+              WHERE  user_id = {?}',
+            $user->id());
+        $page->assign('birthday', $res->fetchOneCell());
 
         // Direct link to the RSS feed, when available.
         if (S::rssActivated()) {
index 3647cc5..6e80063 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 9c8ac06..bccc607 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,9 +24,9 @@ class ForumsModule extends PLModule
     function handlers()
     {
         return array(
-            'banana'         => $this->make_hook('banana', AUTH_COOKIE),
-            'banana/rss'     => $this->make_hook('rss', AUTH_PUBLIC, 'user', NO_HTTPS),
-            'admin/forums'   => $this->make_hook('forums_bans', AUTH_MDP, 'admin'),
+            'banana'         => $this->make_hook('banana',      AUTH_COOKIE),
+            'banana/rss'     => $this->make_hook('rss',         AUTH_PUBLIC, 'user', NO_HTTPS),
+            'admin/forums'   => $this->make_hook('forums_bans', AUTH_MDP,    'admin'),
         );
     }
 
index 0a90079..e99d031 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -25,9 +25,9 @@ class GadgetsModule extends PLModule
     {
         return array(
             'gadgets/ig-events.xml' => $this->make_hook('ig_events_xml', AUTH_PUBLIC, 'user', NO_HTTPS),
-            'gadgets/ig-events'     => $this->make_hook('ig_events', AUTH_PUBLIC),
+            'gadgets/ig-events'     => $this->make_hook('ig_events',     AUTH_PUBLIC),
             'gadgets/ig-search.xml' => $this->make_hook('ig_search_xml', AUTH_PUBLIC, 'user', NO_HTTPS),
-            'gadgets/ig-search'     => $this->make_hook('ig_search', AUTH_PUBLIC),
+            'gadgets/ig-search'     => $this->make_hook('ig_search',     AUTH_PUBLIC),
         );
     }
 
index a778b3f..f668fb4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 0a83602..30ab573 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,8 +24,8 @@ class GeolocModule extends PLModule
     function handlers()
     {
         return array(
-            'geoloc'             => $this->make_hook('default', AUTH_COOKIE),
-            'admin/geoloc'           => $this->make_hook('admin', AUTH_MDP, 'admin'),
+            'geoloc'                 => $this->make_hook('default',       AUTH_COOKIE),
+            'admin/geoloc'           => $this->make_hook('admin',         AUTH_MDP, 'admin'),
             'admin/geoloc/dynamap'   => $this->make_hook('admin_dynamap', AUTH_MDP, 'admin'),
         );
     }
index 0d868c7..7648c87 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -29,14 +29,14 @@ class GoogleAppsModule extends PLModule
         }
 
         return array(
-            'googleapps'            => $this->make_hook('index', AUTH_MDP),
-            'admin/googleapps'      => $this->make_hook('admin', AUTH_MDP. 'admin'),
-            'admin/googleapps/job'  => $this->make_hook('admin_job', AUTH_MDP, 'admin'),
+            'googleapps'            => $this->make_hook('index',      AUTH_MDP),
+            'admin/googleapps'      => $this->make_hook('admin',      AUTH_MDP, 'admin'),
+            'admin/googleapps/job'  => $this->make_hook('admin_job',  AUTH_MDP, 'admin'),
             'admin/googleapps/user' => $this->make_hook('admin_user', AUTH_MDP, 'admin'),
         );
     }
 
-    function handler_index(&$page, $action = null, $subaction = null)
+    function handler_index(&$page, $action = null)
     {
         require_once("emails.inc.php");
         require_once("googleapps.inc.php");
@@ -61,17 +61,17 @@ class GoogleAppsModule extends PLModule
 
         // Updates the Google Apps account as required.
         if ($action) {
-            if ($action == 'password') {
-                if ($subaction == 'sync') {
+            if ($action == 'password' && Post::has('pwsync')) {
+                S::assert_xsrf_token();
+                if (Post::v('pwsync') == 'sync') {
                     $account->set_password_sync(true);
                     $account->set_password(S::v('password'));
-                    pl_redirect('googleapps#password');
-                } else if ($subaction == 'nosync') {
+                } else {
                     $account->set_password_sync(false);
-                } else if (Post::has('response2') && !$account->sync_password) {
-                    S::assert_xsrf_token();
-                    $account->set_password(Post::v('response2'));
                 }
+            } elseif ($action == 'password' && Post::has('response2') && !$account->sync_password) {
+                S::assert_xsrf_token();
+                $account->set_password(Post::v('response2'));
             }
 
             if ($action == 'suspend' && Post::has('suspend') && $account->active()) {
@@ -180,7 +180,7 @@ class GoogleAppsModule extends PLModule
         }
     }
 
-    function handler_admin_user(&$page, $user = null, $action = null) {
+    function handler_admin_user(&$page, $user = null) {
         require_once("emails.inc.php");
         require_once("googleapps.inc.php");
         $page->changeTpl('googleapps/admin.user.tpl');
@@ -196,11 +196,25 @@ class GoogleAppsModule extends PLModule
             $account = new GoogleAppsAccount($user);
             $storage = new EmailStorage($user, 'googleapps');
 
-            // Force synchronization of plat/al and Google Apps passwords.
-            if ($action == 'forcesync' && $account->sync_password) {
+            // Apply requested actions.
+            if (Post::has('suspend') && $account->active() && !$account->pending_update_suspension) {
+                S::assert_xsrf_token();
+                $account->suspend();
+                $page->trigSuccess('Le compte est en cours de suspension.');
+            } else if (Post::has('unsuspend') && $account->suspended() && !$account->pending_update_suspension) {
+                S::assert_xsrf_token();
+                $account->do_unsuspend();
+                $page->trigSuccess('Le compte est en cours de réactivation.');
+            } else if (Post::has('forcesync') && $account->active() && $account->sync_password) {
+                $res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id = {?}", $user->id());
+                $account->set_password($res->fetchOneCell());
+                $page->trigSuccess('Le mot de passe est en cours de synchronisation.');
+            } else if (Post::has('sync') && $account->active()) {
                 $res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id = {?}", $user->id());
                 $account->set_password($res->fetchOneCell());
-                $page->trigSuccess('Le mot de passe a été synchronisé.');
+                $account->set_password_sync(true);
+            } else if (Post::has('nosync') && $account->active()) {
+                $account->set_password_sync(false);
             }
 
             // Displays basic account information.
index 115c7c4..11c5d3f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -27,7 +27,7 @@ class ListsModule extends PLModule
     {
         return array(
             'lists'           => $this->make_hook('lists',     AUTH_MDP),
-            'lists/ajax'      => $this->make_hook('ajax',      AUTH_MDP, 'user', NO_AUTH),
+            'lists/ajax'      => $this->make_hook('ajax',      AUTH_MDP,    'user', NO_AUTH),
             'lists/create'    => $this->make_hook('create',    AUTH_MDP),
 
             'lists/members'   => $this->make_hook('members',   AUTH_COOKIE),
@@ -43,7 +43,7 @@ class ListsModule extends PLModule
 
             'lists/soptions'  => $this->make_hook('soptions',  AUTH_MDP),
             'lists/check'     => $this->make_hook('check',     AUTH_MDP),
-            'admin/lists'     => $this->make_hook('admin_all', AUTH_MDP, 'admin'),
+            'admin/lists'     => $this->make_hook('admin_all', AUTH_MDP,    'admin'),
         );
     }
 
@@ -546,6 +546,21 @@ class ListsModule extends PLModule
                 $msg = str_replace("%(listname)s",  $liste, $msg);
                 $page->assign('msg', $msg);
                 return;
+            } elseif (Get::has('mid') && Env::has('mok')) {
+                $page->changeTpl('lists/moderate_mail.tpl');
+                require_once('banana/moderate.inc.php');
+                $params = array('listname' => $liste, 'domain' => $domain,
+                                'artid' => Get::i('mid'), 'part' => Get::v('part'), 'action' => Get::v('action'));
+                $params['client'] = $this->client;
+                run_banana($page, 'ModerationBanana', $params);
+
+                $msg = file_get_contents('/etc/mailman/fr/accept.txt');
+                $msg = str_replace("%(adminaddr)s", "$liste-owner@{$domain}", $msg);
+                $msg = str_replace("%(request)s",   "<< SUJET DU MAIL >>",    $msg);
+                $msg = str_replace("%(reason)s",    "<< TON EXPLICATION >>",  $msg);
+                $msg = str_replace("%(listname)s",  $liste, $msg);
+                $page->assign('msg', $msg);
+                return;
             }
 
             $mail = $this->moderate_mail($domain, $liste, Env::i('mid'));
index 05119da..2b2af8a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -29,7 +29,7 @@ function list_sort_owners(&$members, $tri_promo = true) {
     foreach($members as $mem) {
         list($m, $dom) = explode('@', $mem);
         $info = list_fetch_name($mem);
-        if (is_null($info['uid'])) {
+        if (!isset($info['uid']) || is_null($info['uid'])) {
             $membres[0][] = array('l' => $mem, 'p' => (!$tri_promo ? 'inconnue' : null));
         } else {
             $uid = $info['uid'];
@@ -66,9 +66,10 @@ function list_extract_members($members)
 // }}}
 // {{{ function list_sort_members
 
-function list_sort_members(&$members, $tri_promo = true)
+function list_sort_members($members, $tri_promo = true)
 {
-    return list_sort_owners(list_extract_members($members), $tri_promo);
+    $m = list_extract_members($members);
+    return list_sort_owners($m, $tri_promo);
 }
 
 // }}}
diff --git a/modules/lists/mail_templates/accept.txt b/modules/lists/mail_templates/accept.txt
new file mode 100644 (file)
index 0000000..f80227b
--- /dev/null
@@ -0,0 +1,13 @@
+Vous avez envoyé un message à la liste de diffusion {{{LIST}}} :
+
+    %(request)s 
+
+Le modérateur a souhaité diffuser votre message vers les abonnés à
+la liste.
+
+    "%(reason)s" 
+
+Toute question ou commentaire doit être adressé aux modérateurs de la
+liste à cette adresse :
+
+    {{{ALIST}}}
index b620e78..45a3fd9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 8390eed..8d0c4c6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,11 +24,11 @@ class NewsletterModule extends PLModule
     function handlers()
     {
         return array(
-            'nl'             => $this->make_hook('nl',        AUTH_COOKIE),
-            'nl/show'        => $this->make_hook('nl_show',   AUTH_COOKIE),
-            'nl/submit'      => $this->make_hook('nl_submit', AUTH_MDP),
-            'admin/newsletter'             => $this->make_hook('admin_nl', AUTH_MDP, 'admin'),
-            'admin/newsletter/categories'  => $this->make_hook('admin_nl_cat', AUTH_MDP, 'admin'),
+            'nl'                           => $this->make_hook('nl',            AUTH_COOKIE),
+            'nl/show'                      => $this->make_hook('nl_show',       AUTH_COOKIE),
+            'nl/submit'                    => $this->make_hook('nl_submit',     AUTH_MDP),
+            'admin/newsletter'             => $this->make_hook('admin_nl',      AUTH_MDP, 'admin'),
+            'admin/newsletter/categories'  => $this->make_hook('admin_nl_cat',  AUTH_MDP, 'admin'),
             'admin/newsletter/edit'        => $this->make_hook('admin_nl_edit', AUTH_MDP, 'admin'),
         );
     }
@@ -56,18 +56,25 @@ class NewsletterModule extends PLModule
 
         require_once 'newsletter.inc.php';
 
-        $nl  = new NewsLetter($nid);
-        if (Get::has('text')) {
-            $nl->toText($page, S::v('prenom'), S::v('nom'), S::v('femme'));
-        } else {
-            $nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme'));
-        }
-        if (Post::has('send')) {
-            $res = XDB::query("SELECT hash FROM newsletter_ins WHERE user_id = {?}", S::i('uid'));
-            $nl->sendTo(S::user()->login(), S::user()->bestEmail(),
-                        S::v('prenom'), S::v('nom'),
-                        S::v('femme'), S::v('mail_fmt') != 'texte',
-                        $res->fetchOneCell());
+        try {
+            $nl = new NewsLetter($nid);
+            if (Get::has('text')) {
+                $nl->toText($page, S::v('prenom'), S::v('nom'), S::v('femme'));
+            } else {
+                $nl->toHtml($page, S::v('prenom'), S::v('nom'), S::v('femme'));
+            }
+            if (Post::has('send')) {
+                $res = XDB::query("SELECT  hash
+                                     FROM  newsletter_ins
+                                    WHERE  user_id = {?}",
+                                  S::i('uid'));
+                $nl->sendTo(S::user()->login(), S::user()->bestEmail(),
+                            S::v('prenom'), S::v('nom'),
+                            S::v('femme'), S::v('mail_fmt') != 'texte',
+                            $res->fetchOneCell());
+            }
+        } catch (MailNotFound $e) {
+            return PL_NOT_FOUND;
         }
     }
 
index 843effc..6b8f031 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -61,138 +61,147 @@ class OpenidModule extends PLModule
     function handlers()
     {
         return array(
-            'openid'            => $this->make_hook('openid', AUTH_PUBLIC),
-            'openid/trust'      => $this->make_hook('trust', AUTH_COOKIE),
-            'openid/trusted'    => $this->make_hook('trusted', AUTH_MDP),
-            'admin/openid/trusted'  => $this->make_hook('admin_trusted', AUTH_MDP),
-            'openid/idp_xrds'   => $this->make_hook('idp_xrds', AUTH_PUBLIC),
-            'openid/user_xrds'  => $this->make_hook('user_xrds', AUTH_PUBLIC),
-            'openid/melix'      => $this->make_hook('melix', AUTH_PUBLIC),
+            'openid'                => $this->make_hook('openid', AUTH_PUBLIC),
+            'openid/melix'          => $this->make_hook('melix', AUTH_PUBLIC),
+            'openid/xrds'           => $this->make_hook('xrds', AUTH_PUBLIC),
+            'openid/trust'          => $this->make_hook('trust', AUTH_MDP),
+            'openid/trusted'        => $this->make_hook('trusted', AUTH_MDP),
+            'admin/openid/trusted'  => $this->make_hook('admin_trusted', AUTH_MDP, 'admin'),
         );
     }
 
-    function handler_openid(&$page, $x = null)
+    function handler_openid(&$page, $login = null)
     {
         $this->load('openid.inc.php');
+        $requested_user = User::getSilent($login);
+        $server = new OpenId();
 
         // Spec §4.1.2: if "openid.mode" is absent, we SHOULD assume that
-        // the request is not an OpenId message
-        if (!array_key_exists('openid_mode', $_REQUEST)) {
-            return $this->render_discovery_page($page, get_user($x));
+        // the request is not an OpenId message.
+        if (!$server->IsOpenIdRequest()) {
+            if ($requested_user) {
+                $server->RenderDiscoveryPage($page, $requested_user);
+                return;
+            } else {
+                pl_redirect('Xorg/OpenId');
+            }
+            exit;
         }
 
-        // Now, deal with the OpenId message
-        $server = init_openid_server();
-        $request = $server->decodeRequest();
-
-        // In modes 'checkid_immediate' and 'checkid_setup', the request
-        // needs some logic and can not be automatically answered by the server
-
-        // Immediate mode
-        if ($request->mode == 'checkid_immediate') {
+        // Initializes the OpenId environment from the request.
+        $server->Initialize();
+
+        // In modes 'checkid_immediate' and 'checkid_setup', we need to check
+        // by ourselves that we want to allow the user to be authenticated.
+        // Otherwise it can simply be forwarded to the Server object.
+        if ($server->IsAuthorizationRequest()) {
+            $authorized = S::logged() &&
+                $server->IsUserAuthorized(S::user()) &&
+                $server->IsEndpointTrusted(S::user());
+
+            if ($authorized) {
+                // TODO(vzanotti): SReg requests are currently not honored if
+                // the website is already trusted. We may want to redirect SReg
+                // requests to /openid/trust, to allow the user to choose.
+                $server->AnswerRequest(true);
+            } else if ($server->IsImmediateRequest()) {
+                $server->AnswerRequest(false);
+            } else {
+                // The user is currently not authorized to get her authorization
+                // request approved. Two possibilities:
+                //  * the endpoint is not yet trusted => redirect to openid/trust
+                //  * the user is not logged in => log in the user.
+                //
+                // The second case requires a special handling when the request
+                // was POSTed, as our current log in mechanism does not preserve
+                // POST arguments.
+                $openid_args = $server->GetQueryStringForRequest();
+                if (S::logged()) {
+                    pl_redirect('openid/trust', $openid_args);
+                } else if (Post::has('openid_mode')) {
+                    pl_redirect('openid', $openid_args);
+                } else {
+                    return PL_DO_AUTH;
+                }
+            }
+        } else {
+            $server->HandleRequest();
+        }
 
-            // We deny immediate requests, unless:
-            //   - the user identifier is known by the RP
-            //   - the user is logged in
-            //   - the user identifier matches the user logged in
-            //   - the user has whitelisted the site
-            $answer = !$request->idSelect()
-                      && S::logged()
-                      && $request->identity == S::user()->login()
-                      && is_trusted_site(S::user(), $request->trust_root);
-            $response =& $request->answer($answer);
+        // All requests should have been answered at this point. The best here
+        // is to get the user back to a safe page.
+        pl_redirect('');
+    }
 
-        // Setup mode
-        } else if ($request->mode == 'checkid_setup') {
+    function handler_melix(&$page, $login = null)
+    {
+        $this->load('openid.inc.php');
 
-            // We redirect to a page where the user will authenticate
-            // and confirm the use of his/her OpenId
-            // The request is saved in session before redirecting
-            S::set('openid_request', serialize($request));
-            pl_redirect('openid/trust');
-            return;
+        global $globals;
+        $melix = ($login ? $login . '@' . $globals->mail->alias_dom : null);
 
-        // Other requests can be automatically handled by the server
+        if ($melix && ($requested_user = User::getSilent($melix))) {
+            $server = new OpenId();
+            $server->RenderDiscoveryPage($page, $requested_user);
         } else {
-            $response =& $server->handleRequest($request);
+            pl_redirect('Xorg/OpenId');
         }
-
-        $webresponse =& $server->encodeResponse($response);
-        $this->render_openid_response($webresponse);
     }
 
-    function handler_trust(&$page, $x = null)
+    function handler_xrds(&$page, $login = null)
     {
         $this->load('openid.inc.php');
+        $requested_user = User::getSilent($login);
+        $server = new OpenId();
 
-        // Recover request in session
-        $request = S::v('openid_request');
-        if (is_null($request)) {
-            // There is no authentication information, something went wrong
-            pl_redirect('/');
-            return;
+        if (!$login) {
+            $server->RenderMainXrdsPage($page);
+        } else if ($requested_user) {
+            $server->RenderUserXrdsPage($page, $requested_user);
+        } else {
+            return PL_NOT_FOUND;
         }
+    }
 
-        require_once 'Auth/OpenID/Server.php';
-        $request = unserialize($request);
-
-        $server = init_openid_server();
+    function handler_trust(&$page)
+    {
+        $this->load('openid.inc.php');
+        $server = new OpenId();
         $user = S::user();
-        $identity = null;
-        $claimed_id = null;
 
-        // Set the identity to the user currently logged in
-        // if an OP Identifier was initially used
-        if ($request->identity == Auth_OpenID_IDENTIFIER_SELECT) {
-            $identity = $user->hruid;
-            $claimed_id = get_user_openid_url($user);
-        // Check that the identity matches the user currently logged in
-        // if an User Identifier was initially used
-        } else if ($request->identity != $user->hruid) {
-            $response =& $request->answer(false);
-            $webresponse =& $server->encodeResponse($response);
-            $this->render_openid_response($webresponse);
-            return;
+        // Initializes the OpenId environment from the request.
+        if (!$server->Initialize() || !$server->IsAuthorizationRequest()) {
+            $page->kill("Ta requête OpenID a échoué, merci de réessayer.");
         }
 
-        // Prepare Simple Registration response fields
-        require_once 'Auth/OpenID/SReg.php';
-        $sreg_request = Auth_OpenID_SRegRequest::fromOpenIDRequest($request);
-        $sreg_response = Auth_OpenID_SRegResponse::extractResponse($sreg_request, get_sreg_data($user));
+        // Prepares the SREG data, if any is required.
+        $sreg_response = $server->GetSRegDataForRequest($user);
 
-        $whitelisted = is_trusted_site($user, $request->trust_root);
-
-        // Ask the user for confirmation
-        if (!$whitelisted && $_SERVER['REQUEST_METHOD'] != 'POST') {
+        // Asks the user about her trust level of the current request, if not
+        // done yet.
+        if (!Post::has('trust_accept') && !Post::has('trust_cancel')) {
             $page->changeTpl('openid/trust.tpl');
-            $page->assign('relying_party', $request->trust_root);
-            $page->assign_by_ref('sreg_data', $sreg_response->data);
-            return;
-        }
-
-        // At this point $_SERVER['REQUEST_METHOD'] == 'POST'
+            $page->assign('openid_query', $server->GetQueryStringForRequest());
+            $page->assign('relying_party', $server->GetEndpoint());
+            $page->assign('sreg_data', $sreg_response->contents());
 
-        // Add 'always trusted' sites to whitelist
-        if (isset($_POST['trust']) && @$_POST['always']) {
-            add_trusted_site($user, $request->trust_root);
+            return;
         }
 
-        // Answer to the Relying Party
-        if ($whitelisted || isset($_POST['trust'])) {
-            S::kill('openid_request');
-            $response =& $request->answer(true, null, $identity, $claimed_id);
-
-            // Add the simple registration response values to the OpenID
-            // response message.
-            $sreg_response->toMessage($response->fields);
-
-        } else { // !$whitelisted && !isset($_POST['trust'])
-            S::kill('openid_request');
-            $response =& $request->answer(false);
+        // Interprets the form results, and updates the user whitelist.
+        S::assert_xsrf_token();
+        $trusted = $server->UpdateEndpointTrust(
+            $user,
+            Post::b('trust_accept') && !Post::b('trust_cancel'),
+            Post::b('trust_always'));
+
+        // Finally answers the request.
+        if ($server->IsUserAuthorized($user) && $trusted) {
+            $server->AnswerRequest(
+                true, $user, Post::b('trust_sreg') ? $sreg_response : null);
+        } else {
+            $server->AnswerRequest(false);
         }
-
-        $webresponse =& $server->encodeResponse($response);
-        $this->render_openid_response($webresponse);
     }
 
     function handler_trusted(&$page, $action = 'list', $id = null)
@@ -218,92 +227,7 @@ class OpenidModule extends PLModule
         $page->assign('readonly', true);
         $table_editor->apply($page, $action, $id);
     }
-
-    function handler_idp_xrds(&$page)
-    {
-        $this->load('openid.inc.php');
-        header('Content-type: application/xrds+xml');
-        $page->changeTpl('openid/idp_xrds.tpl', NO_SKIN);
-        $page->assign('type2', Auth_OpenID_TYPE_2_0_IDP);
-        $page->assign('sreg', Auth_OpenID_SREG_URI);
-        $page->assign('provider', get_openid_url());
-    }
-
-    function handler_user_xrds(&$page, $x = null)
-    {
-        $this->load('openid.inc.php');
-
-        $user = get_user($x);
-        if (is_null($user)) {
-            return PL_NOT_FOUND;
-        }
-
-        header('Content-type: application/xrds+xml');
-        $page->changeTpl('openid/user_xrds.tpl', NO_SKIN);
-        $page->assign('type2', Auth_OpenID_TYPE_2_0);
-        $page->assign('type1', Auth_OpenID_TYPE_1_1);
-        $page->assign('sreg', Auth_OpenID_SREG_URI);
-        $page->assign('provider', get_openid_url());
-        $page->assign('local_id', $user->hruid);
-    }
-
-    function handler_melix(&$page, $x = null)
-    {
-        $this->load('openid.inc.php');
-        $user = get_user_by_alias($x);
-
-        // This will redirect to the canonic URL, which was not used
-        // if this hook was triggered
-        return $this->render_discovery_page(&$page, $user);
-    }
-
-    //--------------------------------------------------------------------//
-
-    function render_discovery_page(&$page, $user)
-    {
-
-        // Show the documentation if this is not the OpenId page of an user
-        if (is_null($user)) {
-            pl_redirect('Xorg/OpenId');
-        }
-
-        // Redirect to the canonic URL if we are using an alias
-        // There might be a risk of redirection loop here
-        // if $_SERVER was not exactly what we expect
-        $current_url = 'http' . (empty($_SERVER['HTTPS']) ? '' : 's') . '://'
-                       . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
-        $canonic_url = get_user_openid_url($user);
-        if ($current_url != $canonic_url) {
-            http_redirect($canonic_url);
-        }
-
-        // Include X-XRDS-Location response-header for Yadis discovery
-        header('X-XRDS-Location: ' . get_user_xrds_url($user));
-
-        $page->changeTpl('openid/openid.tpl');
-        $page->setTitle($user->fullName());
-        // Set the <link> tags for HTML-Based Discovery
-        $page->addLink('openid.server openid2.provider', get_openid_url());
-        $page->addLink('openid.delegate openid2.local_id', $user->hruid);
-        $page->assign_by_ref('user', $user);
-
-        return;
-    }
-
-    function render_openid_response($webresponse)
-    {
-        if ($webresponse->code != AUTH_OPENID_HTTP_OK) {
-            header(sprintf("HTTP/1.1 %d ", $webresponse->code),
-                   true, $webresponse->code);
-        }
-        foreach ($webresponse->headers as $k => $v) {
-            header("$k: $v");
-        }
-        header('Connection: close');
-        print $webresponse->body;
-        exit;
-    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
\ No newline at end of file
+?>
index 4a55439..455e9df 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once "Auth/OpenID/Discover.php";
+require_once 'Auth/OpenID/Discover.php';
 
-function init_openid_server()
+// An helper class for using plat/al as an OpenId Identity Provider.
+class OpenId
 {
-    // Initialize a filesystem-based store
-    $store_location = dirname(__FILE__) . '/../../spool/openid/store';
-    require_once "Auth/OpenID/FileStore.php";
-    $store = new Auth_OpenID_FileStore($store_location);
-
-    // Create an OpenId server
-    require_once 'Auth/OpenID/Server.php';
-    return new Auth_OpenID_Server($store, get_openid_url());
-}
+    private $base_url;        // Base url for all OpenId operations.
+    private $spool_store;     // Location of the spool storage for OpenID.
 
-function get_openid_url()
-{
-    global $globals;
-    return $globals->baseurl . '/openid';
-}
+    private $server = null;   // Auth::OpenId::Server object.
+    private $request = null;  // Request extracted by the Server object.
+
+    public function __construct()
+    {
+        global $globals;
 
-function get_user($x) {
-    if (is_null($x)) {
-        return null;
+        $this->base_url = $globals->baseurl . '/openid';
+        $this->spool_store = $globals->spoolroot . '/spool/openid/store';
     }
-    $user = User::getSilent($x);
-    return $user ? $user : null;
 
-}
+    // Initializes an OpenId Server object; it will use a defined spool-based
+    // directory to store OpenID secrets. Returns true on success.
+    public function Initialize()
+    {
+        require_once 'Auth/OpenID/FileStore.php';
+        require_once 'Auth/OpenID/Server.php';
 
-function get_user_by_alias($x) {
-    if (is_null($x)) {
-        return null;
-    }
-    // TODO such a function should probably be provided in the User class
-    // or at least not here
-    $res = XDB::query('SELECT  u.user_id
-                         FROM  auth_user_md5   AS u
-                   INNER JOIN  auth_user_quick AS q USING(user_id)
-                   INNER JOIN  aliases         AS a ON (a.id = u.user_id AND type != \'homonyme\')
-                        WHERE  u.perms IN(\'admin\', \'user\')
-                          AND  q.emails_alias_pub = \'public\'
-                          AND  a.alias = {?}',
-                               $x);
-    if (list($uid) = $res->fetchOneRow()) {
-        $user = User::getSilent($uid);
-    }
-    return $user ? $user : null;
+        $store = new Auth_OpenID_FileStore($this->spool_store);
+        $this->server = new Auth_OpenID_Server($store, $this->base_url);
+        $this->request = $this->server->decodeRequest();
 
-}
+        return !is_a($this->request, 'Auth_OpenID_ServerError');
+    }
 
-function get_user_openid_url($user)
-{
-    if (is_null($user)) {
-        return null;
+    // Authorization logic helpers ---------------------------------------------
+
+    // Returns true iff the current request is a valid openid request.
+    public function IsOpenIdRequest()
+    {
+        return Env::has('openid_mode');
     }
-    global $globals;
-    return $globals->baseurl . '/openid/' . $user->hruid;
-}
 
-function get_idp_xrds_url()
-{
-    global $globals;
-    return $globals->baseurl . '/openid/idp_xrds';
-}
+    // Returns true iff the request needs to be handled directly by the calling
+    // code (ie. the current user needs to be authorized).
+    public function IsAuthorizationRequest()
+    {
+        return $this->request->mode == 'checkid_immediate' ||
+               $this->request->mode == 'checkid_setup';
+    }
 
-function get_user_xrds_url($user)
-{
-    if (is_null($user)) {
-        return null;
+    // Returns true iff the request requires an immediate answer (no user
+    // interaction is allowed).
+    public function IsImmediateRequest()
+    {
+        return $this->request->mode == 'checkid_immediate';
     }
-    global $globals;
-    return $globals->baseurl . '/openid/user_xrds/' . $user->hruid;
-}
 
-function get_sreg_data($user)
-{
-    if (is_null($user)) {
-        return null;
-    }
-    return array('fullname' => $user->fullName(),
-                 'nickname' => $user->displayName(),
-                 'dob' => null,
-                 'email' => $user->bestEmail(),
-                 'gender' => $user->isFemale() ? 'F' : 'M',
-                 'postcode' => null,
-                 'country' => null,
-                 'language' => null,
-                 'timezone' => null);
-}
+    // Returns true iff the logged-in user is authorized for the current request.
+    // It checks that the user is logged in, and has the authorization to use
+    // that identity.
+    public function IsUserAuthorized(User $user)
+    {
+        return $user && ($user->login() == $this->request->identity ||
+            $this->request->idSelect());
+    }
 
-function is_trusted_site($user, $url)
-{
-    $res = XDB::query('SELECT  COUNT(*)
-                         FROM  openid_trusted
-                        WHERE  (user_id = {?} OR user_id IS NULL)
-                          AND  url = {?}',
-                               $user->id(), $url);
-    return $res->fetchOneCell() > 0;
-}
+    // SimpleRegistration helpers ----------------------------------------------
 
-function add_trusted_site($user, $url)
-{
-    XDB::execute("INSERT IGNORE INTO openid_trusted
-                      SET user_id={?}, url={?}",
-                  $user->id(), $url);
+    // Determines which SREG data are requested by the endpoint, and returns them.
+    public function GetSRegDataForRequest(User &$user)
+    {
+        require_once 'Auth/OpenID/SReg.php';
+
+        // Other common SReg fields we could fill are:
+        //   dob, country, language, timezone.
+        $sreg_request = Auth_OpenID_SRegRequest::fromOpenIDRequest($this->request);
+        return Auth_OpenID_SRegResponse::extractResponse($sreg_request, array(
+            'fullname' => $user->fullName(),
+            'nickname' => $user->displayName(),
+            'email'    => $user->bestEmail(),
+            'gender'   => $user->isFemale() ? 'F' : 'M',
+        ));
+    }
+
+    // Handling and answering helpers ------------------------------------------
+
+    // Answers the current request, and renders the response. Appends the |sreg|
+    // data when not null.
+    public function AnswerRequest($is_authorized, $user = null, $sreg_data = null)
+    {
+        // Creates the response.
+        if ($is_authorized && $this->request->idSelect() && $user) {
+            $response = $this->request->answer(
+                $is_authorized, null, $user->login(), $this->GetUserUrl($user));
+        } else {
+            $response = $this->request->answer($is_authorized);
+        }
+
+        // Clobbers response, and get it back to the Relaying Party.
+        if ($sreg_data) {
+            $sreg_data->toMessage($response->fields);
+        }
+        $this->RenderResponse($response);
+    }
+
+    // Automatically handles the request without any user interaction.
+    public function HandleRequest()
+    {
+        $response = $this->server->handleRequest($this->request);
+        $this->RenderResponse($response);
+    }
+
+    // Trust management helpers ------------------------------------------------
+
+    // Returns true iff the current endpoint is currently trusted by |user|.
+    public function IsEndpointTrusted(User $user)
+    {
+        $res = XDB::query(
+            "SELECT  COUNT(*)
+               FROM  openid_trusted
+              WHERE  (user_id = {?} OR user_id IS NULL) AND url = {?}",
+            $user->id(), $this->request->trust_root);
+        return ($res->fetchOneCell() > 0);
+    }
+
+    // Updates the trust level for the given endpoint, based on the value pf
+    // |trusted| and |permanent_trust| (the latter is ignored when the former
+    // value is false). Returns true iff the current endpoint is trusted.
+    public function UpdateEndpointTrust(User &$user, $trusted, $permanent_trust) {
+        $initial_trust = $this->IsEndpointTrusted($user);
+        if (!$initial_trust && $trusted && $permanent_trust) {
+            XDB::execute(
+                "INSERT IGNORE INTO  openid_trusted
+                                SET  user_id = {?}, url = {?}",
+                $user->id(), $this->request->trust_root);
+        }
+
+        return ($initial_trust || $trusted);
+    }
+
+    // Page renderers ----------------------------------------------------------
+
+    // Renders the OpenId discovery page for |user|.
+    public function RenderDiscoveryPage(&$page, User &$user)
+    {
+        $page->changeTpl('openid/openid.tpl');
+        $page->setTitle($user->fullName());
+        $page->addLink('openid.server openid2.provider', $this->base_url);
+        $page->addLink('openid.delegate openid2.local_id', $user->login());
+        $page->assign_by_ref('user', $user);
+
+        // Include the X-XRDS-Location header for Yadis discovery.
+        header('X-XRDS-Location: ' . $this->GetUserXrdsUrl($user));
+    }
+
+    // Renders the main XRDS page.
+    public function RenderMainXrdsPage(&$page)
+    {
+        header('Content-type: application/xrds+xml');
+        $page->changeTpl('openid/idp_xrds.tpl', NO_SKIN);
+        $page->assign('type2', Auth_OpenID_TYPE_2_0_IDP);
+        $page->assign('sreg', Auth_OpenID_SREG_URI);
+        $page->assign('provider', $this->base_url);
+    }
+
+    // Renders the XRDS page of |user|.
+    public function RenderUserXrdsPage(&$page, User &$user)
+    {
+        header('Content-type: application/xrds+xml');
+        $page->changeTpl('openid/user_xrds.tpl', NO_SKIN);
+        $page->assign('type2', Auth_OpenID_TYPE_2_0);
+        $page->assign('type1', Auth_OpenID_TYPE_1_1);
+        $page->assign('sreg', Auth_OpenID_SREG_URI);
+        $page->assign('provider', $this->base_url);
+        $page->assign('local_id', $user->login());
+    }
+
+    // Renders the OpenId response for the HTTP client.
+    public function RenderResponse($response)
+    {
+        if ($response) {
+            $web_response = $this->server->encodeResponse($response);
+            header(sprintf('%s %d', $_SERVER['SERVER_PROTOCOL'], $web_response->code),
+                   true, $web_response->code);
+
+            foreach ($web_response->headers as $key => $value) {
+                header(sprintf('%s: %s', $key, $value));
+            }
+
+            header('Connection: close');
+            print $web_response->body;
+        }
+        exit;
+    }
+
+    // URL providers -----------------------------------------------------------
+
+    // Returns the OpenId identity URL of the requested user.
+    private function GetUserUrl(User &$user)
+    {
+        return $this->base_url . '/' . $user->login();
+    }
+
+    // Returns the private XRDS page of a user.
+    private function GetUserXrdsUrl(User &$user)
+    {
+        return $this->base_url . '/xrds/' . $user->login();
+    }
+
+    // Returns the endpoint in the current request.
+    public function GetEndpoint()
+    {
+        return $this->request->trust_root;
+    }
+
+    // Extracts the OpenId arguments available in the current request, and
+    // builds a query string with them.
+    public function GetQueryStringForRequest()
+    {
+        foreach (Auth_OpenID::getQuery() as $key => $value) {
+            if (strpos($key, 'openid.') === 0) {
+                $args[$key] = $value;
+            }
+        }
+
+        return http_build_query($args);
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
\ No newline at end of file
+?>
index d1e8a0e..f54ce5b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -88,14 +88,14 @@ class PaymentModule extends PLModule
     function handlers()
     {
         return array(
-            'payment'               => $this->make_hook('payment', AUTH_MDP),
-            'payment/cyber_return'  => $this->make_hook('cyber_return',  AUTH_PUBLIC, 'user', NO_HTTPS),
-            'payment/paypal_return' => $this->make_hook('paypal_return',  AUTH_PUBLIC, 'user', NO_HTTPS),
-            '%grp/paiement'              => $this->make_hook('xnet_payment', AUTH_MDP),
-            '%grp/payment'               => $this->make_hook('xnet_payment', AUTH_MDP),
-            '%grp/payment/cyber_return'  => $this->make_hook('cyber_return', AUTH_PUBLIC, 'user', NO_HTTPS),
+            'payment'                    => $this->make_hook('payment',       AUTH_MDP),
+            'payment/cyber_return'       => $this->make_hook('cyber_return',  AUTH_PUBLIC, 'user', NO_HTTPS),
+            'payment/paypal_return'      => $this->make_hook('paypal_return', AUTH_PUBLIC, 'user', NO_HTTPS),
+            '%grp/paiement'              => $this->make_hook('xnet_payment',  AUTH_MDP),
+            '%grp/payment'               => $this->make_hook('xnet_payment',  AUTH_MDP),
+            '%grp/payment/cyber_return'  => $this->make_hook('cyber_return',  AUTH_PUBLIC, 'user', NO_HTTPS),
             '%grp/payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC, 'user', NO_HTTPS),
-            'admin/payments'        => $this->make_hook('admin', AUTH_MDP, 'admin'),
+            'admin/payments'             => $this->make_hook('admin',         AUTH_MDP,    'admin'),
 
         );
     }
index c38d1c3..a5aae56 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 987e14c..27c034e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index dcd1606..4d7fb02 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index c9b4287..af0bf35 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -38,25 +38,24 @@ class PlatalModule extends PLModule
     function handlers()
     {
         return array(
-            'index'       => $this->make_hook('index',     AUTH_PUBLIC),
-            'cacert.pem'  => $this->make_hook('cacert',    AUTH_PUBLIC),
-            'changelog'   => $this->make_hook('changelog', AUTH_PUBLIC),
+            'index'             => $this->make_hook('index',     AUTH_PUBLIC),
+            'cacert.pem'        => $this->make_hook('cacert',    AUTH_PUBLIC),
+            'changelog'         => $this->make_hook('changelog', AUTH_PUBLIC),
 
             // Preferences thingies
-            'prefs'       => $this->make_hook('prefs',     AUTH_COOKIE),
-            'prefs/rss'   => $this->make_hook('prefs_rss', AUTH_COOKIE),
-            'prefs/webredirect'
-                          => $this->make_hook('webredir',  AUTH_MDP),
-            'prefs/skin'  => $this->make_hook('skin',      AUTH_COOKIE),
+            'prefs'             => $this->make_hook('prefs',     AUTH_COOKIE),
+            'prefs/rss'         => $this->make_hook('prefs_rss', AUTH_COOKIE),
+            'prefs/webredirect' => $this->make_hook('webredir',  AUTH_MDP),
+            'prefs/skin'        => $this->make_hook('skin',      AUTH_COOKIE),
 
             // password related thingies
-            'password'      => $this->make_hook('password',  AUTH_MDP),
-            'tmpPWD'        => $this->make_hook('tmpPWD',    AUTH_PUBLIC),
-            'password/smtp' => $this->make_hook('smtppass',  AUTH_MDP),
-            'recovery'      => $this->make_hook('recovery',  AUTH_PUBLIC),
-            'exit'          => $this->make_hook('exit', AUTH_PUBLIC),
-            'review'        => $this->make_hook('review', AUTH_PUBLIC),
-            'deconnexion.php' => $this->make_hook('exit', AUTH_PUBLIC),
+            'password'          => $this->make_hook('password',  AUTH_MDP),
+            'tmpPWD'            => $this->make_hook('tmpPWD',    AUTH_PUBLIC),
+            'password/smtp'     => $this->make_hook('smtppass',  AUTH_MDP),
+            'recovery'          => $this->make_hook('recovery',  AUTH_PUBLIC),
+            'exit'              => $this->make_hook('exit',      AUTH_PUBLIC),
+            'review'            => $this->make_hook('review',    AUTH_PUBLIC),
+            'deconnexion.php'   => $this->make_hook('exit',      AUTH_PUBLIC),
         );
     }
 
@@ -64,7 +63,7 @@ class PlatalModule extends PLModule
     {
         // Include X-XRDS-Location response-header for Yadis discovery
         global $globals;
-        header('X-XRDS-Location: ' . $globals->baseurl . '/openid/idp_xrds');
+        header('X-XRDS-Location: ' . $globals->baseurl . '/openid/xrds');
 
         // Redirect to the suitable page
         if (S::logged()) {
@@ -229,13 +228,8 @@ class PlatalModule extends PLModule
                 }
             }
 
-            $log =& S::v('log');
-            S::logger()->log('passwd', '');
-
-            if (Cookie::v('ORGaccess')) {
-                setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0);
-                S::logger()->log('cookie_on', '');
-            }
+            S::logger()->log('passwd');
+            Platal::session()->setAccessCookie(true);
 
             $page->changeTpl('platal/motdepasse.success.tpl');
             $page->run();
@@ -440,23 +434,17 @@ Adresse de secours : " . Post::v('email') : ""));
         }
 
         if ($level == 'forget' || $level == 'forgetall') {
-            setcookie('ORGaccess', '', time() - 3600, '/', '', 0);
-            Cookie::kill('ORGaccess');
-            S::logger()->log("cookie_off");
+            Platal::session()->killAccessCookie();
         }
 
         if ($level == 'forgetuid' || $level == 'forgetall') {
-            setcookie('ORGuid', '', time() - 3600, '/', '', 0);
-            Cookie::kill('ORGuid');
-            setcookie('ORGdomain', '', time() - 3600, '/', '', 0);
-            Cookie::kill('ORGdomain');
+            Platal::session()->killLoginFormCookies();
         }
 
         if (S::logged()) {
-            $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
-            S::logger()->log('deconnexion', $ref);
+            S::logger()->log('deconnexion', @$_SERVER['HTTP_REFERER']);
+            Platal::session()->destroy();
         }
-        Platal::session()->destroy();
 
         if (Get::has('redirect')) {
             http_redirect(rawurldecode(Get::v('redirect')));
@@ -469,7 +457,7 @@ Adresse de secours : " . Post::v('email') : ""));
     {
         // Include X-XRDS-Location response-header for Yadis discovery
         global $globals;
-        header('X-XRDS-Location: ' . $globals->baseurl . '/openid/idp_xrds');
+        header('X-XRDS-Location: ' . $globals->baseurl . '/openid/xrds');
 
         $this->load('review.inc.php');
         $dom = 'Review';
index 2b48319..15d1f83 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 4aa51a3..016316c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index eae4b16..1429036 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 7ef48ad..514ca46 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,43 +24,43 @@ class ProfileModule extends PLModule
     function handlers()
     {
         return array(
-            'photo'        => $this->make_hook('photo',        AUTH_PUBLIC),
-            'photo/change' => $this->make_hook('photo_change', AUTH_MDP),
-
-            'fiche.php'        => $this->make_hook('fiche',      AUTH_PUBLIC),
-            'profile'          => $this->make_hook('profile',    AUTH_PUBLIC),
-            'profile/private'  => $this->make_hook('profile',    AUTH_COOKIE),
-            'profile/ax'       => $this->make_hook('ax',         AUTH_COOKIE, 'admin'),
-            'profile/edit'     => $this->make_hook('p_edit',     AUTH_MDP),
-            'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_COOKIE, 'user', NO_AUTH),
-            'profile/ajax/tel'     => $this->make_hook('ajax_tel',     AUTH_COOKIE, 'user', NO_AUTH),
-            'profile/ajax/medal'   => $this->make_hook('ajax_medal',   AUTH_COOKIE, 'user', NO_AUTH),
-            'profile/ajax/job'     => $this->make_hook('ajax_job',     AUTH_COOKIE, 'user', NO_AUTH),
-            'profile/ajax/secteur' => $this->make_hook('ajax_secteur', AUTH_COOKIE, 'user', NO_AUTH),
-            'profile/ajax/skill'   => $this->make_hook('ajax_skill',   AUTH_COOKIE, 'user', NO_AUTH),
-            'javascript/applis.js' => $this->make_hook('applis_js', AUTH_COOKIE),
-            'javascript/grades.js' => $this->make_hook('grades_js', AUTH_COOKIE),
-            'profile/medal'    => $this->make_hook('medal', AUTH_PUBLIC),
-            'profile/orange'   => $this->make_hook('p_orange',   AUTH_MDP),
-            'profile/usage'    => $this->make_hook('p_usage',    AUTH_MDP),
-
-            'referent'         => $this->make_hook('referent',   AUTH_COOKIE),
-            'emploi'           => $this->make_hook('ref_search', AUTH_COOKIE),
-            'referent/search'  => $this->make_hook('ref_search', AUTH_COOKIE),
-            'referent/ssect'   => $this->make_hook('ref_sect',   AUTH_COOKIE, 'user', NO_AUTH),
-            'referent/country' => $this->make_hook('ref_country', AUTH_COOKIE, 'user', NO_AUTH),
-
-            'groupes-x'        => $this->make_hook('xnet',      AUTH_COOKIE),
-
-            'vcard'   => $this->make_hook('vcard',  AUTH_COOKIE, 'user', NO_HTTPS),
-            'admin/binets'     => $this->make_hook('admin_binets', AUTH_MDP, 'admin'),
-            'admin/medals'     => $this->make_hook('admin_medals', AUTH_MDP, 'admin'),
-            'admin/formations' => $this->make_hook('admin_formations', AUTH_MDP, 'admin'),
-            'admin/sections'  => $this->make_hook('admin_sections', AUTH_MDP, 'admin'),
-            'admin/secteurs'  => $this->make_hook('admin_secteurs', AUTH_MDP, 'admin'),
-            'admin/trombino'   => $this->make_hook('admin_trombino', AUTH_MDP, 'admin'),
-            'admin/ss_secteurs'  => $this->make_hook('admin_ss_secteurs', AUTH_MDP, 'admin'),
-            'admin/fonctions'  => $this->make_hook('admin_fonctions', AUTH_MDP, 'admin'),
+            'photo'                => $this->make_hook('photo',             AUTH_PUBLIC),
+            'photo/change'         => $this->make_hook('photo_change',      AUTH_MDP),
+
+            'fiche.php'            => $this->make_hook('fiche',             AUTH_PUBLIC),
+            'profile'              => $this->make_hook('profile',           AUTH_PUBLIC),
+            'profile/private'      => $this->make_hook('profile',           AUTH_COOKIE),
+            'profile/ax'           => $this->make_hook('ax',                AUTH_COOKIE, 'admin'),
+            'profile/edit'         => $this->make_hook('p_edit',            AUTH_MDP),
+            'profile/ajax/address' => $this->make_hook('ajax_address',      AUTH_COOKIE, 'user', NO_AUTH),
+            'profile/ajax/tel'     => $this->make_hook('ajax_tel',          AUTH_COOKIE, 'user', NO_AUTH),
+            'profile/ajax/medal'   => $this->make_hook('ajax_medal',        AUTH_COOKIE, 'user', NO_AUTH),
+            'profile/ajax/job'     => $this->make_hook('ajax_job',          AUTH_COOKIE, 'user', NO_AUTH),
+            'profile/ajax/secteur' => $this->make_hook('ajax_secteur',      AUTH_COOKIE, 'user', NO_AUTH),
+            'profile/ajax/skill'   => $this->make_hook('ajax_skill',        AUTH_COOKIE, 'user', NO_AUTH),
+            'javascript/applis.js' => $this->make_hook('applis_js',         AUTH_COOKIE),
+            'javascript/grades.js' => $this->make_hook('grades_js',         AUTH_COOKIE),
+            'profile/medal'        => $this->make_hook('medal',             AUTH_PUBLIC),
+            'profile/orange'       => $this->make_hook('p_orange',          AUTH_MDP),
+            'profile/usage'        => $this->make_hook('p_usage',           AUTH_MDP),
+
+            'referent'             => $this->make_hook('referent',          AUTH_COOKIE),
+            'emploi'               => $this->make_hook('ref_search',        AUTH_COOKIE),
+            'referent/search'      => $this->make_hook('ref_search',        AUTH_COOKIE),
+            'referent/ssect'       => $this->make_hook('ref_sect',          AUTH_COOKIE, 'user', NO_AUTH),
+            'referent/country'     => $this->make_hook('ref_country',       AUTH_COOKIE, 'user', NO_AUTH),
+
+            'groupes-x'            => $this->make_hook('xnet',              AUTH_COOKIE),
+
+            'vcard'                => $this->make_hook('vcard',             AUTH_COOKIE),
+            'admin/binets'         => $this->make_hook('admin_binets',      AUTH_MDP,    'admin'),
+            'admin/medals'         => $this->make_hook('admin_medals',      AUTH_MDP,    'admin'),
+            'admin/formations'     => $this->make_hook('admin_formations',  AUTH_MDP,    'admin'),
+            'admin/sections'       => $this->make_hook('admin_sections',    AUTH_MDP,    'admin'),
+            'admin/secteurs'       => $this->make_hook('admin_secteurs',    AUTH_MDP,    'admin'),
+            'admin/trombino'       => $this->make_hook('admin_trombino',    AUTH_MDP,    'admin'),
+            'admin/ss_secteurs'    => $this->make_hook('admin_ss_secteurs', AUTH_MDP,    'admin'),
+            'admin/fonctions'      => $this->make_hook('admin_fonctions',   AUTH_MDP,    'admin'),
 
         );
     }
@@ -351,7 +351,7 @@ class ProfileModule extends PLModule
                             WHERE  user_id = {?} AND naissance = '0000-00-00'", S::i('uid'));
         if ($res->numRows()) {
             $page->trigWarning("Ta date de naissance n'est pas renseignée, ce qui t'empêcheras de réaliser"
-                      . " la procédure de récupération de mot de passe si un jour tu le perdais");
+                      . " la procédure de récupération de mot de passe si un jour tu le perdais.");
         }
 
        $page->setTitle('Mon Profil');
index 780ee03..fa5d033 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 4a6bd69..31d68cd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 8227f36..d09df85 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index cd2c447..5fb7b45 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index eee6b5b..d629711 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index bf577d9..2c85c64 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 35a1f97..43d0683 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index c3da4f9..16ce379 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index be4ff7e..59af771 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -402,7 +402,7 @@ class RegisterModule extends PLModule
                 $msg .= "Les marketings suivants avaient été effectués :\n"
                      . implode("\n", $market);
             } else {
-                $msg .= "$prenom $nom n'a jamais reçu d\'email de marketing.";
+                $msg .= "$prenom $nom n'a jamais reçu d'email de marketing.";
             }
             $mymail->setTxtBody($msg);
             $mymail->send();
@@ -439,14 +439,8 @@ class RegisterModule extends PLModule
                 }
             }
 
-            $log = S::v('log');
-            S::logger()->log('passwd', '');
-
-            if (Cookie::v('ORGaccess')) {
-                require_once('secure_hash.inc.php');
-                setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0);
-                S::logger()->log('cookie_on', '');
-            }
+            S::logger()->log('passwd');
+            Platal::session()->setAccessCookie(true);
 
             $page->assign('mdpok', true);
         }
index 256f4e8..f7a5c4e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
diff --git a/modules/reminder.php b/modules/reminder.php
new file mode 100644 (file)
index 0000000..d35ef0c
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  http://opensource.polytechnique.org/                                   *
+ *                                                                         *
+ *  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   *
+ *  the Free Software Foundation; either version 2 of the License, or      *
+ *  (at your option) any later version.                                    *
+ *                                                                         *
+ *  This program is distributed in the hope that it will be useful,        *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
+ *  GNU General Public License for more details.                           *
+ *                                                                         *
+ *  You should have received a copy of the GNU General Public License      *
+ *  along with this program; if not, write to the Free Software            *
+ *  Foundation, Inc.,                                                      *
+ *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
+ ***************************************************************************/
+
+class ReminderModule extends PLModule
+{
+    function handlers()
+    {
+        return array(
+            'ajax/reminder' => $this->make_hook('reminder', AUTH_COOKIE),
+        );
+    }
+
+    function handler_reminder(&$page, $reminder_name = null, $action = null)
+    {
+        require_once 'reminder.inc.php';
+        $user = S::user();
+
+        // If no reminder name was passed, or if we don't know that reminder name,
+        // just drop the request.
+        if (!$reminder_name ||
+            !($reminder = Reminder::GetByName($user, $reminder_name))) {
+            return PL_NOT_FOUND;
+        }
+
+        // Otherwise, the request is dispatched, and a new reminder, if any, is
+        // displayed.
+        $reminder->HandleAction($action);
+
+        if (($new_reminder = Reminder::GetCandidateReminder($user))) {
+            $new_reminder->DisplayStandalone($page);
+        } else {
+            exit;
+        }
+    }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
index f742b1a..2912a49 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,11 +24,11 @@ class SearchModule extends PLModule
     function handlers()
     {
         return array(
-            'search'     => $this->make_hook('quick', AUTH_PUBLIC),
-            'search/adv' => $this->make_hook('advanced', AUTH_COOKIE),
+            'search'              => $this->make_hook('quick',          AUTH_PUBLIC),
+            'search/adv'          => $this->make_hook('advanced',       AUTH_COOKIE),
             'advanced_search.php' => $this->make_hook('redir_advanced', AUTH_PUBLIC),
-            'search/autocomplete' => $this->make_hook('autocomplete', AUTH_COOKIE, 'user', NO_AUTH),
-            'search/list' => $this->make_hook('list', AUTH_COOKIE, 'user', NO_AUTH),
+            'search/autocomplete' => $this->make_hook('autocomplete',   AUTH_COOKIE, 'user', NO_AUTH),
+            'search/list'         => $this->make_hook('list',           AUTH_COOKIE, 'user', NO_AUTH),
         );
     }
 
@@ -83,7 +83,7 @@ class SearchModule extends PLModule
                 S::logger()->log('search', 'quick=' . $quick);
             }
             $list = 'profile|prf|fiche|fic|referent|ref|mentor';
-            if (S::has_perms()) {
+            if (S::admin()) {
                 $list .= '|admin|adm|ax';
             }
             if (preg_match('/^(' . $list . '):([-a-z]+(\.[-a-z]+(\.\d{2,4})?)?)$/', replace_accent($quick), $matches)) {
index 247ac64..a9ae124 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -239,9 +239,9 @@ class QuickSearch extends SField
         $s = replace_accent(trim($this->value));
         $r = $s = str_replace('*','%',$s);
 
-        if (S::has_perms() && strpos($s, '@') !== false) {
+        if (S::admin() && strpos($s, '@') !== false) {
             $this->email = $s;
-        } else if (S::has_perms() && preg_match('/[0-9]+\.([0-9]+|%)\.([0-9]+|%)\.([0-9]+|%)/', $s)) {
+        } else if (S::admin() && preg_match('/[0-9]+\.([0-9]+|%)\.([0-9]+|%)\.([0-9]+|%)/', $s)) {
             $this->ip = $s;
         }
         if ($this->email || $this->ip) {
index 985a398..042398e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index f5c6c17..06ad2d2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -36,15 +36,14 @@ class StatsModule extends PLModule
     function handlers()
     {
         return array(
-            'stats'           => $this->make_hook('stats',     AUTH_COOKIE),
-            'stats/evolution' => $this->make_hook('evolution', AUTH_COOKIE),
-            'stats/graph'     => $this->make_hook('graph',     AUTH_COOKIE),
-            'stats/graph/evolution'
-                              => $this->make_hook('graph_evo', AUTH_COOKIE),
-            'stats/promos'    => $this->make_hook('promos',    AUTH_COOKIE),
-            'stats/profile'   => $this->make_hook('profile',   AUTH_COOKIE),
-
-            'stats/coupures'  => $this->make_hook('coupures',  AUTH_PUBLIC),
+            'stats'                 => $this->make_hook('stats',     AUTH_COOKIE),
+            'stats/evolution'       => $this->make_hook('evolution', AUTH_COOKIE),
+            'stats/graph'           => $this->make_hook('graph',     AUTH_COOKIE),
+            'stats/graph/evolution' => $this->make_hook('graph_evo', AUTH_COOKIE),
+            'stats/promos'          => $this->make_hook('promos',    AUTH_COOKIE),
+            'stats/profile'         => $this->make_hook('profile',   AUTH_COOKIE),
+
+            'stats/coupures'        => $this->make_hook('coupures',  AUTH_PUBLIC),
         );
     }
 
index 93e471a..3ce8541 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -25,15 +25,15 @@ class SurveyModule extends PLModule
     function handlers()
     {
         return array(
-            'survey'              => $this->make_hook('index', AUTH_PUBLIC),
-            'survey/vote'         => $this->make_hook('vote', AUTH_PUBLIC),
-            'survey/result'       => $this->make_hook('result', AUTH_PUBLIC),
-            'survey/edit'         => $this->make_hook('edit', AUTH_COOKIE),
-            'survey/ajax'         => $this->make_hook('ajax', AUTH_COOKIE),
-            'survey/admin'        => $this->make_hook('admin', AUTH_MDP, 'admin'),
-            'survey/admin/edit'   => $this->make_hook('adminEdit', AUTH_MDP, 'admin'),
+            'survey'              => $this->make_hook('index',         AUTH_PUBLIC),
+            'survey/vote'         => $this->make_hook('vote',          AUTH_PUBLIC),
+            'survey/result'       => $this->make_hook('result',        AUTH_PUBLIC),
+            'survey/edit'         => $this->make_hook('edit',          AUTH_COOKIE),
+            'survey/ajax'         => $this->make_hook('ajax',          AUTH_COOKIE),
+            'survey/admin'        => $this->make_hook('admin',         AUTH_MDP, 'admin'),
+            'survey/admin/edit'   => $this->make_hook('adminEdit',     AUTH_MDP, 'admin'),
             'survey/admin/valid'  => $this->make_hook('adminValidate', AUTH_MDP, 'admin'),
-            'survey/admin/del'    => $this->make_hook('adminDelete', AUTH_MDP, 'admin'),
+            'survey/admin/del'    => $this->make_hook('adminDelete',   AUTH_MDP, 'admin'),
         );
     }
     // }}}
index 003bbcf..c50cc12 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index d3c9c4e..2c04835 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,15 +24,15 @@ class XnetModule extends PLModule
     function handlers()
     {
         return array(
-            'index'     => $this->make_hook('index',     AUTH_PUBLIC),
-            'exit'      => $this->make_hook('exit',      AUTH_PUBLIC),
-
-            'admin'     => $this->make_hook('admin',     AUTH_MDP, 'admin'),
-            'groups'    => $this->make_hook('groups',    AUTH_PUBLIC),
-            'groupes.php' => $this->make_hook('groups2', AUTH_PUBLIC),
-            'plan'      => $this->make_hook('plan',      AUTH_PUBLIC),
-            'photo'     => $this->make_hook('photo',     AUTH_MDP),
-            'autologin' => $this->make_hook('autologin', AUTH_MDP),
+            'index'       => $this->make_hook('index',     AUTH_PUBLIC),
+            'exit'        => $this->make_hook('exit',      AUTH_PUBLIC),
+
+            'admin'       => $this->make_hook('admin',     AUTH_MDP, 'admin'),
+            'groups'      => $this->make_hook('groups',    AUTH_PUBLIC),
+            'groupes.php' => $this->make_hook('groups2',   AUTH_PUBLIC),
+            'plan'        => $this->make_hook('plan',      AUTH_PUBLIC),
+            'photo'       => $this->make_hook('photo',     AUTH_MDP),
+            'autologin'   => $this->make_hook('autologin', AUTH_MDP),
         );
     }
 
@@ -114,12 +114,24 @@ class XnetModule extends PLModule
         if (Post::has('diminutif')) {
             S::assert_xsrf_token();
 
-            XDB::query('INSERT INTO groupex.asso (id,diminutif)
-                                 VALUES(NULL,{?})', Post::v('diminutif'));
-            pl_redirect('../'.Post::v('diminutif').'/edit');
+            $res = XDB::query('SELECT  COUNT(*)
+                                 FROM  groupex.asso
+                                WHERE  diminutif = {?}',
+                              Post::v('diminutif'));
+
+            if ($res->fetchOneCell() == 0) {
+                XDB::execute('INSERT INTO  groupex.asso (id, diminutif)
+                                   VALUES  (NULL, {?})',
+                             Post::v('diminutif'));
+                pl_redirect('../' . Post::v('diminutif') . '/edit');
+            } else {
+                $page->trigError('Le diminutif demandé est déjà pris.');
+            }
         }
 
-        $res = XDB::query('SELECT nom,diminutif FROM groupex.asso ORDER by NOM');
+        $res = XDB::query('SELECT  nom, diminutif
+                             FROM  groupex.asso
+                         ORDER BY  nom');
         $page->assign('assos', $res->fetchAllAssoc());
     }
 
index 21d8435..f5cd0f4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -117,7 +117,7 @@ class XnetEventsModule extends PLModule
 
         $page->assign('archive', $archive);
         $evenements = XDB::iterator(
-                "SELECT  e.*, LEFT(10, e.debut) AS debut_day, LEFT(10, e.fin) AS fin_day,
+                "SELECT  e.*, LEFT(10, e.debut) AS first_day, LEFT(10, e.fin) AS last_day,
                          IF(e.deadline_inscription, e.deadline_inscription >= LEFT(NOW(), 10),
                             1) AS inscr_open, e.deadline_inscription,
                          u.nom, u.prenom, u.promo, a.alias,
@@ -133,6 +133,7 @@ class XnetEventsModule extends PLModule
 
         $evts = array();
         $undisplayed_events = 0;
+        $this->load('xnetevents.inc.php');
 
         while ($e = $evenements->next()) {
             if (!is_member() && !may_update() && !$e['accept_nonmembre']) {
@@ -167,6 +168,8 @@ class XnetEventsModule extends PLModule
                 $e['paid'] += trim($p);
             }
 
+            make_event_date($e);
+
             if (Env::has('updated') && $e['eid'] == Env::i('updated')) {
                 $page->assign('updated', $e);
             }
index 0454be5..fd17320 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -31,7 +31,7 @@ function get_event_detail($eid, $item_id = false, $asso_id = null)
         "SELECT SUM(nb) AS nb_tot, COUNT(DISTINCT ep.uid) AS nb, e.*,
                 IF(e.deadline_inscription, e.deadline_inscription >= LEFT(NOW(), 10),
                    1) AS inscr_open,
-                LEFT(10, e.debut) AS debut_day, LEFT(10, e.fin) AS fin_day,
+                LEFT(10, e.debut) AS first_day, LEFT(10, e.fin) AS last_day,
                 LEFT(NOW(), 10) AS now,
                 ei.titre,
                 al.vid AS absent_list, pl.vid AS participant_list,
@@ -107,6 +107,8 @@ function get_event_detail($eid, $item_id = false, $asso_id = null)
         $evt['telepaid'] += trim($p);
     }
 
+    make_event_date($evt);
+
     return $evt;
 }
 
@@ -252,6 +254,7 @@ function subscribe_lists_event($participate, $uid, $evt)
 }
 // }}}
 
+//  {{{ function event_change_shortname()
 function event_change_shortname(&$page, $eid, $old, $new)
 {
     global $globals;
@@ -266,6 +269,11 @@ function event_change_shortname(&$page, $eid, $old, $new)
                     et qu'il ne contient que des lettres non accentuées,
                     des chiffres ou les caractères - et .");
         return $old;
+    } elseif ($new && ctype_digit($new)) {
+        $page->trigError("Le raccourci demandé ne peut être accepté car il
+                         ne contient que des chiffres. Rajoute-lui par exemple
+                         une lettre.");
+        return $old;
     }
 
     //vérifier que l'alias n'est pas déja pris
@@ -345,6 +353,32 @@ function event_change_shortname(&$page, $eid, $old, $new)
     // cannot happen
     return $old;
 }
+// }}}
+
+//  {{{ function make_event_date()
+function make_event_date(&$e)
+{
+    $start     = strtotime($e['debut']);
+    $end       = strtotime($e['fin']);
+    $first_day = strtotime($e['first_day']);
+    $last_day  = strtotime($e['last_day']);
+    unset($e['debut'], $e['fin'], $e['first_day'], $e['last_day']);
+
+    $date = "";
+    if ($start && $end != $start) {
+        if ($first_day == $last_day) {
+          $date .= "le " . strftime("%d %B %Y", $start) . " de "
+                . strftime("%H:%M", $start) . " à " . strftime("%H:%M", $end);
+        } else {
+          $date .= "du " . strftime("%d %B %Y à %H:%M", $start)
+                . "\nau " . strftime("%d %B %Y à %H:%M", $end);
+        }
+    } else {
+        $date .= "le " . strftime("%d %B %Y à %H:%M", $start);
+    }
+    $e['date'] = $date;
+}
+// }}}
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>
index 53b7667..cc40a29 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -73,41 +73,34 @@ class XnetGrpModule extends PLModule
     function handlers()
     {
         return array(
-            '%grp'                => $this->make_hook('index',     AUTH_PUBLIC),
-            '%grp/asso.php'       => $this->make_hook('index',     AUTH_PUBLIC),
-            '%grp/logo'           => $this->make_hook('logo',      AUTH_PUBLIC),
-            '%grp/site'           => $this->make_hook('site',      AUTH_PUBLIC),
-            '%grp/edit'           => $this->make_hook('edit',      AUTH_MDP, 'groupadmin'),
-            '%grp/mail'           => $this->make_hook('mail',      AUTH_MDP, 'groupadmin'),
-            '%grp/forum'          => $this->make_hook('forum',     AUTH_MDP, 'groupmember'),
-            '%grp/annuaire'       => $this->make_hook('annuaire',  AUTH_MDP, 'groupannu'),
-            '%grp/annuaire/vcard' => $this->make_hook('vcard',     AUTH_MDP, 'groupmember:groupannu'),
-            '%grp/annuaire/csv'   => $this->make_hook('csv',       AUTH_MDP, 'groupmember:groupannu'),
-            '%grp/trombi'         => $this->make_hook('trombi',    AUTH_MDP, 'groupannu'),
-            '%grp/geoloc'         => $this->make_hook('geoloc',    AUTH_MDP, 'groupannu'),
-            '%grp/subscribe'      => $this->make_hook('subscribe', AUTH_MDP),
-            '%grp/subscribe/valid' => $this->make_hook('subscribe_valid', AUTH_MDP, 'groupadmin'),
-            '%grp/unsubscribe'    => $this->make_hook('unsubscribe', AUTH_MDP, 'groupmember'),
-
-            '%grp/change_rights'  => $this->make_hook('change_rights', AUTH_MDP),
-
-            '%grp/admin/annuaire'
-                 => $this->make_hook('admin_annuaire', AUTH_MDP, 'groupadmin'),
-
-            '%grp/member'
-                 => $this->make_hook('admin_member', AUTH_MDP, 'groupadmin'),
-            '%grp/member/new'
-                 => $this->make_hook('admin_member_new', AUTH_MDP, 'groupadmin'),
-            '%grp/member/new/ajax'
-                 => $this->make_hook('admin_member_new_ajax', AUTH_MDP, 'user', NO_AUTH),
-            '%grp/member/del'
-                 => $this->make_hook('admin_member_del', AUTH_MDP, 'groupadmin'),
-
-            '%grp/rss'             => $this->make_hook('rss', AUTH_PUBLIC, 'user', NO_HTTPS),
-            '%grp/announce/new'    => $this->make_hook('edit_announce', AUTH_MDP,  'groupadmin'),
-            '%grp/announce/edit'   => $this->make_hook('edit_announce', AUTH_MDP,  'groupadmin'),
-            '%grp/announce/photo'  => $this->make_hook('photo_announce', AUTH_PUBLIC),
-            '%grp/admin/announces' => $this->make_hook('admin_announce', AUTH_MDP, 'groupadmin'),
+            '%grp'                 => $this->make_hook('index',                 AUTH_PUBLIC),
+            '%grp/asso.php'        => $this->make_hook('index',                 AUTH_PUBLIC),
+            '%grp/logo'            => $this->make_hook('logo',                  AUTH_PUBLIC),
+            '%grp/site'            => $this->make_hook('site',                  AUTH_PUBLIC),
+            '%grp/edit'            => $this->make_hook('edit',                  AUTH_MDP,    'groupadmin'),
+            '%grp/mail'            => $this->make_hook('mail',                  AUTH_MDP,    'groupadmin'),
+            '%grp/forum'           => $this->make_hook('forum',                 AUTH_MDP,    'groupmember'),
+            '%grp/annuaire'        => $this->make_hook('annuaire',              AUTH_MDP,    'groupannu'),
+            '%grp/annuaire/vcard'  => $this->make_hook('vcard',                 AUTH_MDP,    'groupmember:groupannu'),
+            '%grp/annuaire/csv'    => $this->make_hook('csv',                   AUTH_MDP,    'groupmember:groupannu'),
+            '%grp/trombi'          => $this->make_hook('trombi',                AUTH_MDP,    'groupannu'),
+            '%grp/geoloc'          => $this->make_hook('geoloc',                AUTH_MDP,    'groupannu'),
+            '%grp/subscribe'       => $this->make_hook('subscribe',             AUTH_MDP),
+            '%grp/subscribe/valid' => $this->make_hook('subscribe_valid',       AUTH_MDP,    'groupadmin'),
+            '%grp/unsubscribe'     => $this->make_hook('unsubscribe',           AUTH_MDP,    'groupmember'),
+
+            '%grp/change_rights'   => $this->make_hook('change_rights',         AUTH_MDP),
+            '%grp/admin/annuaire'  => $this->make_hook('admin_annuaire',        AUTH_MDP,    'groupadmin'),
+            '%grp/member'          => $this->make_hook('admin_member',          AUTH_MDP,    'groupadmin'),
+            '%grp/member/new'      => $this->make_hook('admin_member_new',      AUTH_MDP,    'groupadmin'),
+            '%grp/member/new/ajax' => $this->make_hook('admin_member_new_ajax', AUTH_MDP,    'user', NO_AUTH),
+            '%grp/member/del'      => $this->make_hook('admin_member_del',      AUTH_MDP,    'groupadmin'),
+
+            '%grp/rss'             => $this->make_hook('rss',                   AUTH_PUBLIC, 'user', NO_HTTPS),
+            '%grp/announce/new'    => $this->make_hook('edit_announce',         AUTH_MDP,    'groupadmin'),
+            '%grp/announce/edit'   => $this->make_hook('edit_announce',         AUTH_MDP,    'groupadmin'),
+            '%grp/announce/photo'  => $this->make_hook('photo_announce',        AUTH_PUBLIC),
+            '%grp/admin/announces' => $this->make_hook('admin_announce',        AUTH_MDP,    'groupadmin'),
         );
     }
 
@@ -245,7 +238,7 @@ class XnetGrpModule extends PLModule
             } else {
                 $site = "";
             }
-            if (S::has_perms()) {
+            if (S::admin()) {
                 if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
                     $page->trigError("le domaine doit être un FQDN (aucune modif effectuée) !!!");
                     return;
@@ -297,7 +290,7 @@ class XnetGrpModule extends PLModule
             pl_redirect('../'.Post::v('diminutif', $globals->asso('diminutif')).'/edit');
         }
 
-        if (S::has_perms()) {
+        if (S::admin()) {
             $dom = XDB::iterator('SELECT * FROM groupex.dom ORDER BY nom');
             $page->assign('dom', $dom);
             $page->assign('super', true);
@@ -332,12 +325,18 @@ class XnetGrpModule extends PLModule
             $this->load('mail.inc.php');
             set_time_limit(120);
             $tos = get_all_redirects($mbr,  $mls, $mmlist);
+
             $upload = PlUpload::get($_FILES['uploaded'], S::user()->login(), 'xnet.emails', true);
+            if (!$upload && @$_FILES['uploaded']['name'] && PlUpload::$lastError != null) {
+                $page->trigError(PlUpload::$lastError);
+                return;
+            }
+
             send_xnet_mails($from, $sujet, $body, Env::v('wiki'), $tos, Post::v('replyto'), $upload, @$_FILES['uploaded']['name']);
             if ($upload) {
                 $upload->rm();
             }
-            $page->kill("Email envoyé !");
+            $page->killSuccess("Email envoyé !");
             $page->assign('sent', true);
         }
     }
@@ -604,7 +603,7 @@ class XnetGrpModule extends PLModule
                 $mailer->setSubject('['.$globals->asso('nom').'] Demande d\'inscription annulée');
                 $mailer->setTxtBody(Env::v('motif'));
                 $mailer->send();
-                $page->kill("La demande de {$user->fullName()} a bien été refusée.");
+                $page->killSuccess("La demande de {$user->fullName()} a bien été refusée.");
             } else {
                 $page->assign('show_form', true);
                 $page->assign('reason', $reason);
index 9d5c15b..c367967 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index a998e99..5751457 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index a22bf1d..036452e 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -28,29 +28,29 @@ class XnetListsModule extends ListsModule
     function handlers()
     {
         return array(
-            '%grp/lists'           => $this->make_hook('lists',     AUTH_MDP, 'groupmember'),
-            '%grp/lists/create'    => $this->make_hook('create',    AUTH_MDP, 'groupmember'),
+            '%grp/lists'              => $this->make_hook('lists',    AUTH_MDP, 'groupmember'),
+            '%grp/lists/create'       => $this->make_hook('create',   AUTH_MDP, 'groupmember'),
 
-            '%grp/lists/members'   => $this->make_hook('members',   AUTH_COOKIE),
-            '%grp/lists/csv'       => $this->make_hook('csv',       AUTH_COOKIE),
-            '%grp/lists/annu'      => $this->make_hook('annu',      AUTH_COOKIE),
-            '%grp/lists/archives'  => $this->make_hook('archives',  AUTH_COOKIE),
-            '%grp/lists/archives/rss' => $this->make_hook('rss',    AUTH_PUBLIC),
+            '%grp/lists/members'      => $this->make_hook('members',  AUTH_COOKIE),
+            '%grp/lists/csv'          => $this->make_hook('csv',      AUTH_COOKIE),
+            '%grp/lists/annu'         => $this->make_hook('annu',     AUTH_COOKIE),
+            '%grp/lists/archives'     => $this->make_hook('archives', AUTH_COOKIE),
+            '%grp/lists/archives/rss' => $this->make_hook('rss',      AUTH_PUBLIC),
 
-            '%grp/lists/moderate'  => $this->make_hook('moderate',  AUTH_MDP),
-            '%grp/lists/admin'     => $this->make_hook('admin',     AUTH_MDP),
-            '%grp/lists/options'   => $this->make_hook('options',   AUTH_MDP),
-            '%grp/lists/delete'    => $this->make_hook('delete',    AUTH_MDP),
+            '%grp/lists/moderate'     => $this->make_hook('moderate', AUTH_MDP),
+            '%grp/lists/admin'        => $this->make_hook('admin',    AUTH_MDP),
+            '%grp/lists/options'      => $this->make_hook('options',  AUTH_MDP),
+            '%grp/lists/delete'       => $this->make_hook('delete',   AUTH_MDP),
 
-            '%grp/lists/soptions'  => $this->make_hook('soptions',  AUTH_MDP),
-            '%grp/lists/check'     => $this->make_hook('check',     AUTH_MDP),
-            '%grp/lists/sync'      => $this->make_hook('sync',      AUTH_MDP),
+            '%grp/lists/soptions'     => $this->make_hook('soptions', AUTH_MDP),
+            '%grp/lists/check'        => $this->make_hook('check',    AUTH_MDP),
+            '%grp/lists/sync'         => $this->make_hook('sync',     AUTH_MDP),
 
-            '%grp/alias/admin'     => $this->make_hook('aadmin',    AUTH_MDP, 'groupadmin'),
-            '%grp/alias/create'    => $this->make_hook('acreate',   AUTH_MDP, 'groupadmin'),
+            '%grp/alias/admin'        => $this->make_hook('aadmin',   AUTH_MDP, 'groupadmin'),
+            '%grp/alias/create'       => $this->make_hook('acreate',  AUTH_MDP, 'groupadmin'),
 
             /* hack: lists uses that */
-            'profile' => $this->make_hook('profile', AUTH_PUBLIC),
+            'profile'                 => $this->make_hook('profile',  AUTH_PUBLIC),
         );
     }
 
@@ -104,7 +104,7 @@ class XnetListsModule extends ListsModule
         }
 
         $listes = $this->client->get_lists();
-        $page->assign('listes',$listes);
+        $page->assign('listes', $listes);
 
         $alias  = XDB::iterator(
                 'SELECT  alias,type
@@ -115,6 +115,13 @@ class XnetListsModule extends ListsModule
         $page->assign('alias', $alias);
 
         $page->assign('may_update', may_update());
+
+        if (count($listes) > 0 && !$globals->asso('has_ml')) {
+            XDB::execute("UPDATE  groupex.asso
+                             SET  flags = CONCAT_WS(',', IF(flags = '', NULL, flags), 'has_ml')
+                           WHERE  id = {?}",
+                         $globals->asso('id'));
+        }
     }
 
     function handler_create(&$page)
@@ -181,6 +188,12 @@ class XnetListsModule extends ListsModule
                                     VALUES ({?}, {?})', XDB::insertId(),
                                    $red . $mdir . '@listes.polytechnique.org');
         }
+
+        XDB::execute("UPDATE  groupex.asso
+                         SET  flags = CONCAT_WS(',', IF(flags = '', NULL, flags), 'has_ml')
+                       WHERE  id = {?}",
+                     $globals->asso('id'));
+
         pl_redirect('lists/admin/'.$liste);
     }
 
index 07ce7c3..66cb09c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index b3960c7..fd4c8d9 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 5064bdf..1a66dae 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index ea6d629..0d012fc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index e17b738..ebfa2f3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index 932c998..0b4b856 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
index bd7ac0f..0b581b7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -21,7 +21,7 @@
 
 function smarty_insert_getName()
 {
-    $uid = Cookie::v('ORGuid', -1);
+    $uid = Cookie::v('uid', -1);
     if ($uid < 0) {
         return "";
     }
index 08dd7df..47e6251 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -23,28 +23,28 @@ function smarty_insert_getUsername()
 {
     global $globals;
 
-    $id = Cookie::i('ORGuid', -1);
+    $id = Cookie::i('uid', -1);
     $id = S::v($_SESSION['uid'], $id);
 
     if ($id<0) {
         return "";
     }
 
-    if (Cookie::v('ORGdomain', 'login') != 'alias') {
-       $res = XDB::query("SELECT  alias FROM aliases
-                                     WHERE  id={?} AND (type IN ('a_vie','alias') AND FIND_IN_SET('bestalias', flags))", $id);
-       return $res->fetchOneCell();
+    if (Cookie::v('domain', 'login') != 'alias') {
+        $res = XDB::query("SELECT  alias FROM aliases
+                            WHERE  id={?} AND (type IN ('a_vie','alias') AND FIND_IN_SET('bestalias', flags))", $id);
+        return $res->fetchOneCell();
     } else {
-       $res = XDB::query("
-               SELECT v.alias
-                 FROM virtual AS v
-           INNER JOIN virtual_redirect USING(vid)
-           INNER JOIN aliases AS a ON(id={?} AND a.type='a_vie')
-                 WHERE redirect = CONCAT(a.alias, {?})
-                      OR redirect = CONCAT(a.alias, {?})",
-               $id, "@".$globals->mail->domain, "@".$globals->mail->domain2);
-       $alias = $res->fetchOneCell();
-       return substr($alias, 0, strpos($alias, "@"));
+        $res = XDB::query("
+            SELECT  v.alias
+              FROM  virtual AS v
+        INNER JOIN  virtual_redirect USING(vid)
+        INNER JOIN  aliases AS a ON(id={?} AND a.type='a_vie')
+             WHERE  redirect = CONCAT(a.alias, {?})
+                    OR redirect = CONCAT(a.alias, {?})",
+            $id, "@".$globals->mail->domain, "@".$globals->mail->domain2);
+        $alias = $res->fetchOneCell();
+        return substr($alias, 0, strpos($alias, "@"));
      }
 
      return $login;
index 648ff7d..b260754 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 98e4bec..aa58ba0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 623929a..b4a80bb 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 71c084a..1bef29b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -23,7 +23,7 @@
 
 
 <form action="admin/deaths" method="post">
-  <table class="tinybicol">
+  <table class="bicol">
     <tr>
       <td>
         <input type="submit" value="GO" style="visibility: hidden" />
index fc71ae8..f4e91bb 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 9f1c04e..dc962b7 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 33c88c4..b217f1c 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 1b1064e..03fc0a6 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index bdc5473..0dd9434 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -78,6 +78,8 @@
       <a href="admin/downtime">Coupures</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="admin/icons">Icônes</a>
+      &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="sql_errors">Erreurs MySQL</a>
     </td>
   </tr>
 
     </td>
   </tr>
   <tr class="pair">
-    <td class="titre">Newletter</td>
+    <td class="titre">Newsletter</td>
     <td>
       <a href="admin/newsletter">Liste</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
   <tr class="impair">
     <td class="titre">AX-Letter</td>
     <td>
-      <a href="ax/edit">Edition</a>
+      <a href="ax/edit">Édition</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="admin/axletter">Inscriptions et Permissions</a>
+      <a href="admin/axletter">Inscriptions et permissions</a>
     </td>
   </tr>
   <tr class="pair">
index 0a526b9..625ea8d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index aefc855..ae9e58a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index da2f164..8c6ee06 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3a53289..6019ee0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b2961f1..61c2d6b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3023779..0f968c0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5d3c207..ebe905c 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index e28ffeb..408b86e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 40c645b..d935d67 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 16bab10..ffa0fa5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index cf5ecdb..a7a019d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index bc53055..d4523c4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5ae5706..5f8f059 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 16f9942..70a388b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 4473714..1648c9a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2006 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7ea449f..5b5096c 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 6565ffc..80df304 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}\r
 {*                                                                        *}\r
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}\r
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}\r
 {*  http://opensource.polytechnique.org/                                  *}\r
 {*                                                                        *}\r
 {*  This program is free software; you can redistribute it and/or modify  *}\r
index 129e096..f44ef2b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 49addfd..79352c7 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 07725fc..828a87c 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 59b40f9..f5ef990 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 47d982b..ea7705b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b1b468a..9b97c1d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 9f4872c..12bdc12 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index c5d0b45..f478942 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -43,11 +43,6 @@ Si tu n'es pas {insert name="getName"}, change le login ci-dessous, ou rends-toi
 </p>
 {/if}
 
-{if $smarty.request.response}<!-- failed login code //-->
-{include core=triggers.tpl text="Erreur d'identification. Essaie à nouveau !" type="errors"}
-<br />
-{/if}
-
 <form action="{$smarty.server.REQUEST_URI}" method="post" id="login" onsubmit="doChallengeResponse(); return false;" style="display: none">
   <table class="bicol" cellpadding="4" summary="Formulaire de login">
     <tr>
@@ -65,9 +60,8 @@ Si tu n'es pas {insert name="getName"}, change le login ci-dessous, ou rends-toi
         <input type="text" name="username" size="20" maxlength="50" value="{insert name="getUserName"}" />&nbsp;@&nbsp;<select name="domain">
           <option value="login">{#globals.mail.domain#} / {#globals.mail.domain2#}</option>
           <option value="alias" {if $smarty.cookies.ORGdomain eq alias}selected="selected"{/if}>
-          {#globals.mail.alias_dom#} / {#globals.mail.alias_dom2#}
+            {#globals.mail.alias_dom#} / {#globals.mail.alias_dom2#}
           </option>
-          {$smarty.cookies.domain}
         </select>
       </td>
     </tr>
index ab3e410..981205e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 {*                                                                        *}
 {**************************************************************************}
 
+<h1>{icon name=error} Page sécurisée</h1>
 
-<div class="center">
-  <table>
-    <tr>
-      <td>
-        {icon name=error}
-      </td>
-      <td>
-        <span class="smaller">
-          <strong>
-            Pour des raisons de <span class="erreur">sécurité</span>, il est obligatoire de taper ton mot de passe, même
-            avec l'accès permanent, pour certaines opérations sensibles.
-          </strong>
-        </span>
-      </td>
-      <td>
-        {icon name=error}
-      </td>
-    </tr>
-  </table>
+<div>
+  La page que tu as demandée est classée comme sensible. Il est nécessaire de taper ton mot de passe
+  pour y accéder, même avec l'accès permanent activé.
 </div>
 <br />
 
 <form action="{$smarty.server.REQUEST_URI}" method="post" id="login" onsubmit='doChallengeResponse(); return false;'>
-  <table class="tinybicol" cellpadding="4" summary="Formulaire de login">
+  <table class="bicol" cellpadding="4" summary="Formulaire de login">
+    <tr>
+      <td class="titre">
+        Nom d'utilisateur&nbsp;:
+      </td>
+      <td>{$smarty.session.hruid}</td>
+      <td class="right" rowspan="3" style="vertical-align: middle">
+        <input  type="submit" name="submitbtn" value="Envoyer" />
+      </td>
+    </tr>
     <tr>
       <td class="titre">
         Mot de passe&nbsp;:
@@ -53,9 +47,6 @@
         <input type="password" name="password" size="10" maxlength="256" />
         &nbsp;<a href="recovery">Perdu&nbsp;?</a>
       </td>
-      <td class="right" rowspan="2" style="vertical-align: middle">
-        <input  type="submit" name="submitbtn" value="Envoyer" />
-      </td>
     </tr>
     <tr>
       <td {popup caption='Connexion permanente' width='300' text='Décoche cette case pour que le site oublie ce navigateur.<br />
   </table>
 </form>
 <br />
-{if $smarty.request.response}<!-- failed login code -->
-{include core=triggers.tpl text="Erreur d'identification. Essaie à nouveau !" type="errors"}
-{/if}
 
 <!-- Set up the form with the challenge value and an empty reply value -->
 <form action="{$smarty.server.REQUEST_URI}" method="post" id="loginsub">
   <div>
     {xsrf_token_field}
     <input type="hidden" name="challenge" value="{$smarty.session.challenge}" />
-    <input type="hidden" name="username"  value="{$smarty.cookies.ORGuid}" />
+    <input type="hidden" name="username"  value="{$smarty.session.uid}" />
     <input type="hidden" name="xorpass"  value="" />
     <input type="hidden" name="remember"  value="" />
     <input type="hidden" name="response"  value="" />
index ec7ed66..f963a20 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f4d88bc..2e69955 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f94ceed..d73e103 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index c017119..69eefeb 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -35,7 +35,7 @@ En effet, il faut nous donner l'adresse qui se cache derrière l'adresse polytec
 correspondant si tu veux que nous puissions te répondre.
 </p>
 {elseif $x && $x.nb_mails}
-<h2>Patte Cassée</h2>
+<h2>Patte cassée</h2>
   <p>
     Ton correspondant a à l'heure actuelle <span class="erreur">{$x.nb_mails} adresse(s) email(s) de redirection active(s)
     en dehors de celle que tu nous as communiquée</span>. Cela ne veut pas forcément dire qu'il les avait
@@ -47,7 +47,7 @@ correspondant si tu veux que nous puissions te répondre.
     <a href="emails/broken/warn/{$email}?token={xsrf_token}">clique sur ce lien</a>.
   </p>
 {elseif $x}
-<h2>Patte Cassée</h2>
+<h2>Patte cassée</h2>
   <p>
     Désolé, mais ton correspondant, {$x.prenom} {$x.nom} (X{$x.promo}),
     n'a actuellement <span class="erreur">aucune adresse email de redirection 
index ec3dbad..55c3d38 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index cf29b4a..ffe8ed2 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3e76f33..b8f7e05 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 1c99a1e..6024919 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index c6456c7..c0b537d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7ae7343..16649e5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index aefdb25..3b9283a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index bfd0f4b..a365aa6 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 
 <p>
   <small>{icon name=information title="Envoi d'email"} Pour envoyer un email, tu peux soit le faire depuis l'interface
-  ci-dessous, soit utiliser <a href="Xorg/SMTPSecurise">notre serveur d'envoi SMTP<a>.</small>
+  ci-dessous, soit utiliser <a href="Xorg/SMTPSecurise">notre serveur d'envoi SMTP</a>.</small>
 </p>
 
 <form action="emails/send" method="post" enctype="multipart/form-data" id="form_mail" onsubmit="return check(this);">
index 74670c5..04543f3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5737395..b2641d2 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 81255e0..2caa447 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ff9f08a..e0e8c09 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index d0e183b..67472ee 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b0f903f..2ee8a68 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -41,65 +41,12 @@ Bienvenue {$smarty.session.prenom}{if $birthday}
 </div>
 {/if}
 
-{if $smarty.session.no_redirect}
-<div class="errors">
-  <ul>
-    <li>
-      Tu n'as plus de redirection valide ce qui rend ton adresse Polytechnique.org
-      inutilisable. Rends-toi au plus vite sur <a href="emails/redirect">la page de 
-      gestion des emails</a> pour corriger ce problème.
-    </li>
-  </ul>
-</div>
-{/if}
-
-{if $smarty.session.mx_failures|@count}
-<div class="warnings">
-  {icon name=error} Des problèmes sont actuellement recontrés sur tes redirections suivantes :
-  <ul>
-    {foreach from=$smarty.session.mx_failures item=mail}
-    <li>
-      <span class="erreur">{$mail.mail}</span> :
-      <span class="explication">{$mail.text}</span>
-    </li>
-    {/foreach}
-  </ul>
-  <div style="text-align: center"><a href="emails/redirect">Gérer mes adresses de redirection</a></div>
-</div>
-{/if}
-
-{if $fiche_incitation || $photo_incitation || ($geoloc_incitation > 0)}
-<div class="warnings">
-  <ul>
-{if $fiche_incitation}
-  <li>
-    La dernière mise à jour de ta
-    <a href="profile/{$smarty.session.hruid}" class="popup2">fiche</a>
-    date du {$fiche_incitation|date_format}.
-    Il est possible qu'elle ne soit pas à jour.
-    Si tu souhaites la modifier, <a href="profile/edit">clique ici !</a>
-  </li>
-{/if}
-
-{if $photo_incitation}
-  <li>
-    Tu n'as pas mis de photo de toi sur ta fiche, c'est dommage.
-    Clique <a href="photo/change">ici</a> si tu souhaites en ajouter une.
-  </li>
-{/if}
-
-{if $geoloc_incitation > 0}
-  <li>
-    Parmi tes adresses, il y en a {$geoloc_incitation} que nous n'avons pas pu localiser.
-    Clique <a href="profile/edit/adresses">ici</a> pour rectifier.
-  </li>
-{/if}
-  </ul>
-</div>
+{if $reminder}
+{include file="reminder/base.tpl"}
+{else}
+{include file="include/tips.tpl" full=true}
 {/if}
 
-{include file="include/tips.tpl" full=true}
-  
   <table class="tinybicol" id="menu-evts">
     {foreach from=$events name=events key=category item=evenement}
     <tr class="pair" style="height: 18px">
@@ -177,7 +124,7 @@ Bienvenue {$smarty.session.prenom}{if $birthday}
   -->
   {/literal}
   </script>
+
   {foreach from=$events key=category item=evenement}
   {foreach item=ev from=$evenement}
   {if $ev.nonlu}
index 465d757..f9063ba 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 54df094..37ceff1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index a8edfa8..ba45ad4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b6ab0c6..e4032ba 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f077f08..6dcfd75 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 6a0d9d7..2d5880a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2a403ee..64a931e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index a1c469c..73a8c5a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ae4eae4..40b1f98 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 9c6b69e..4135749 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 07a227a..bf924d2 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 70b4a8d..9cbe2e1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index a16a54e..490acd9 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 177232a..d7fa392 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}\r
 {*                                                                        *}\r
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}\r
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}\r
 {*  http://opensource.polytechnique.org/                                  *}\r
 {*                                                                        *}\r
 {*  This program is free software; you can redistribute it and/or modify  *}\r
index 6debb08..46e2f18 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}\r
 {*                                                                        *}\r
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}\r
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}\r
 {*  http://opensource.polytechnique.org/                                  *}\r
 {*                                                                        *}\r
 {*  This program is free software; you can redistribute it and/or modify  *}\r
index 2906484..9e543e9 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 89c421d..db64810 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f7d88fc..9fdda87 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 56638c9..bfe0289 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 8b6331b..9b5a937 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 13b6776..69b591a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -22,7 +22,7 @@
 
 <h1>Compte Google Apps</h1>
 
-{if $account}
+{if $account && $account->provisioned()}
 {assign var=a value=$account}
 <table class="bicol">
   <col width="50%" />
   {/if}
   <tr class="impair">
     <td class="titre">Mots de passes synchronisés</td>
-    <td>
-      {if $a->sync_password}
-        oui (<a href="admin/googleapps/user/{$a->g_account_name}/forcesync">lancer une synchronisation</a>)
-      {else}non{/if}
-    </td>
+    <td>{if $a->sync_password}oui{else}non{/if}</td>
   </tr>
   <tr class="impair">
     <td class="titre">Redirection des emails</td><td>{if $googleapps_storage}activée{else}désactivee{/if}</td>
   <tr class="pair">
     <td class="titre">Utilisation du quota d'emails</td><td>{$a->r_disk_usage/1024/1024|string_format:"%.2f"}MB</td>
   </tr>
+
+  <tr class="impair">
+    <td class="titre">Alias email du compte</td>
+    <td>{foreach from=$a->nicknames() item=nickname}{$nickname}<br />{/foreach}{$a->g_account_name}</td>
+  </tr>
 </table><br />
 
+<form action="admin/googleapps/user/{$a->g_account_name}" method="post">
+  {xsrf_token_field}
+  <table class="bicol">
+    <tr>
+      <th colspan="2" style="text-align: left">Actions sur le compte</th>
+    </tr>
+
+    <tr class="impair">
+      <td colspan="2" class="titre">Statut du compte</td>
+    </tr>
+    <tr class="impair">
+      <td>&nbsp;</td>
+      <td>
+        {if $a->pending_update_suspension}
+        <div class="erreur smaller">Le statut du compte est en cours de changement. Aucune opération n'est possible.</div>
+        {elseif $a->active()}
+        <input type="submit" name="suspend" value="Suspendre le compte" />
+        {elseif $a->suspended()}
+        <input type="submit" name="unsuspend" value="Réactiver le compte" />
+        {/if}
+      </td>
+    </tr>
+
+    <tr class="pair">
+      <td colspan="2" class="titre">Mot de passe</td>
+    </tr>
+    <tr class="pair">
+      <td>&nbsp;</td>
+      <td>
+        {if !$a->active()}
+        <div class="erreur smaller">Aucune opération n'est possible sur un compte inactif.</div>
+        {elseif $a->pending_update_password}
+        <div class="erreur smaller">Le mot de passe du compte est en cours de changement. Aucune opération n'est possible.</div>
+        {elseif $a->sync_password}
+        <input type="submit" name="forcesync" value="Synchroniser les mots de passes maintenant" />
+        <input type="submit" name="nosync" value="Désactiver la synchronisation automatique" />
+        {else}
+        <input type="submit" name="sync" value="Activer la synchronisation automatique" />
+        {/if}
+      </td>
+    </tr>
+  </table><br />
+</form>
+
 <table class="bicol" style="text-align: center">
   <tr>
     <th colspan="4" style="text-align: left">Requêtes en attente</th>
   </tr>
   {/iterate}
 </table>
+{elseif $account}
+<p><strong>Cet utilisateur n'a pas de compte Google Apps.</strong></p>
 {else}
 <p><strong>Aucun utilisateur n'a été trouvé.</strong></p>
 {/if}
index 9c73203..654baa5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index e6925f1..a2091ca 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 
 <table class="bicol" id="status">
   <tr>
-    <th>État de ton compte</th>
+    <th colspan="2">État de ton compte</th>
   </tr>
   <tr class="impair">
-    <td>Ton compte <b>{$account->g_account_name}</b> existe{if $account->r_creation} depuis le {$account->r_creation|date_format:"%d/%m/%Y"}{/if}.</td>
+    <td colspan="2">Ton compte <b>{$account->g_account_name}</b> existe{if $account->r_creation} depuis le {$account->r_creation|date_format:"%d/%m/%Y"}{/if}.</td>
   </tr>
   {if $account->reporting_date and $account->r_disk_usage}
   <tr class="pair">
-    <td>Au {$account->reporting_date|date_format:"%d %B %Y"}, tu avais {$account->r_disk_usage/1024/1024|string_format:"%.1f"} Mo d'emails.</td>
+    <td colspan="2">Au {$account->reporting_date|date_format:"%d %B %Y"}, tu avais {$account->r_disk_usage/1024/1024|string_format:"%.1f"} Mo d'emails.</td>
   </tr>
   {/if}
+  {if $redirect_active and $redirect_unique}
   <tr class="impair">
-    {if $redirect_active and $redirect_unique}
-    <td>
+    <td class="middle">{icon name=error}</td>
+    <td class="smaller">
       Ta seule adresse de redirection de tes emails est celle de ton compte Google Apps.<br />
       Si tu souhaites désactiver celui-ci, tu dois d'abord <a href="emails/redirect">ajouter une nouvelle adresse de redirection</a>.
     </td>
-    {else}
-    <td>
+  </tr>
+  {else}
+  <tr class="impair">
+    <td colspan="2">
       Si tu ne souhaites plus utiliser ton compte, tu peux le désactiver :<br /><br />
       <div class="center">
         <form action="googleapps/suspend" method="post">
           <input type="submit" name="suspend" value="Désactiver mon compte Google Apps" />
         </form>
       </div>
-      <div style="margin-top: 0.5em">
-        {icon name=error} Une fois ton compte désactivé, tu ne pourras plus accéder à tes emails sur Google Apps.<br />
-        {icon name=information} La réactivation est possible, mais nécessite d'être validée par un administrateur.
-      </div>
     </td>
-    {/if}
   </tr>
+  <tr class="impair">
+    <td class="middle">{icon name=error}</td>
+    <td class="smaller">
+      Une fois ton compte désactivé, tu ne pourras plus accéder à tes emails sur Google Apps.
+      La réactivation est possible, mais nécessite d'être validée par un administrateur.
+    </td>
+  </tr>
+  {/if}
 </table>
 <br />
 
 <table class="bicol" id="password">
   <tr>
-    <th>Ton mot de passe Google Apps</th>
-  </tr>
-  {if $account->sync_password}
-  <tr class="impair">
-    <td>
-      Le mot de passe de ton compte Google Apps est actuellement celui que tu utilises pour
-      Polytechnique.org. Tu peux :
-    </td>
+    <th colspan="2">Ton mot de passe Google Apps</th>
   </tr>
 
   {if $account->pending_update_password}
   <tr class="pair">
-    <td><div class="erreur">
+    <td class="middle">{icon name=error}</td>
+    <td><div class="erreur smaller">
       Ton mot de passe est en cours de changement.<br />
       Tu pourras à nouveau le modifier d'ici quelques secondes.
     </div></td>
   </tr>
+
   {else}
-  <tr class="impair">
-    <td>
-      <ul style="margin-top: 0">
-        <li><a href="password">Changer ce mot de passe commun</a></li>
-        <li><a href="googleapps/password/nosync#password">Ne plus répercuter les changements de mot de passe vers Google Apps</a></li>
-      </ul>
-    </td>
-  </tr>
-  {/if}
-  {else}
-  <tr class="impair">
-    <td>
-      Tu as actuellement deux mots de passes indépendants (pour ton compte Polytechnique.org et pour ton compte Google Apps).
-      Tu peux :
+  <tr class="pair">
+    <td></td><td>
+      <form action="googleapps/password" method="post">
+        {xsrf_token_field}
+        <label>
+          <input type="radio" name="pwsync" value="sync" onchange="this.form.submit();"
+              {if $account->sync_password}checked="checked" {/if}/>
+          Utiliser le même mot de passe pour Polytechnique.org et Google Apps.</label><br />
+        <label>
+          <input type="radio" name="pwsync" value="nosync" onchange="this.form.submit();"
+              {if !$account->sync_password}checked="checked" {/if}/>
+          Utiliser deux mots de passes différents pour Polytechnique.org et Google Apps.</label><br />
+      </form>
     </td>
   </tr>
 
-  {if $account->pending_update_password}
-  <tr class="pair">
-    <td><div class="erreur">
-      Ton mot de passe est en cours de changement.<br />
-      Tu pourras à nouveau le modifier d'ici quelques secondes.
-    </div></td>
-  </tr>
+  {if $account->sync_password}
+  <tr class="impair"><td colspan="2">
+    Tes mots de passes Polytechnique.org et Google Apps sont identiques et synchronisés.
+    <div class="center"><a href="password">Changer ce mot de passe commun</a></div>
+  </td></tr>
+
   {else}
-  <tr class="impair">
-    <td>
-      <ul style="margin-top: 0">
-        <li style="margin-bottom: 1em">
-          <a href="googleapps/password/sync">Choisir d'utiliser le même mot de passe pour les deux comptes.</a><br />
-          Attention, cette opération changera ton mot de passe Google Apps.
-        </li>
-        <li>
-          Changer le mot de passe de ton compte Google Apps&nbsp;:<br /><br />
-          <form action="googleapps/password#password" method="post" id="changepass">
-            <table class="tinybicol">
-              <tr>
-                <td class="titre">Nouveau mot de passe</td>
-                <td><input type="password" name="nouveau" /></td>
-              </tr>
-              <tr>
-                <td class="titre">Vérification</td>
-                <td><input type="password" name="nouveau2" /></td>
-              </tr>
-              <tr>
-                <td class="titre">Sécurité</td>
-                <td>{checkpasswd prompt="nouveau" submit="create_account" text="Changer mon mot de passe"}</td>
-              </tr>
-              <tr>
-                <td></td>
-                <td><input type="submit" name="create_account" value="Changer" onclick="EnCryptedResponse(); return false;" /></td>
-              </tr>
-            </table>
-          </form>
-          <form action="googleapps/password#password" method="post" id="changepass2">
-            {xsrf_token_field}
-            <input type="hidden" name="response2"  value="" />
-          </form><br />
-          Pour une sécurité optimale, ton mot de passe circule de manière sécurisée (https).
-          Il est chiffré irréversiblement sur nos serveurs, ainsi que sur ceux de Google.
-        </li>
-      </ul>
-    </td>
-  </tr>
+  <tr class="impair"><td colspan="2">
+    Changer le mot de passe de ton compte Google Apps&nbsp;:<br /><br />
+    <form action="googleapps/password" method="post" id="changepass">
+      <table class="bicol">
+        <tr>
+          <td class="titre">Nouveau mot de passe</td>
+          <td><input type="password" name="nouveau" /></td>
+        </tr>
+        <tr>
+          <td class="titre">Vérification</td>
+          <td><input type="password" name="nouveau2" /></td>
+        </tr>
+        <tr>
+          <td class="titre">Sécurité</td>
+          <td>{checkpasswd prompt="nouveau" submit="create_account" text="Changer mon mot de passe"}</td>
+        </tr>
+        <tr>
+          <td></td>
+          <td><input type="submit" name="create_account" value="Changer" onclick="EnCryptedResponse(); return false;" /></td>
+        </tr>
+      </table>
+    </form>
+    <form action="googleapps/password" method="post" id="changepass2">
+      {xsrf_token_field}
+      <input type="hidden" name="response2"  value="" />
+    </form><br />
+    Pour une sécurité optimale, ton mot de passe circule de manière sécurisée (https).
+    Il est chiffré irréversiblement sur nos serveurs, ainsi que sur ceux de Google.
+  </td></tr>
   {/if}
   {/if}
 </table>
index f5cfa0d..3c746d2 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ac48047..6046b01 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f0fdfae..36219dc 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7f99db9..195592e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5b881c0..e12e13b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 155f26a..839110d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ca61ffc..aba4bd2 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 90a9555..707d519 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 09376ea..434b9da 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7524ee2..f0f0dfe 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 712391f..d257b26 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 84b9943..36c7ff8 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ef75dfa..163f57d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index cd163d3..00fb6e7 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7b9a903..3d62b4d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7671432..e1c09c9 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 619f2e7..7e718da 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 86db5df..6e4deea 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 38456a4..978674a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 8f09dd7..7f034b3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 1a47a2f..d4c4741 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 0262ba2..0865f7e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 762928d..f685137 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ec4ad5a..4bcdf96 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 61d6779..30d91a6 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 9efa2fc..fa4535b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
         <td class="lt">Profession&nbsp;:</td>
         <td class="rt">
           {if $c.job_web}<a href="{$c.job_web}">{$c.entreprise}</a>{else}{$c.entreprise}{/if}
-          {if $c.secteur}({$c.secteur}){/if} {if $c.fonction}<br />{$c.fonction}{/if}
+          {if $c.secteur} ({$c.secteur}){/if}{if $c.fonction}<br />{$c.fonction}{/if}
         </td>
       </tr>
       {/if}
index 371315e..a0952fd 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 4753463..38e3c78 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ebe8c1f..76d47c3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index bdedf25..971dd4e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 334fdbf..532f461 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index e49bf6f..29cc27a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 600d82a..6c21930 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 58d0019..94a7d03 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b5e214f..fe0dca1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index fae9304..5897120 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 14a12cf..a6edb77 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 1541c76..af6a2bb 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 4300641..f9eb533 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2f8d862..59619d0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index fc6bf82..bea5fa1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index eba1869..04e1841 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 71cec2b..b4a9cbb 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index fae3deb..f9dce9f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2dc364e..478bd83 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 61b68ac..ac605a8 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index d77a3e1..0a01c81 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 6ffd2f0..dcaa134 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 68c51a6..a5dff93 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 54a7f86..55df279 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index e01068e..1baaca4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index dc202bb..c00a55d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index d32c459..3701aa4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -39,13 +39,13 @@ Cet utilisateur a une inscription en cours depuis le {$pending|date_format}.
 </p>
 <p>
 {if $relance eq '0000-00-00'}
-il n'a jamais été relancé.
+Il n'a jamais été relancé.
 {else}
-sa dernière relance date du {$relance|date_format}
+Sa dernière relance date du {$relance|date_format}.
 {/if}
 </p>
 
-<p>[<a href='{$path}/insrel?token={xsrf_token}'>le relancer</a>]</p>
+<p>[<a href='{$path}/insrel?token={xsrf_token}'>Le relancer</a>]</p>
 
 {/if}
 
index 5ba0dbe..44b4775 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index a2eab2e..507f9f8 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 715901c..8b6d26f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 46ad33b..d3639c4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 946a8ce..deddacb 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3195411..cac08f1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ccf6a48..533d19e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b417724..fb3063f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 72b3a8f..2b2a4ee 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index cd6ecd3..a7af201 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 53fb976..6bbac35 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 94e5889..6d08638 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 6e273c5..600439e 100644 (file)
@@ -1,3 +1,25 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  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  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
 <?xml version="1.0" encoding="UTF-8"?>
 <xrds:XRDS
     xmlns:xrds="xri://$xrds"
@@ -11,3 +33,5 @@
     </Service>
   </XRD>
 </xrds:XRDS>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 75ab15a..f47cce0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 
 <h1>Page d'identité OpenId de {$user->fullName()}</h1>
 
-<p>OpenID est un système d'authentification décentralisé. Cette page permet 
-à des sites web tiers d'identifier {$user->displayName()}, grâce à son compte 
+<p>OpenID est un système d'authentification décentralisé. Cette page permet
+à des sites web tiers d'identifier {$user->displayName()}, grâce à son compte
 Polytechnique.org.<p>
 
-<p><a href="Xorg/OpenId">En savoir plus sur OpenId</a></p>
\ No newline at end of file
+<p><a href="Xorg/OpenId">En savoir plus sur OpenId</a></p>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index fa5f68e..438fa7b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 
 <h1>Demande d'identification OpenId</h1>
 
-<p>Le site <strong>{$relying_party}</strong> demande à confirmer votre identité.</p>
+<p>Un site tiers demande à confirmer ton identité OpenId.
+  {if $sreg_data}
+    De plus, il a demandé à recevoir un certain nombre d'informations
+    te concernant.
+  {/if}
+  Merci de nous indiquer ton choix.
+</p><br />
 
-{if $sreg_data neq null}
-<p>Les informations suivantes lui seront transmises :</p>
-<ul>
-{foreach from=$sreg_data key=field item=value}
-<li><i>{$field}</i> : {$value}</li>
-{/foreach}
-</ul>
-{/if}
+<form method="POST" action="openid/trust?{$openid_query}">
+  {xsrf_token_field}
+  <table class="bicol">
+    <tr><th colspan="2">Souhaitez-vous confirmer votre identité ?</th></tr>
 
+    <tr class="impair">
+      <td>Adresse du site&nbsp;:</td>
+      <td><strong>{$relying_party}</strong></td>
+    </tr>
+    {if $sreg_data}
+    <tr class="impair">
+      <td>Informations demandées&nbsp;:</td>
+      <td><ul style="margin-top: 0">
+        {foreach from=$sreg_data key=field item=value}
+        <li><strong>{$field}</strong> ({$value})</li>
+        {/foreach}
+      </ul></td>
+    </tr>
+    {/if}
 
-<p><strong>Souhaitez-vous confirmer votre identité ?</strong></p>
+    <tr class="pair">
+      <td></td>
+      <td>
+        <label><input type="checkbox" name="trust_always" />
+          Toujours faire confiance à ce site.</label><br />
+        {if $sreg_data}
+        <label><input type="checkbox" checked="checked" name="trust_sreg" />
+          Envoyer les données ci-dessus au site.</label><br />
+        {/if}
+      </td>
+    </tr>
+    <tr class="impair center"><td colspan="2">
+      <input type="submit" name="trust_accept" value="Confirmer" />
+      <input type="submit" name="trust_cancel" value="Annuler" />
+    </td></tr>
+  </table>
+</form>
 
-<div class="form">
-  <form method="post" action="openid/trust">
-    <input type="checkbox" name="always" /> Toujours faire confiance à ce site<br />
-    <input type="submit" name="trust" value="Confirmer" />
-    <input type="submit" value="Annuler" />
-  </form>
-</div>
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 323f515..6b07054 100644 (file)
@@ -1,3 +1,25 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  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  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
 <?xml version="1.0" encoding="UTF-8"?>
 <xrds:XRDS
     xmlns:xrds="xri://$xrds"
@@ -18,3 +40,5 @@
     </Service>
   </XRD>
 </xrds:XRDS>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index e7b0a49..f5eba5b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 40df8fe..b424d98 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -32,5 +32,5 @@ réception de ton paiement.</p>
 
 <p>{$texte|nl2br}</p>
 {/if}
-<p>[<a href='payment'>retour aux Télépaiements</a>]</p>
+<p>[<a href="https://www.polytechnique.org/payment">retour aux Télépaiements</a>]</p>
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 2a0d182..4f661ce 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -43,7 +43,7 @@ Voici la liste des paiements en ligne possible pour le groupe {$asso.nom} :
     Tu es inscrit à cet événements.
       {if $ev.topay > $ev.paid}
       <a href="{$platal->ns}payment/{$p.id}?montant={math equation="a-b" a=$ev.topay b=$ev.paid}">
-        Tu dois encore payer {math equation="a-b" a=$ev.topay b=$ev.paid}&euro;
+        Tu dois encore payer {math equation="a-b" a=$ev.topay b=$ev.paid}&euro;.
       </a>
       {elseif $ev.topay eq $ev.paid}
       Tu as déjà réglé l'intégralité de ton inscription ({$ev.topay}&euro;).
index bd7e2bd..35d3fef 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index e5574be..d1d8215 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index d58f3b8..6f63785 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 26cd81c..a03d18a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 1230abf..2520650 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 44dd82e..e4f4c48 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3b0f5db..c564d76 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ecaa4cf..38e3bcf 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b025472..ab26a57 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3e0b48d..dce0458 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 08a8eb4..db20af1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -28,13 +28,6 @@ couleurs, ça ne se discute pas. Certains préfèrent une page sérieuse, d'autr
 fantaisiste. A toi de voir&nbsp;:)
 </p>
 <p>
-Note aux utilisateurs du navigateur Netscape 4.x ou équivalent.
-La fonctionalité "skins" n'est hélas pas compatible avec ces navigateurs
-qui ne respectent pas les standards du web. <br />
-Pour profiter de toutes les fonctionnalités de {#globals.core.sitename#},
-nous te conseillons de télécharger une version récente de ton navigateur.
-</p>
-<p>
 Pour toute information complémentaire, n'hésite pas à écrire à
 <a href="mailto:support@{#globals.mail.domain#}?subject=navigateur">support@{#globals.mail.domain#}</a>
 </p>
index e91eead..770c00a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index fa9b58a..c3c301f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index a8e0f9e..2008833 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7af1a5d..3fe02ce 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index c0b7287..8679831 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 60c0391..a49004b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 810a3af..845279d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 83cbfba..6ae64c0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 198ec25..e87e41c 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 4e76dcf..46df4a2 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 496c803..091da7d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2be806f..54fdf5d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index e5c869b..86070e6 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index d674f0c..52996f4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ecc88d9..b9c6b49 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 901bf2d..8738089 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ace46af..b146549 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5a22d5a..0a624fe 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3bfa587..835b2cd 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 587cc57..6a7abc9 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index e8bf0cb..edefb1d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 52bc047..846e929 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ad3816d..e6a0cd3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 0be0c9b..d0f4474 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 6d940dd..4662872 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index d88ca68..98590c6 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index de41dae..1afa5c2 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b7ab7c7..bd2d5e3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 44ab0c9..c0147d5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 9402d91..fab01b3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index bad7df1..d2d594f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -32,7 +32,7 @@ Ton inscription sur Polytechnique.org est presque terminée !
 
 Après activation, tes paramètres de connexion seront :
 
-login        : {$mailorg}
+identifiant  : {$mailorg}
 mot de passe : {$pass}
 
 Nous te proposerons de remplacer ce mot de passe temporaire par un mot de passe de ton choix.
index 97d2b03..f6e46ca 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 4da0c4c..71fdace 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 1cdde60..4a41294 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -54,7 +54,7 @@
         {math equation="(promo % 100) + 100" promo=$promo}532)<br />
         {/if}
         Voir sur le GU ou un bulletin de solde pour trouver cette information<br /><br />
-        Pour les élèves étrangers voie 2, il est du type&nbsp;:
+        Pour les élèves étrangers voie 2, il peut être aussi du type&nbsp;:
         {if $promo < 1999}
         {math equation="(promo + 1) % 100" promo=$promo}0XXX
         {else}
index 6d4ee7e..bc10f19 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index efec315..a42c1d5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 0d806d5..626d742 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -142,7 +142,7 @@ il te faudra contacter l'équipe support.
       de recevoir les informations plus spécifiques de ta promotion pour pouvoir participer plus facilement aux événements
       qu'elle organise. Nous t'inscrivons donc dans le groupe de la promotion {$smarty.session.promo}.
     </dd>
-    <dt><label><input type='checkbox' value='1' checked="checked" name='imap' />imap</label></dt>
+    <dt><label><input type='checkbox' value='1' checked="checked" name='imap' /> sauvegarde des emails</label></dt>
     <dd>
       d'avoir un accès de secours aux 30 derniers jours d'emails reçus sur ton adresse Polytechnique.org.
     </dd>
diff --git a/templates/reminder/base.tpl b/templates/reminder/base.tpl
new file mode 100644 (file)
index 0000000..404a306
--- /dev/null
@@ -0,0 +1,51 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  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  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<div id="reminder">
+  <fieldset class="warnings">
+    <legend>
+      {if $reminder->warning()}{icon name=error}{else}{icon name=information}{/if}
+      &nbsp;{$reminder->title()}
+    </legend>
+
+    {if $reminder->template()}
+      {include file=$reminder->template()}
+    {else}
+      <div style="margin-bottom: 0.5em">
+        {$reminder->text()}
+      </div>
+      <div class="center">
+        <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/yes'); return false" style="text-decoration: none">
+          {icon name=add} M'inscrire
+        </a> -
+        <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/no'); return false" style="text-decoration: none">
+          {icon name=delete} Ne pas m'inscrire
+        </a> -
+        <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/dismiss'); return false" style="text-decoration: none">
+          {icon name=cross} Décider plus tard
+        </a>
+      </div>
+    {/if}
+  </fieldset>
+</div>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
diff --git a/templates/reminder/email_warning.tpl b/templates/reminder/email_warning.tpl
new file mode 100644 (file)
index 0000000..cd04b2a
--- /dev/null
@@ -0,0 +1,34 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  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  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+Des problèmes sont actuellement recontrés sur tes redirections suivantes&nbsp;:
+<ul>
+  {foreach from=$smarty.session.mx_failures item=mail}
+  <li>
+    <span class="erreur">{$mail.mail}</span> :
+    <span class="explication">{$mail.text}</span>
+  </li>
+  {/foreach}
+</ul>
+<div style="text-align: center"><a href="emails/redirect">Gérer mes adresses de redirection</a></div>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
diff --git a/templates/reminder/ml.tpl b/templates/reminder/ml.tpl
new file mode 100644 (file)
index 0000000..8a26ada
--- /dev/null
@@ -0,0 +1,53 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  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  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<form action="{$reminder->baseurl()}/suscribe" method="post">
+  {xsrf_token_field}
+  Des camarades souhaitent que tu t'inscrives aux listes suivantes&nbsp;:
+  <dl>
+    {foreach from=$lists key=list item=details}
+    <dt>
+      <label>
+        <input type='checkbox' value='1' checked="checked" name="sub_ml[{$list}]" />
+        {$list}*&nbsp;: {$details.desc}
+      </label>
+    </dt>
+    {if $details.info}
+    <dd>
+      {$details.info|nl2br}
+    </dd>
+    {/if}
+    {/foreach}
+  </dl>
+
+  <div class="center">
+    <input type="submit" value="M'inscrire aux listes" /> -
+    <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/no'); return false" style="text-decoration: none">
+      {icon name=delete} Ne pas m'inscrire
+    </a> -
+    <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/dismiss'); return false" style="text-decoration: none">
+      {icon name=cross} Décider plus tard
+    </a>
+  </div>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
diff --git a/templates/reminder/no_redirection.tpl b/templates/reminder/no_redirection.tpl
new file mode 100644 (file)
index 0000000..a07f2ea
--- /dev/null
@@ -0,0 +1,27 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  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  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+Tu n'as plus de redirection valide ce qui rend ton adresse Polytechnique.org
+inutilisable. Rends-toi au plus vite sur <a href="emails/redirect">la page de
+gestion des emails</a> pour corriger ce problème.
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
diff --git a/templates/reminder/profile_update.tpl b/templates/reminder/profile_update.tpl
new file mode 100644 (file)
index 0000000..065d949
--- /dev/null
@@ -0,0 +1,45 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  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  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+{if $profile_incitation}
+  La dernière mise à jour de ta <a href="profile/{$smarty.session.hruid}" class="popup2">fiche</a>
+  date du {$profile_last_update|date_format}. Il est possible qu'elle ne soit pas à jour.
+  Si tu souhaites la modifier,
+  <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/profile'); return false" style="text-decoration: none">
+  clique ici !</a>
+{elseif $photo_incitation}
+  Tu n'as pas mis de photo de toi sur ta fiche, c'est dommage. Clique
+  <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/photo'); return false" style="text-decoration: none">
+  ici</a> si tu souhaites en ajouter une.
+{elseif $geocoding_incitation > 0}
+  Parmi tes adresses, il y en a {$geocoding_incitation} que nous n'avons pas pu localiser. Clique
+  <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/geoloc'); return false" style="text-decoration: none">
+  ici</a> pour rectifier.
+{/if}
+
+<div class="right">
+  <a href="" onclick="Ajax.update_html('reminder', '{$reminder->baseurl()}/dismiss'); return false" style="text-decoration: none">
+    {icon name=cross} Mettre à jour plus tard
+  </a>
+</div>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index 3aba3c2..2fcc841 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
   <table class="bicol" cellpadding="3" summary="Recherche">
     <tr>
       <th colspan="2">
-        Recherche avancée [<a href="search">&lt;&lt;&lt;&nbsp;Recherche simple</a>]
+        Recherche avancée [<a href="search">Revenir à la Recherche simple</a>]
       </th>
     </tr>
     <tr>
index 2372f6d..d4492af 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index dd13ea1..a839cd0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5058d57..66c8b0f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 0c7ed25..d6693ec 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -27,7 +27,7 @@
     {if $smarty.session.auth ge AUTH_COOKIE}
     <tr>
       <th colspan="2">
-        Recherche simple <span class="noprint">[<a href="search/adv">&gt;&gt;&gt;&nbsp;Recherche&nbsp;avancée</a>]</span>
+        Recherche simple
       </th>
     </tr>
     <tr>
       </td>
     </tr>
     <tr class="noprint">
-      <td style="width: 78%">
+      <td style="width: 60%">
         <input type="checkbox" name="with_soundex" id="with_soundex" value="1" {if $smarty.request.with_soundex}checked="checked"{/if} /> <label for="with_soundex">Activer la recherche par proximité sonore.</label>
         <br /><input type='checkbox' name='order' id="order" value='date_mod' {if $smarty.request.order eq "date_mod"}checked='checked'{/if} /> <label for="order">Mettre les fiches modifiées récemment en premier.</label>
         <br /><input type='checkbox' name='nonins' id="nonins" {if $smarty.request.nonins}checked='checked'{/if} value='1' /> <label for="nonins">Chercher uniquement des non inscrits.</label>
       </td>
     {else}
     <tr class="noprint">
-      <td style="width: 78%">
+      <td style="width: 60%">
         <input type='text' name="quick" value="{$smarty.request.quick}" style="width: 98%" /><br />
       </td>
     {/if}
-      <td class="right" style="vertical-align: middle">
-        <input type="submit" value="Chercher" />
+      <td class="right">
+        [<a href="search/adv">Recherche avancée</a>]
+        <br /><br /><input type="submit" value="Chercher" />
       </td>
     </tr>
   </table>
index ff85d43..acf617d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -95,16 +95,16 @@ notre base de données.
 <h2>Raccourcis...</h2>
 <p>
   Un certain nombre de raccourcis permettent d'accéder plus rapidement au contenu du site&nbsp;:
-  <ul>
-    <li><code>fiche:prenom.nom.promo</code> ouvre la fiche du camarade indiquée&nbsp;;</li>
-    <li><code>ref:prenom.nom.promo</code> ouvre la fiche référent du camarade indiquée&nbsp;;</li>
-    <li><code>doc:phrase</code> recherche <em>phrase</em> dans la documentation du site&nbsp;;</li>
-    {if hasPerm('admin')}
-    <li><code>admin:prenom.nom.promo</code> ouvre la fiche d'administration du camarade indiquée&nbsp;;</li>
-    <li><code>ax:prenom.nom.promo</code> ouvre la fiche ax du camarade concerné.</li>
-    {/if}
-  </ul>
 </p>
+<ul>
+  <li><code>fiche:prenom.nom.promo</code> ouvre la fiche du camarade indiquée&nbsp;;</li>
+  <li><code>ref:prenom.nom.promo</code> ouvre la fiche référent du camarade indiquée&nbsp;;</li>
+  <li><code>doc:phrase</code> recherche <em>phrase</em> dans la documentation du site&nbsp;;</li>
+  {if hasPerm('admin')}
+  <li><code>admin:prenom.nom.promo</code> ouvre la fiche d'administration du camarade indiquée&nbsp;;</li>
+  <li><code>ax:prenom.nom.promo</code> ouvre la fiche ax du camarade concerné.</li>
+  {/if}
+</ul>
 
 <p>
   Ces raccourcis fonctionnement également depuis le lien de recherche rapide disponible sur toutes les pages
index 102a8d0..6254dbe 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}\r
 {*                                                                        *}\r
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}\r
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}\r
 {*  http://opensource.polytechnique.org/                                  *}\r
 {*                                                                        *}\r
 {*  This program is free software; you can redistribute it and/or modify  *}\r
index 77460e8..26e242b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 587ec39..a8a2d99 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 708acbd..f90d8e7 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -21,7 +21,7 @@
 {**************************************************************************}
 
 <div>
-  Plat/al <a href="changelog">{#globals.version#}</a> - Copyright © 1999-2008 <a href="http://x-org.polytechnique.org/">Polytechnique.org</a>
+  Plat/al <a href="changelog">{#globals.version#}</a> - Copyright © 1999-2009 <a href="http://x-org.polytechnique.org/">Polytechnique.org</a>
   &nbsp;-&nbsp;
   <a href="Reference/Convention-AX">Lien avec l'AX</a>
   &nbsp;-&nbsp;
index 97811c5..aa133a5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3952609..f73cfb8 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -87,7 +87,7 @@
 <div class="menu_item"><a href="http://support.polytechnique.org">Support</a></div>
 
 <table class="bicol" style="font-weight:normal;text-align:center; border-left:0px; border-right:0px; margin-top:0.5em; width:100%; margin-left: 0; font-size: smaller;">
-  <tr><th>Valid</th></tr>
+  <tr><th>Validations</th></tr>
   <tr class="impair">
     <td>
       <a href="admin/validate">
index 4b96a0d..39b9f51 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
                 {$globals->core->NbIns|number_format} polytechniciens sur le web
                 <form action="search" method="get">
                     <div>
-                        <input type="text" size="30" name="quick" class="quick_search"
-                               value="{$smarty.request.quick|default:"recherche dans l'annuaire"}"
-                               onfocus="if (this.value == '{$smarty.request.quick|default:"recherche dans l'annuaire"|escape:javascript}') this.value=''"
-                               onblur="if (this.value == '') this.value='{$smarty.request.quick|default:"recherche dans l'annuaire"|escape:javascript}'"/>
+                        <input type="text" size="20" name="quick" id="quick" class="quick_search"
+                               value="{$smarty.request.quick|default:"Recherche dans l'annuaire"}"
+                               onfocus="if (this.value === 'Recherche dans l\'annuaire') this.value='';
+                                        $('#quick_button').show()"
+                               onblur="if (this.value === '') this.value='{$smarty.request.quick|default:"Recherche dans l'annuaire"|escape:javascript}'
+                                       $('#quick_button').hide()"/>
+                        <button id="quick_button" type="submit" style="display: none"
+                                onclick="if ($('#quick').val() === 'Recherche dans l\'annuaire') $('#quick').val('')">
+                          OK
+                        </button>
                     </div>
                 </form>
                 {if $smarty.session.auth gt AUTH_PUBLIC && $smarty.session.notifs}
index 24976cf..26bcad1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index d56c182..bba4f3c 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 58339b4..8e6fe1f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 48eb40b..94e5a13 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 8598c12..4eb4ef0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2c85956..d1fe666 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ea3eaa6..ea7df94 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5fc6ab8..81e66a3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2df74f3..366926c 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 127ab7f..616cacb 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7378635..c3b5ff1 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7701206..604f02d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 50716c3..c4317d8 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 308da45..c8adc6e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 678f4f1..fc105ff 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5f1b2a3..4132f69 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 8a2705d..eee9f04 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5e5552a..0b18898 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index c2fcb34..339f0e4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index efe98fc..a2468b7 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 957e5ed..8cbed67 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index db03ee6..8efae26 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 71cab1c..f0e379a 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index c6350f2..9198c86 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 94375a3..9e95fc4 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f18f17f..41b955d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 30b1c5c..d6c2435 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3282556..1bae87f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 71accdb..0baf34f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 26d1df2..778f232 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index dca5faa..a5f52fe 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f18f17f..41b955d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f18f17f..41b955d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 9362807..5f0ba1b 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3479967..c248d92 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index fe025dc..006ea0d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 47f8682..c8746de 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 3896067..31f0836 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7c3aced..8748004 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2b6e21d..4c76106 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 060bcf6..b66192d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 8e6c20b..b8f47f0 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 80b078a..caa4669 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index a8d0302..4dd81bd 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2eb9aa3..f6abc30 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index fe44a1a..2cd5c22 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 1a9ebc1..90e9b71 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index c706a8f..ac5f663 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 938c4ce..5054da7 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index a51f744..58dc473 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f882ccb..b6f5a22 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index f90a53e..f133987 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
             - <a href="send_bug/{ $smarty.server.REQUEST_URI }" class="popup_840x600">signaler un bug</a>
           {/if}
           <br />
-          Plat/al {#globals.version#} - © Copyright 2000-2008 <a href="http://x-org.polytechnique.org/">Association Polytechnique.org</a>
+          Plat/al {#globals.version#} - © Copyright 2000-2009 <a href="http://x-org.polytechnique.org/">Association Polytechnique.org</a>
           <div class="pem">
             <a href="{$globals->baseurl}/pem/{$platal->pl_self()|replace:'/':'_'}/200">Liste1</a>
             <a href="{$globals->baseurl}/pem/{$platal->pl_self()|replace:'/':'_'}/400">Liste2</a>
index 0938cfb..ab83d43 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 <h1>{$asso.nom}&nbsp;: <a href='{$platal->ns}events'>Événements</a> </h1>
 
 <p>
-L'événement {$evt.intitule}
-{if $evt.titre} - {$evt.titre}
-{/if}
-{if $evt.titre || count($moments) eq 1}
-comptera {$evt.nb_tot} personne{if $evt.nb_tot > 1}s{/if}.
-{else}
-({$evt.nb} personne{if $evt.nb > 1}s ont réalisé leur{else} a réalisé son{/if} inscription).
-{/if}
+  {if $evt.titre || count($moments) eq 1}
+  {$evt.nb_tot} personne{if $evt.nb_tot > 1}s ont réalisé leur {else} a réalisé son {/if}
+  {else}
+  {$evt.nb} personne{if $evt.nb > 1}s ont réalisé leur{else} a réalisé son {/if}
+  {/if}
+  inscription à l'événement {$evt.intitule} {if $evt.titre}- {$evt.titre} {/if}
+  qui aura lieu {$evt.date}.
 </p>
 
 {if $evt.participant_list && $is_admin}
index 7ae6a65..4798a0d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 1aab7e1..1ed7346 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software, you can redistribute it and/or modify  *}
index 8dcc8f1..f282b58 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -184,7 +184,8 @@ Ton inscription à [METS LE NOM DE L'EVENEMENT ICI] a bien été enregistrée et
 
 -- 
 {$smarty.session.prenom} {$smarty.session.nom}{/if}</textarea><br />
-        Page internet de l'événement&nbsp;: <input size="40" name="site" value="{$paiement_site|default:$asso.site|default:$globals->baseurl|cat:'/'|cat:$platal->ns}" /><br />
+        {assign var='asso_url' value=$globals->baseurl|cat:'/'|cat:$platal->ns}
+        Page internet de l'événement&nbsp;: <input size="40" name="site" value="{$paiement_site|default:$asso.site|default:$asso_url}" /><br />
         Le nouveau paiement sera activé automatiquement après validation par le trésorier de Polytechnique.org,
         ce qui sera fait sous peu.
         <script type="text/javascript">//<![CDATA[
index d090d5c..5311d07 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
 
   <tr>
     <td class="titre">Date&nbsp;:</td>
-    <td>
-      {if $e.fin and $e.fin neq $e.debut}
-        {if $e.debut_day eq $e.fin_day}
-          le {$e.debut|date_format:"%d %B %Y"} de {$e.debut|date_format:"%H:%M"} à {$e.fin|date_format:"%H:%M"}
-        {else}
-          du {$e.debut|date_format:"%d %B %Y à %H:%M"}<br />
-          au {$e.fin|date_format:"%d %B %Y à %H:%M"}
-        {/if}
-      {else}
-        le {$e.debut|date_format:"%d %B %Y à %H:%M"}
-      {/if}
-    </td>
+    <td>{$e.date}</td>
   </tr>
 
   <tr>
index 99722cd..f69470e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 7c19e95..695fe59 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -30,7 +30,7 @@
   Cet événement a lieu 
   <strong>
   {if $event.fin and $event.fin neq $event.debut}
-    {if $event.debut_day eq $event.fin_day}
+    {if $event.first_day eq $event.last_day}
       le {$event.debut|date_format:"%d %B %Y"} de {$event.debut|date_format:"%H:%M"} à {$event.fin|date_format:"%H:%M"}
     {else}
       du {$event.debut|date_format:"%d %B %Y à %H:%M"}<br />
index 470b09d..bbfe549 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<h1>{$asso.nom}&nbsp;: Administration des announces</h1>
+<h1>{$asso.nom}&nbsp;: Administration des annonces</h1>
 
 <table class="bicol">
   <tr>
index 98e0092..ce18b19 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index dd33b99..5afe6b5 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 30e6a7c..1ce4ca9 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software, you can redistribute it and/or modify  *}
index 6fd19d6..94e8a22 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -34,6 +34,7 @@ Le groupe {$asso.nom} compte {$nb_tot} membres&nbsp;:
       Ajouter un membre
     </a>
   </li>
+  {if $asso.has_ml}
   <li>
     <a href="{$platal->ns}admin/annuaire">
       {icon name=wand title="Synchroniser"} 
@@ -41,6 +42,7 @@ Le groupe {$asso.nom} compte {$nb_tot} membres&nbsp;:
     </a>
   </li>
   {/if}
+  {/if}
   <li>
     <a href="{$platal->ns}annuaire/csv/{$asso.diminutif}.csv">
       {icon name=page_excel title="Fichier Excel"} 
index 1febab4..35f3727 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index ce41fd6..ce76dbf 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 0dfe367..554cbdc 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 17d200e..b56abee 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index b79e460..26aa4a3 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -60,7 +60,7 @@
 {elseif $smarty.post.inscrire}
 
 <p class="descr">
-<strong>Ta demande d'inscription a bien été envoyée !</strong> Tu seras averti par email de la suite qui lui sera donnée.
+<strong>Ta demande d'inscription a bien été envoyée !</strong> Tu seras averti{if $user->isFemale()}e{/if} par email de la suite qui lui sera donnée.
 <p>
 <p class="descr">[<a href="{$platal->ns}">Retour à la page d'accueil de {$asso.nom}</a>]</p>
 
@@ -94,8 +94,6 @@ https://www.polytechnique.org/profile/{$smarty.session.hruid}
 </textarea>
   <div class="center">
     <input type="submit" name="inscrire" value="M'inscrire !" />
-    &nbsp;
-    <input type="reset" value="Annuler" />
   </div>
 </form>
 
index c108df4..1e01018 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -136,8 +136,7 @@ Nous avons le plaisir de t'adresser la lettre mensuelle du groupe {$asso.nom}.
 (insérer le texte...)
 
 Le bureau du groupe {$asso.nom}.
-{/if}
-         </textarea>
+{/if}</textarea>
       </td>
     </tr>
     <tr>
index bd354b8..b01018d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -103,4 +103,10 @@ function searchX()
   </table>
 </form>
 
+{literal}
+<script type="text/javascript">
+  $("#email").focus();
+</script>
+{/literal}
+
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index cec88a5..7bbd86e 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 62c2675..e1769dd 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
@@ -49,7 +49,7 @@
 <h2>
   Édition du profil de {if "`$user.prenom` `$user.nom`"|trim}{$user.prenom} {$user.nom}{else}{$user.email}{/if}
   {if $user.origine eq 'X'}
-  (X{$user.promo})
+  &nbsp;(X{$user.promo})
   <a href="https://www.polytechnique.org/profile/{$user.alias}">{icon name=user_suit title="fiche"}</a>
   {/if}
   <a href="{$platal->ns}member/del/{$user.email}">{icon name=delete title="Suppression du compte"}</a>
index 2595c79..572411f 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 324833d..51348c9 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 6067133..8636f73 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 91ddf3e..4195959 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 688dd92..4c3d79d 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 2f94331..7fc9f43 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 42b1191..3a2dcda 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
index 5916750..eb720dd 100644 (file)
@@ -1,6 +1,6 @@
 {**************************************************************************}
 {*                                                                        *}
-{*  Copyright (C) 2003-2008 Polytechnique.org                             *}
+{*  Copyright (C) 2003-2009 Polytechnique.org                             *}
 {*  http://opensource.polytechnique.org/                                  *}
 {*                                                                        *}
 {*  This program is free software; you can redistribute it and/or modify  *}
diff --git a/upgrade/0.10.1/00_inscription.sql b/upgrade/0.10.1/00_inscription.sql
new file mode 100644 (file)
index 0000000..a23ef9e
--- /dev/null
@@ -0,0 +1,36 @@
+DROP TABLE IF EXISTS reminder_type;
+
+CREATE TABLE IF NOT EXISTS reminder_type (
+  type_id INT NOT NULL AUTO_INCREMENT,
+  name VARCHAR(255) NOT NULL,
+  weight INT NOT NULL,
+  remind_delay_yes INT NOT NULL DEFAULT 0,
+  remind_delay_no INT NOT NULL DEFAULT 0,
+  remind_delay_dismiss INT NOT NULL DEFAULT 0,
+  PRIMARY KEY(type_id),
+  UNIQUE KEY(name)
+) CHARSET=utf8;
+
+INSERT INTO  reminder_type (name, weight, remind_delay_yes, remind_delay_no, remind_delay_dismiss)
+     VALUES  ('email_warning', 100, 0, 0,   7),
+             ('no_redirection', 100, 0, 0,  1),
+             ('profile_update', 90, 0, 0,   2),
+             ('nl',             80, 0, 365, 7),
+             ('promotion_ml',   70, 0, 365, 7),
+             ('ml',             70, 0, 0,   7),
+             ('email_backup',   60, 0, 365, 7),
+             ('gapps',          50, 0, 365, 7),
+             ('ax_letter',      50, 0, 365, 14);
+
+DROP TABLE IF EXISTS reminder;
+
+CREATE TABLE IF NOT EXISTS reminder (
+  uid INT NOT NULL,
+  type_id INT NOT NULL,
+  status ENUM('yes', 'no', 'dismiss') NOT NULL,
+  remind_last TIMESTAMP NOT NULL,
+  remind_next TIMESTAMP NULL,
+  PRIMARY KEY(uid, type_id)
+) CHARSET=utf8;
+
+-- vim:set syntax=mysql:
diff --git a/upgrade/0.10.1/01_groupex.sql b/upgrade/0.10.1/01_groupex.sql
new file mode 100644 (file)
index 0000000..e52291e
--- /dev/null
@@ -0,0 +1,3 @@
+ALTER TABLE groupex.asso CHANGE COLUMN flags flags SET('wiki_desc', 'notif_unsub', 'has_ml') NOT NULL;
+
+-- vim:set syntax=mysql:
index 2e66895..a1b7bb0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *