Merge commit 'origin/master' into fusionax
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 10 Aug 2008 12:39:23 +0000 (14:39 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 10 Aug 2008 12:39:23 +0000 (14:39 +0200)
Conflicts:

htdocs/xorg.php
templates/profile/general.tpl

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
59 files changed:
ChangeLog
classes/platalglobals.php.in
classes/xnetsession.php
classes/xorgsession.php
htdocs/javascript/ajax.js
htdocs/xnet.php
htdocs/xorg.php
include/rss.inc.php
include/wiki.inc.php [deleted file]
include/wiki/engine.php [deleted file]
modules/admin.php
modules/auth.php
modules/axletter.php
modules/carnet.php
modules/email.php
modules/events.php
modules/forums.php
modules/geoloc.php
modules/googleapps.php
modules/lists.php
modules/marketing.php
modules/newsletter.php
modules/payment.php
modules/platal.php
modules/platal/review.inc.php
modules/profile.php
modules/register.php
modules/search.php
modules/search/classes.inc.php
modules/search/search.inc.php
templates/banana/index.tpl
templates/carnet/notif.mail.tpl
templates/carnet/notifs.tpl
templates/core/password_prompt.tpl
templates/core/password_prompt_logged.tpl
templates/emails/redirect.tpl
templates/gadgets/ig-minifiche.tpl
templates/googleapps/index.tpl
templates/include/emploi.tpl
templates/include/flags.radio.tpl
templates/include/plview.trombi.tpl
templates/lists/check.tpl
templates/lists/moderate_sub.tpl
templates/marketing/private.tpl
templates/marketing/promo.tpl
templates/platal/filrss.tpl
templates/profile/deco.tpl
templates/profile/general.tpl
templates/profile/groups.tpl
templates/profile/mentor.tpl
templates/register/step2.tpl
templates/search/adv.form.tpl
templates/skin/common.devel.tpl
templates/survey/error.tpl
templates/xnetevents/edit.tpl
templates/xnetgrp/annuaire.tpl
templates/xnetgrp/asso.tpl
templates/xnetgrp/membres-add.tpl
templates/xnetgrp/membres-edit.tpl

index 7f27fb5..ae3c74f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 ================================================================================
 VERSION 0.9.18                                                        XX XX XXXX
 
+Bug/Wish:
+
+    * Search:
+        - #691: Adds search on postcode and thus on "arrondissements"      -JAC
+        - #791: Adds the possibility to do an exact search                 -JAC
+        - #822: Adds the possibility to search on diplomas                 -JAC
 
 ================================================================================
 VERSION 0.9.17                                                        19 07 2008
index 409b68c..43140c6 100644 (file)
@@ -38,6 +38,10 @@ class PlatalGlobals extends PlGlobals
     public function __construct()
     {
         parent::__construct(array('platal.ini', 'platal.conf'));
+    }
+
+    public function init()
+    {
         $this->bootstrap(array('NbIns'), array($this, 'updateNbIns'));
         $this->bootstrap(array('NbValid'), array($this, 'updateNbValid'));
     }
index 73dd844..3f9dca1 100644 (file)
@@ -130,6 +130,32 @@ class XnetSession extends PlSession
         return true;
     }
 
+    public function tokenAuth($login, $token)
+    {
+        // FIXME: we broke the session here because some RSS feeds (mainly wiki feeds) require
+        // a valid nome and checks the permissions. When the PlUser object will be ready, we'll
+        // be able to return a simple 'PlUser' object here without trying to alterate the
+        // session.
+        $res = XDB::query('SELECT  u.user_id AS uid, u.perms, u.nom, u.nom_usage, u.prenom, u.promo, FIND_IN_SET(\'femme\', u.flags) AS sexe
+                             FROM  aliases         AS a
+                       INNER JOIN  auth_user_md5   AS u ON (a.id = u.user_id AND u.perms IN ("admin", "user"))
+                       INNER JOIN  auth_user_quick AS q ON (a.id = q.user_id AND q.core_rss_hash = {?})
+                            WHERE  a.alias = {?} AND a.type != "homonyme"', $token, $login);
+        if ($res->numRows() == 1) {
+            $sess = $res->fetchOneAssoc();
+            if (!S::has('uid')) {
+                $_SESSION = $sess;
+                $this->makePerms($sess['perms']);
+                return S::i('uid');
+            } else if (S::i('uid') == $sess['uid']) {
+                return S::i('uid');
+            } else {
+                Platal::page()->kill('Invalid state. To be fixed when hruid is ready');
+            }
+        }
+        return null;
+    }
+
     public function doSelfSuid()
     {
         if (!$this->startSUID(S::i('uid'))) {
index 14a7c81..48a2664 100644 (file)
@@ -184,6 +184,8 @@ class XorgSession extends PlSession
             S::set('auth', AUTH_COOKIE);
         }
         unset($_SESSION['log']);
+
+        // Retrieves main user properties.
         $res  = XDB::query('SELECT  u.user_id AS uid, prenom, prenom_ini, nom, nom_ini, nom_usage, perms, promo, promo_sortie,
                                     matricule, password, FIND_IN_SET(\'femme\', u.flags) AS femme,
                                     a.alias AS forlife, a2.alias AS bestalias,
@@ -198,6 +200,8 @@ class XorgSession extends PlSession
         $sess = $res->fetchOneAssoc();
         $perms = $sess['perms'];
         unset($sess['perms']);
+
+        // Retrieves account usage information (last login, last host).
         $res = XDB::query('SELECT  UNIX_TIMESTAMP(s.start) AS lastlogin, s.host
                              FROM  logger.sessions AS s
                             WHERE  s.uid = {?} AND s.suid = 0
@@ -206,15 +210,17 @@ class XorgSession extends PlSession
         if ($res->numRows()) {
             $sess = array_merge($sess, $res->fetchOneAssoc());
         }
-        $suid = S::v('suid');
 
-        if ($suid) {
+        // Loads the data into the real session.
+        $_SESSION = array_merge($_SESSION, $sess);
+
+        // Starts the session's logger, and sets up the permanent cookie.
+        if (S::has('suid')) {
+            $suid = S::v('suid');
             $logger = S::logger($uid);
-            $logger->log("suid_start", S::v('forlife')." by {$suid['uid']}");
-            $sess['suid'] = $suid;
+            $logger->log("suid_start", S::v('forlife') . " by " . $suid['uid']);
         } else {
             $logger = S::logger($uid);
-            //$logger->log("connexion", Env::v('n'));
             setcookie('ORGuid', $uid, (time() + 25920000), '/', '', 0);
             if (Post::v('remember', 'false') == 'true') {
                 $cookie = hash_encrypt($sess['password']);
@@ -230,7 +236,7 @@ class XorgSession extends PlSession
             }
         }
 
-        $_SESSION = array_merge($_SESSION, $sess);
+        // Finalizes the session setup.
         $this->makePerms($perms);
         $this->securityChecks();
         $this->setSkin();
@@ -261,6 +267,32 @@ class XorgSession extends PlSession
         }
     }
 
+    public function tokenAuth($login, $token)
+    {
+        // FIXME: we broke the session here because some RSS feeds (mainly wiki feeds) require
+        // a valid nome and checks the permissions. When the PlUser object will be ready, we'll
+        // be able to return a simple 'PlUser' object here without trying to alterate the
+        // session.
+        $res = XDB::query('SELECT  u.user_id AS uid, u.perms, u.nom, u.nom_usage, u.prenom, u.promo, FIND_IN_SET(\'femme\', u.flags) AS sexe
+                             FROM  aliases         AS a
+                       INNER JOIN  auth_user_md5   AS u ON (a.id = u.user_id AND u.perms IN ("admin", "user"))
+                       INNER JOIN  auth_user_quick AS q ON (a.id = q.user_id AND q.core_rss_hash = {?})
+                            WHERE  a.alias = {?} AND a.type != "homonyme"', $token, $login);
+        if ($res->numRows() == 1) {
+            $sess = $res->fetchOneAssoc();
+            if (!S::has('uid')) {
+                $_SESSION = $sess;
+                $this->makePerms($sess['perms']);
+                return S::i('uid');
+            } else if (S::i('uid') == $sess['uid']) {
+                return S::i('uid');
+            } else {
+                Platal::page()->kill('Invalid state. To be fixed when hruid is ready');
+            }
+        }
+        return null;
+    }
+
     public function makePerms($perm)
     {
         $flags = new PlFlagSet();
index 33cd83b..71797f0 100644 (file)
@@ -76,6 +76,8 @@ function AjaxEngine()
                     }
                 } else if (ajax.xml_client.status == 403) {
                     window.location.reload();
+                } else if (ajax.xml_client.status >= 500) {
+                    alert("Une erreur s'est produite lors du traitement de la requête");
                 }
             }
         };
index e6daefe..5847fff 100644 (file)
@@ -23,16 +23,15 @@ $GLOBALS['IS_XNET_SITE'] = true;
 
 require_once dirname(__FILE__).'/../include/xnet.inc.php';
 
+$platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'geoloc', 'payment', 'bandeau');
 if (!($path = Env::v('n')) || substr($path, 0, 4) != 'Xnet') {
-    $platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'geoloc', 'payment', 'bandeau');
     $platal->run();
-
     exit;
 }
 
 /*** WIKI CODE ***/
 
-include 'wiki/engine.php';
+include pl_core_include('wiki.engine.inc.php');
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>
index b5e0726..7d65d99 100644 (file)
 
 require_once dirname(__FILE__).'/../include/xorg.inc.php';
 
+$platal = new Platal('auth', 'carnet', 'email', 'events', 'forums',
+                     'geoloc', 'lists', 'marketing', 'payment', 'platal',
+                     'profile', 'register', 'search', 'stats', 'admin',
+                     'newsletter', 'axletter', 'bandeau', 'survey',
+                     'fusionax',
+                     'gadgets', 'googleapps');
+
 if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) {
-    $platal = new Platal('auth', 'carnet', 'email', 'events', 'forums',
-                         'geoloc', 'lists', 'marketing', 'payment', 'platal',
-                         'profile', 'register', 'search', 'stats', 'admin',
-                         'newsletter', 'axletter', 'bandeau', 'survey',
-                         'fusionax',
-                         'gadgets', 'googleapps');
     $platal->run();
     exit;
 }
 
 /*** WIKI CODE ***/
 
-include 'wiki/engine.php';
+include pl_core_include('wiki.engine.inc.php');
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>
index 3b07d78..9d38d31 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-function _rss_encode_date($d) {
-    if (preg_match('/^\d{14}$/', $d)) {
-        $t = mktime(substr($d,8,2), substr($d,10,2), substr($d,12,2), substr($d,4,2), substr($d,6,2), substr($d,0,4));
-    } else {
-        $t = strtotime($d);
-    }
-    return date('r', $t);
-}
-
 function init_rss($template, $alias, $hash, $require_uid = true)
 {
     $page =& Platal::page();
     $page->changeTpl($template, NO_SKIN);
-    $page->register_modifier('rss_date', '_rss_encode_date');
-
-    $res = XDB::query(
-        'SELECT  a.id
-           FROM  aliases         AS a
-     INNER JOIN  auth_user_md5   AS u ON (a.id = u.user_id AND u.perms IN ("admin", "user"))
-     INNER JOIN  auth_user_quick AS q ON (a.id = q.user_id AND q.core_rss_hash = {?})
-          WHERE  a.alias = {?} AND a.type != "homonyme"', $hash, $alias);
-    $uid = $res->fetchOneCell();
-
+    $uid = Platal::session()->tokenAuth($alias, $hash);
     if (empty($uid)) {
         if ($require_uid) {
             exit;
diff --git a/include/wiki.inc.php b/include/wiki.inc.php
deleted file mode 100644 (file)
index bba6b11..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2008 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                *
- ***************************************************************************/
-
-function wiki_pagename()
-{
-    if (!Get::v('n')) {
-        return null;
-    }
-
-    $words = explode('/', trim(Get::v('n'), '/'));
-    if (count($words) == 2) {
-        return join('.', $words);
-    }
-
-    array_unshift($words, $words[0]);
-    $b = array_pop($words);
-    $a = array_pop($words);
-
-    pl_redirect($a.'/'.$b);
-}
-
-function wiki_filename($s)
-{
-    if (@iconv('utf-8', 'utf-8', $s) == $s) {
-        return $s;
-    }
-    return utf8_encode($s);
-}
-
-function wiki_work_dir()
-{
-    global $globals;
-    return $globals->spoolroot.'/spool/wiki.d';
-}
-
-function wiki_clear_all_cache()
-{
-    system('rm -f '.wiki_work_dir().'/cache_*');
-}
-
-function wiki_perms_options() {
-    return array('public' => 'Public', 'logged' => 'Connecté',
-                  'mdp' => 'Authentifié', 'admin' => 'Admin');
-}
-
-function wiki_get_perms($n)
-{
-    $file  = wiki_work_dir().'/'.wiki_filename(str_replace('/', '.', $n));
-    $lines = explode("\n", @file_get_contents($file));
-    foreach ($lines as $line) {
-        @list($k, $v) = explode('=', $line, 2);
-        if ($k == 'platal_perms') {
-            return explode(':', $v);
-        }
-    }
-    return array('logged', 'admin');
-}
-
-function wiki_putfile($f, $s)
-{
-    $fp = fopen($f, 'w');
-    fputs($fp, $s);
-    fclose($fp);
-}
-
-function wiki_set_perms($n, $pr, $pw)
-{
-    $file  = wiki_work_dir().'/'.wiki_filename(str_replace('/', '.', $n));
-    if (!file_exists($file)) {
-        return false;
-    }
-
-    $p = $pr . ':' . $pw;
-
-    $lines = explode("\n", file_get_contents($file));
-    foreach ($lines as $i => $line) {
-        list($k, $v) = explode('=', $line, 2);
-        if ($k == 'platal_perms') {
-            $lines[$i] = 'platal_perms='.$p;
-            wiki_putfile($file, join("\n", $lines));
-            return true;
-        }
-    }
-
-    array_splice($lines, 1, 0, array('platal_perms='.$p));
-    wiki_putfile($file, join("\n", $lines));
-    return true;
-}
-
-function wiki_may_have_perms($perm) {
-    switch ($perm) {
-      case 'public': return true;
-      case 'logged': return S::logged();
-      case 'mdp':    return S::logged();
-      default:       return S::has_perms();
-    }
-}
-
-function wiki_apply_feed_perms($perm)
-{
-    if ($perm == 'public') {
-        return;
-    }
-
-    require_once 'rss.inc.php';
-    $uid = init_rss(null, Env::v('user'), Env::v('hash'));
-    $res = XDB::query('SELECT user_id AS uid, IF (nom_usage <> \'\', nom_usage, nom) AS nom, prenom, perms
-                         FROM auth_user_md5
-                        WHERE user_id = {?}', $uid);
-    if (!$res->numRows()) {
-        exit;
-    }
-    $table = $res->fetchOneAssoc();
-    $_SESSION = array_merge($_SESSION, $table, array('forlife' => Env::v('user')));
-    $_SESSION['perms'] =& XorgSession::make_perms($_SESSION['perms']);
-    if ($perm == 'logged' || $_SESSION['perms']->hasFlag('admin')) {
-        return;
-    }
-    exit;
-}
-
-function wiki_apply_perms($perm)
-{
-    global $platal, $globals;
-    $page =& Platal::page();
-
-    switch ($perm) {
-      case 'public':
-        return;
-
-      case 'logged':
-        if (!call_user_func(array($globals->session, 'doAuthCookie'))) {
-            $platal =  empty($GLOBALS['IS_XNET_SITE']) ? new Platal() : new Xnet();
-            $platal->force_login($page);
-        }
-        return;
-
-      default:
-        if (!call_user_func(array($globals->session, 'doAuth'))) {
-            $platal = empty($GLOBALS['IS_XNET_SITE']) ? new Platal() : new Xnet();
-            $platal->force_login($page);
-        }
-        if ($perm == 'admin') {
-            check_perms();
-        }
-        return;
-    }
-}
-
-function wiki_require_page($pagename)
-{
-    global $globals;
-    $pagename_slashes = str_replace('.','/',$pagename);
-    $pagename_dots = str_replace('/','.',$pagename);
-    if (is_file(wiki_work_dir().'/cache_'.$pagename_dots.'.tpl')) {
-        return;
-    }
-    system('wget --no-check-certificate '. escapeshellarg($globals->baseurl.'/'.$pagename_slashes) . ' -O /dev/null');
-}
-
-function wiki_delete_page($pagename)
-{
-    $pagename_dots = str_replace('/','.',$pagename);
-    if (!strpos($pagename_dots, '.')) {
-        return false;
-    }
-    $file  = wiki_work_dir().'/'.wiki_filename($pagename_dots);
-    $cachefile = wiki_work_dir().'/cache_'.$pagename_dots.'.tpl';
-    if (is_file($cachefile)) {
-        unlink($cachefile);
-    }
-    if (!is_file($file)) {
-        return false;
-    }
-    unlink($file);
-    return true;
-}
-
-function wiki_links_in_line($line, $groupname)
-{
-    $links = array();
-    if (preg_match_all('@\[\[([^~][^\]\|\?#]*)((\?|#)[^\]\|]+)?(\\|[^\]]+)?\]\]@', $line, $matches, PREG_OFFSET_CAPTURE)) {
-        foreach ($matches[1] as $j => $link) if (!preg_match('@http://@', $link[0])) {
-            $mylink = str_replace('/','.',trim($link[0]));
-            $sup = trim(substr($matches[2][$j][0],1));
-            $alt = trim(substr($matches[4][$j][0],1));
-            $newlink = str_replace(' ','',ucwords($mylink));
-            if (strpos($newlink,'.') === false) {
-                $newlink = $groupname.'.'.$newlink;
-            }
-            if (!$alt && $mylink != $newlink) {
-                $alt = trim($link[0]);
-            }
-            $links[] = array(
-              'pos' => $matches[0][$j][1],
-              'size' => strlen($matches[0][$j][0]),
-              'href' => $newlink,
-              'sup' => $sup,
-              'alt' => $alt,
-              'group' => substr($mylink, 0, strpos($mylink, '.')));
-        }
-    }
-    return $links;
-}
-
-function wiki_rename_page($pagename, $newname, $changeLinks = true)
-{
-    $pagename_dots = str_replace('/','.',$pagename);
-    $newname_dots = str_replace('/','.',$newname);
-    if (!strpos($pagename_dots, '.') || !strpos($newname_dots, '.')) {
-        return false;
-    }
-    $groupname = substr($pagename_dots, 0, strpos($pagename_dots,'.'));
-    $newgroupname = substr($newname_dots, 0, strpos($pagename_dots,'.'));
-
-    $file  = wiki_work_dir().'/'.wiki_filename($pagename_dots);
-    $newfile  = wiki_work_dir().'/'.wiki_filename($newname_dots);
-    if (!is_file($file)) {
-        // old page doesn't exist
-        return false;
-    }
-    if (!rename($file, $newfile)) {
-        // impossible to renama page
-        return false;
-    }
-
-    if (!$changeLinks) {
-        return true;
-    }
-
-    $changedLinks = 0;
-    // change name inside this folder and ingroup links if changing group
-    $lines = explode("\n", file_get_contents($newfile));
-    $changed = false;
-    foreach ($lines as $i => $line) {
-        list($k, $v) = explode('=', $line, 2);
-        if ($k == 'name' && $v == $pagename_dots) {
-            $lines[$i] = 'name='.$newname_dots;
-            $changed = true;
-        } else if ($groupname != $newgroupname) {
-            $links = wiki_links_in_line($line, $groupname);
-            $newline = ''; $last = 0;
-            foreach ($links as $link) if ($link['group'] == $groupname) {
-                $newline .= substr($line, $last, $link['pos']);
-                $newline .= '[['.$link['href'].$link['sup'].($link['alt']?(' |'.$link['alt']):'').']]';
-                $last = $link['pos']+$link['size'];
-                $changedLinks++;
-            }
-            if ($last != 0) {
-                $newline .= substr($line, $last);
-                $lines[$i] = $newline;
-                $changed = true;
-            }
-        }
-    }
-    wiki_putfile($newfile, join("\n", $lines));
-
-    // change wiki links in all wiki pages
-    $endname = substr($pagename_dots, strpos($pagename_dots,'.')+1);
-    $pages = array();
-    exec("grep ".$endname."  ".wiki_work_dir()."/* -sc", $pages);
-    foreach($pages as $line) {
-        if (preg_match('%/([^/:]+):([0-9]+)$%', $line, $vals) && $vals[2] > 0) {
-            $inpage = $vals[1];
-            $lines = explode("\n", file_get_contents(wiki_work_dir().'/'.$inpage));
-            $changed = false;
-            // find all wiki links in page and change if linked to this page
-            foreach ($lines as $i => $line) {
-                $links = wiki_links_in_line($line, substr($inpage, 0, strpos($inpage, '.')));
-                $newline = ''; $last = 0;
-                foreach ($links as $link) {
-                    if ($link['href'] == $pagename_dots) {
-                        $newline .= substr($line, $last, $link['pos']);
-                        $newline .= '[['.$newname_dots.$link['sup'].($link['alt']?(' |'.$link['alt']):'').']]';
-                        $last = $link['pos']+$link['size'];
-                        $changedLinks++;
-                    }
-                }
-                if ($last != 0) {
-                    $newline .= substr($line, $last);
-                    $lines[$i] = $newline;
-                    $changed = true;
-                }
-            }
-            if ($changed)
-            {
-                wiki_putfile(wiki_work_dir().'/'.$inpage, join("\n", $lines));
-            }
-        }
-    }
-    if ($changedLinks > 0) {
-        return $changedLinks;
-    }
-    return true;
-}
-
-function wiki_rename_folder($pagename, $newname, $changeLinks = true)
-{
-}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
diff --git a/include/wiki/engine.php b/include/wiki/engine.php
deleted file mode 100644 (file)
index fb3a61e..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2008 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                *
- ***************************************************************************/
-
-require_once 'wiki.inc.php';
-
-$n    = wiki_pagename();
-if (!$n) {
-    pl_redirect('');
-}
-
-new_skinned_page('core/wiki.tpl');
-$perms = wiki_get_perms($n);
-$feed  = false;
-
-// Check user perms
-switch (Env::v('action')) {
-  case 'rss': case 'atom': case 'sdf': case 'dc':
-    wiki_apply_feed_perms($perms[0]);
-    $feed = true;
-  case '': case 'search':
-    break;
-
-  case 'edit':
-    wiki_apply_perms($perms[1]);
-    break;
-
-  default:
-    wiki_apply_perms('admin');
-    break;
-}
-
-if ($p = Post::v('setrperms')) {
-    wiki_apply_perms('admin');
-    if (wiki_set_perms($n, $p, $perms[1])) {
-        $perms = wiki_get_perms($n);
-        $page->trigSuccess('Permissions mises à jour');
-    }
-}
-
-if ($p = Post::v('setwperms')) {
-    wiki_apply_perms('admin');
-    if (wiki_set_perms($n, $perms[0], $p)) {
-        $perms = wiki_get_perms($n);
-        $page->trigSuccess('Permissions mises à jour');
-    }
-}
-
-// Generate cache even if we don't have access rights
-$wiki_cache   = wiki_work_dir().'/cache_'.wiki_filename($n).'.tpl';
-$cache_exists = file_exists($wiki_cache);
-if (Env::v('action') || !$cache_exists) {
-    if ($cache_exists && !$feed) {
-        unlink($wiki_cache);
-        $files = glob($globals->spoolroot . '/spool/templates_c/*cache_' . wiki_filename($n) . '.tpl*');
-        foreach ($files as $file) {
-            unlink($file);
-        }
-    }
-
-    // we leave pmwiki do whatever it wants and store everything
-    ob_start();
-    require_once($globals->spoolroot.'/wiki/pmwiki.php');
-
-    $wikiAll = ob_get_clean();
-    pl_clear_errors();
-
-    // the pmwiki skin we are using (almost empty) has these keywords:
-    $i = strpos($wikiAll, "<!--/HeaderText-->");
-    $j = strpos($wikiAll, "<!--/PageLeftFmt-->", $i);
-}
-
-$wiki_exists = file_exists(wiki_work_dir() . '/' . wiki_filename($n));
-
-if ($feed) {
-    $wikiAll = str_replace('dc:contributor', 'author', $wikiAll);
-    $wikiAll = preg_replace('!<author>.*?\..*?\.(\d{4})\|(.*?)</author>!u', '<author>$2 (X$1)</author>', $wikiAll);
-    $wikiAll = str_replace('<link>./', '<link>' . $globals->baseurl . '/' . $platal->ns, $wikiAll);
-    echo $wikiAll;
-    pl_clear_errors();
-    exit;
-} elseif (Env::v('action')) {
-    $page->assign('pl_extra_header', substr($wikiAll, 0, $i));
-    $wikiAll = substr($wikiAll, $j);
-} else {
-    if (!$cache_exists && $wiki_exists) {
-        $wikiAll = substr($wikiAll, $j);
-        wiki_putfile($wiki_cache, $wikiAll);
-    } elseif ($cache_exists) {
-        $wikiAll = file_get_contents($wiki_cache);
-    } elseif (S::has_perms()) {
-        $wikiAll = "<p>La page de wiki $n n'existe pas. "
-                 . "Il te suffit de <a href='" . str_replace('.', '/', $n) . "?action=edit'>l'éditer</a></p>";
-    } else {
-        $page->changeTpl('core/404.tpl');
-    }
-}
-
-// Check user perms
-wiki_apply_perms($perms[0]);
-
-$page->assign('perms', $perms);
-$page->assign('perms_opts', wiki_perms_options());
-
-$page->assign('canedit',    wiki_may_have_perms($perms[1]));
-$page->assign('has_perms',  wiki_may_have_perms('admin'));
-
-$page->assign('wikipage', str_replace('.', '/', $n));
-if (!$feed && $perms[1] == 'admin' && !Env::v('action') && $wiki_exists) {
-    $page->assign('pmwiki_cache', $wiki_cache);
-} else {
-    $page->assign('pmwiki',   $wikiAll);
-    $page->assign('text', true);
-}
-$page->addCssLink('wiki.css');
-$page->addJsLink('wiki.js');
-if (!Env::v('action')) {
-    $url = '/' . str_replace('.', '/', $n) . '?action=rss';
-    if (S::logged()) {
-        $url .= '&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash');
-    }
-    $page->setRssLink($n, $url);
-}
-
-$page->run();
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
index de86bfc..9cf0c46 100644 (file)
@@ -59,13 +59,13 @@ class AdminModule extends PLModule
     function handler_default(&$page)
     {
         $page->changeTpl('admin/index.tpl');
-        $page->setTitle('Polytechnique.org - Administration');
+        $page->setTitle('Administration');
     }
 
     function handler_postfix_delayed(&$page)
     {
         $page->changeTpl('admin/postfix_delayed.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Postfix : Retardés');
+        $page->setTitle('Administration - Postfix : Retardés');
 
         if (Env::has('del')) {
             $crc = Env::v('crc');
@@ -90,7 +90,7 @@ class AdminModule extends PLModule
 
     function handler_postfix_regexpsbounces(&$page, $new = null) {
         $page->changeTpl('admin/emails_bounces_re.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Postfix : Regexps Bounces');
+        $page->setTitle('Administration - Postfix : Regexps Bounces');
         $page->assign('new', $new);
 
         if (Post::has('submit')) {
@@ -347,14 +347,14 @@ class AdminModule extends PLModule
 
         $page->changeTpl('admin/logger-view.tpl');
 
-        $page->setTitle('Polytechnique.org - Administration - Logs des sessions');
+        $page->setTitle('Administration - Logs des sessions');
     }
 
     function handler_user(&$page, $login = false)
     {
         global $globals;
         $page->changeTpl('admin/utilisateurs.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Edit/Su/Log');
+        $page->setTitle('Administration - Edit/Su/Log');
         require_once("emails.inc.php");
         require_once("user.func.inc.php");
 
@@ -732,7 +732,7 @@ class AdminModule extends PLModule
 
     function handler_homonyms(&$page, $op = 'list', $target = null) {
         $page->changeTpl('admin/homonymes.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Homonymes');
+        $page->setTitle('Administration - Homonymes');
         require_once("homonymes.inc.php");
 
         if ($target) {
@@ -795,7 +795,7 @@ class AdminModule extends PLModule
 
     function handler_ax_xorg(&$page) {
         $page->changeTpl('admin/ax-xorg.tpl');
-        $page->setTitle('Polytechnique.org - Administration - AX/X.org');
+        $page->setTitle('Administration - AX/X.org');
 
         // liste des différences
         $res = XDB::query(
@@ -823,7 +823,7 @@ class AdminModule extends PLModule
 
     function handler_deaths(&$page, $promo = 0, $validate = false) {
         $page->changeTpl('admin/deces_promo.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Deces');
+        $page->setTitle('Administration - Deces');
 
         if (!$promo)
             $promo = Env::i('promo');
@@ -863,7 +863,7 @@ class AdminModule extends PLModule
 
     function handler_dead_but_active(&$page) {
         $page->changeTpl('admin/dead_but_active.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Décédés');
+        $page->setTitle('Administration - Décédés');
 
         $res = XDB::iterator(
                 "SELECT  u.promo, u.nom, u.prenom, u.deces, u.matricule_ax, a.alias, DATE(MAX(s.start)) AS last
@@ -878,7 +878,7 @@ class AdminModule extends PLModule
 
     function handler_synchro_ax(&$page, $user = null, $action = null) {
         $page->changeTpl('admin/synchro_ax.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Synchro AX');
+        $page->setTitle('Administration - Synchro AX');
 
         require_once('synchro_ax.inc.php');
 
@@ -926,7 +926,7 @@ class AdminModule extends PLModule
     function handler_validate(&$page, $action = 'list', $id = null)
     {
         $page->changeTpl('admin/valider.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Valider une demande');
+        $page->setTitle('Administration - Valider une demande');
                 $page->addCssLink('nl.css');
         $page->addJsLink('ajax.js');
         require_once("validations.inc.php");
@@ -974,7 +974,7 @@ class AdminModule extends PLModule
     }
 
     function handler_validate_answers(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Réponses automatiques de validation');
+        $page->setTitle('Administration - Réponses automatiques de validation');
         $page->assign('title', 'Gestion des réponses automatiques');
         $table_editor = new PLTableEditor('admin/validate/answers','requests_answers','id');
         $table_editor->describe('category','catégorie',true);
@@ -983,7 +983,7 @@ class AdminModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
     function handler_skins(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Skins');
+        $page->setTitle('Administration - Skins');
         $page->assign('title', 'Gestion des skins');
         $table_editor = new PLTableEditor('admin/skins','skins','id');
         $table_editor->describe('name','nom',true);
@@ -996,7 +996,7 @@ class AdminModule extends PLModule
     }
 
     function handler_postfix_blacklist(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Postfix : Blacklist');
+        $page->setTitle('Administration - Postfix : Blacklist');
         $page->assign('title', 'Blacklist de postfix');
         $table_editor = new PLTableEditor('admin/postfix/blacklist','postfix_blacklist','email', true);
         $table_editor->describe('reject_text','Texte de rejet',true);
@@ -1004,14 +1004,14 @@ class AdminModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
     function handler_postfix_whitelist(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Postfix : Whitelist');
+        $page->setTitle('Administration - Postfix : Whitelist');
         $page->assign('title', 'Whitelist de postfix');
         $table_editor = new PLTableEditor('admin/postfix/whitelist','postfix_whitelist','email', true);
         $table_editor->describe('email','email',true);
         $table_editor->apply($page, $action, $id);
     }
     function handler_mx_broken(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - MX Défaillants');
+        $page->setTitle('Administration - MX Défaillants');
         $page->assign('title', 'MX Défaillant');
         $table_editor = new PLTableEditor('admin/mx/broken', 'mx_watch', 'host', true);
         $table_editor->describe('host', 'Masque', true);
@@ -1020,7 +1020,7 @@ class AdminModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
     function handler_logger_actions(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Actions');
+        $page->setTitle('Administration - Actions');
         $page->assign('title', 'Gestion des actions de logger');
         $table_editor = new PLTableEditor('admin/logger/actions','logger.actions','id');
         $table_editor->describe('text','intitulé',true);
@@ -1028,7 +1028,7 @@ class AdminModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
     function handler_downtime(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Coupures');
+        $page->setTitle('Administration - Coupures');
         $page->assign('title', 'Gestion des coupures');
         $table_editor = new PLTableEditor('admin/downtime','coupures','id');
         $table_editor->describe('debut','date',true);
@@ -1039,10 +1039,8 @@ class AdminModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
 
-    function handler_wiki(&$page, $action='list', $wikipage='', $wikipage2='')
+    function handler_wiki(&$page, $action = 'list', $wikipage = null, $wikipage2 = null)
     {
-        require_once 'wiki.inc.php';
-
         if (S::v('core_rss_hash')) {
            $page->setRssLink('Changement Récents',
                              '/Site/AllRecentChanges?action=rss&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash'));
@@ -1053,62 +1051,47 @@ class AdminModule extends PLModule
             S::assert_xsrf_token();
 
             $perms_read = Post::v('read');
-            $perms_edot = Post::v('edit');
+            $perms_edit = Post::v('edit');
             if ($perms_read || $perms_edit) {
-                foreach ($_POST as $wiki_page => $val) if ($val == 'on') {
-                    $wiki_page = str_replace('_', '/', $wiki_page);
-                    if (!$perms_read || !$perms_edit)
-                        list($perms0, $perms1) = wiki_get_perms($wiki_page);
-                    if ($perms_read)
-                        $perms0 = $perms_read;
-                    if ($perms_edit)
-                        $perms1 = $perms_edit;
-                    wiki_set_perms($wiki_page, $perms0, $perms1);
+                foreach ($_POST as $wiki_page => $val) {
+                    if ($val == 'on') {
+                        $wp = new PlWikiPage(str_replace(array('_', '/'), '.', $wiki_page));
+                        if ($wp->setPerms($perms_read ? $perms_read : $wp->readPerms(),
+                                          $perms_edit ? $perms_edit : $wp->writePerms())) {
+                            $page->trigSuccess("Permission de la page $wiki_page mises à jour");
+                        } else {
+                            $page->trigError("Impossible de mettre les permissions de la page $wiki_page à jour");
+                        }
+                    }
                 }
             }
-        }
-
-        if ($action == 'delete' && $wikipage != '') {
+        } else if ($action != 'list' && !empty($wikipage)) {
+            $wp = new PlWikiPage($wikipage);
             S::assert_xsrf_token();
 
-            if (wiki_delete_page($wikipage)) {
-                $page->trigSuccess("La page ".$wikipage." a été supprimée.");
-            } else {
-                $page->trigError("Impossible de supprimer la page ".$wikipage.".");
-            }
-        }
-
-        if ($action == 'rename' && $wikipage != '' && $wikipage2 != '' && $wikipage != $wikipage2) {
-            S::assert_xsrf_token();
-
-            if ($changedLinks = wiki_rename_page($wikipage, $wikipage2)) {
-                $s = 'La page <em>'.$wikipage.'</em> a été déplacée en <em>'.$wikipage2.'</em>.';
-                if (is_numeric($changedLinks)) {
-                    $s .= $changedLinks.' lien'.(($changedLinks>1)?'s ont été modifiés.':' a été modifié.');
+            if ($action == 'delete') {
+                if ($wp->delete()) {
+                    $page->trigSuccess("La page ".$wikipage." a été supprimée.");
+                } else {
+                    $page->trigError("Impossible de supprimer la page ".$wikipage.".");
+                }
+            } else if ($action == 'rename' && !empty($wikipage2) && $wikipage != $wikipage2) {
+                if ($changedLinks = $wp->rename($wikipage2)) {
+                    $s = 'La page <em>'.$wikipage.'</em> a été déplacée en <em>'.$wikipage2.'</em>.';
+                    if (is_numeric($changedLinks)) {
+                        $s .= $changedLinks.' lien'.(($changedLinks>1)?'s ont été modifiés.':' a été modifié.');
+                    }
+                    $page->trigSuccess($s);
+                } else {
+                    $page->trigError("Impossible de déplacer la page ".$wikipage);
                 }
-                $page->trigSuccess($s);
-            } else {
-                $page->trigError("Impossible de déplacer la page ".$wikipage);
             }
         }
 
-        $perms = wiki_perms_options();
+        $perms = PlWikiPage::permOptions();
 
         // list wiki pages and their perms
-        $wiki_pages = array();
-        $dir = wiki_work_dir();
-        if (is_dir($dir)) {
-            if ($dh = opendir($dir)) {
-                while (($file = readdir($dh)) !== false) if (substr($file,0,1) >= 'A' && substr($file,0,1) <= 'Z') {
-                    list($read,$edit) = wiki_get_perms($file);
-                    $wiki_pages[$file] = array('read' => $perms[$read], 'edit' => $perms[$edit]);
-                    if (is_file($dir . '/cache_' . wiki_filename($file) . '.tpl')) {
-                        $wiki_pages[$file]['cached'] = true;
-                    }
-                }
-                closedir($dh);
-            }
-        }
+        $wiki_pages = PlWikiPage::listPages();
         ksort($wiki_pages);
         $wiki_tree = array();
         foreach ($wiki_pages as $file => $desc) {
index 0b767c3..4b21854 100644 (file)
@@ -174,7 +174,7 @@ class AuthModule extends PLModule
 
     function handler_admin_authgroupesx(&$page, $action = 'list', $id = null)
     {
-        $page->setTitle('Polytechnique.org - Administration - Auth groupes X');
+        $page->setTitle('Administration - Auth groupes X');
         $page->assign('title', 'Gestion de l\'authentification centralisée');
         $table_editor = new PLTableEditor('admin/auth-groupes-x','groupesx_auth','id');
         $table_editor->describe('name','nom',true);
index d78311c..41978e1 100644 (file)
@@ -53,7 +53,7 @@ class AXLetterModule extends PLModule
         require_once dirname(__FILE__) . '/axletter/axletter.inc.php';
 
         $page->changeTpl('axletter/index.tpl');
-        $page->setTitle('Polytechnique.org - Envois de l\'AX');
+        $page->setTitle('Envois de l\'AX');
 
         switch ($action) {
           case 'in':  AXLetter::subscribe(); break;
index 74dd23f..56f0580 100644 (file)
@@ -56,7 +56,7 @@ class CarnetModule extends PLModule
     function handler_index(&$page)
     {
         $page->changeTpl('carnet/index.tpl');
-        $page->setTitle('Polytechnique.org - Mon carnet');
+        $page->setTitle('Mon carnet');
         $this->_add_rss_link($page);
     }
 
@@ -202,7 +202,7 @@ class CarnetModule extends PLModule
 
     function handler_contacts(&$page, $action = null, $subaction = null, $ssaction = null)
     {
-        $page->setTitle('Polytechnique.org - Mes contacts');
+        $page->setTitle('Mes contacts');
         $this->_add_rss_link($page);
 
         $uid  = S::v('uid');
index 7aa8475..239ec6d 100644 (file)
@@ -47,7 +47,7 @@ class EmailModule extends PLModule
         require_once 'emails.inc.php';
 
         $page->changeTpl('emails/index.tpl');
-        $page->setTitle('Polytechnique.org - Mes emails');
+        $page->setTitle('Mes emails');
 
         $uid = S::v('uid');
 
@@ -98,7 +98,7 @@ class EmailModule extends PLModule
         global $globals;
 
         $page->changeTpl('emails/alias.tpl');
-        $page->setTitle('Polytechnique.org - Alias melix.net');
+        $page->setTitle('Alias melix.net');
 
         $uid     = S::v('uid');
         $forlife = S::v('forlife');
@@ -288,8 +288,8 @@ class EmailModule extends PLModule
     function handler_antispam(&$page, $statut_filtre = null)
     {
         require_once 'emails.inc.php';
-        require_once('wiki.inc.php');
-        wiki_require_page('Xorg.Antispam');
+        $wp = new PlWikiPage('Xorg.Antispam');
+        $wp->buildCache();
 
         $page->changeTpl('emails/antispam.tpl');
 
@@ -302,8 +302,8 @@ class EmailModule extends PLModule
 
     function handler_submit(&$page)
     {
-        require_once('wiki.inc.php');
-        wiki_require_page('Xorg.Mails');
+        $wp = new PlWikiPage('Xorg.Mails');
+        $wp->buildCache();
         $page->changeTpl('emails/submit_spam.tpl');
 
         if (Post::has('send_email')) {
@@ -339,7 +339,7 @@ class EmailModule extends PLModule
         $page->changeTpl('emails/send.tpl');
         $page->addJsLink('ajax.js');
 
-        $page->setTitle('Polytechnique.org - Envoyer un email');
+        $page->setTitle('Envoyer un email');
 
         // action si on recoit un formulaire
         if (Post::has('save')) {
@@ -510,8 +510,8 @@ class EmailModule extends PLModule
     function handler_broken(&$page, $warn = null, $email = null)
     {
         require_once 'emails.inc.php';
-        require_once('wiki.inc.php');
-        wiki_require_page('Xorg.PatteCassée');
+        $wp = new PlWikiPage('Xorg.PatteCassée');
+        $wp->buildCache();
 
         global $globals;
 
index a5e244b..3025862 100644 (file)
@@ -144,7 +144,7 @@ class EventsModule extends PLModule
 
         // cache les evenements lus et raffiche les evenements a relire
         if ($action == 'read' && $eid) {
-            XDB::execute('DELETE evenements_vus.*
+            XDB::execute('DELETE ev.*
                             FROM evenements_vus AS ev
                       INNER JOIN evenements AS e ON e.id = ev.evt_id
                            WHERE peremption < NOW()');
@@ -272,8 +272,8 @@ class EventsModule extends PLModule
         $page->changeTpl('events/submit.tpl');
         $page->addJsLink('ajax.js');
 
-        require_once('wiki.inc.php');
-        wiki_require_page('Xorg.Annonce');
+        $wp = new PlWikiPage('Xorg.Annonce');
+        $wp->buildCache();
 
         $titre      = Post::v('titre');
         $texte      = Post::v('texte');
@@ -329,7 +329,7 @@ class EventsModule extends PLModule
 
     function handler_admin_tips(&$page, $action = 'list', $id = null)
     {
-        $page->setTitle('Polytechnique.org - Administration - Astuces');
+        $page->setTitle('Administration - Astuces');
         $page->assign('title', 'Gestion des Astuces');
         $table_editor = new PLTableEditor('admin/tips', 'tips', 'id');
         $table_editor->describe('peremption', 'date de péremption', true);
@@ -350,7 +350,7 @@ class EventsModule extends PLModule
     {
         $page->changeTpl('events/admin.tpl');
         $page->addJsLink('ajax.js');
-        $page->setTitle('Polytechnique.org - Administration - Evenements');
+        $page->setTitle('Administration - Evenements');
         $page->register_modifier('hde', 'html_entity_decode');
 
         $arch = $action == 'archives';
index 4e5d009..80ea2fd 100644 (file)
@@ -59,7 +59,7 @@ class ForumsModule extends PLModule
     function handler_banana(&$page, $group = null, $action = null, $artid = null)
     {
         $page->changeTpl('banana/index.tpl');
-        $page->setTitle('Polytechnique.org - Forums & PA');
+        $page->setTitle('Forums & PA');
 
         $get = Array();
         if (Post::has('updateall')) {
@@ -97,7 +97,7 @@ class ForumsModule extends PLModule
 
     function handler_forums_bans(&$page, $action = 'list', $id = null)
     {
-        $page->setTitle('Polytechnique.org - Administration - Bannissements des forums');
+        $page->setTitle('Administration - Bannissements des forums');
         $page->assign('title', 'Gestion des mises au ban');
         $table_editor = new PLTableEditor('admin/forums','forums.innd','id_innd');
         $table_editor->add_sort_field('priority', true, true);
@@ -113,7 +113,7 @@ class ForumsModule extends PLModule
     static function run_banana(&$page, $params = null)
     {
         $page->changeTpl('banana/index.tpl');
-        $page->setTitle('Polytechnique.org - Forums & PA');
+        $page->setTitle('Forums & PA');
 
         require_once 'banana/forum.inc.php';
         run_banana($page, 'ForumsBanana', $params);
index 8677233..ae45b22 100644 (file)
@@ -43,7 +43,7 @@ class GeolocModule extends PLModule
     function handler_admin(&$page, $action = false) {
         $page->changeTpl('geoloc/admin.tpl');
         require_once("geoloc.inc.php");
-        $page->setTitle('Polytechnique.org - Administration - Geolocalisation');
+        $page->setTitle('Administration - Geolocalisation');
 
         $nb_synchro = 0;
 
index d7871d6..553aeaf 100644 (file)
@@ -42,7 +42,7 @@ class GoogleAppsModule extends PLModule
         require_once("googleapps.inc.php");
         $page->changeTpl('googleapps/index.tpl');
         $page->addJsLink('motdepasse.js');
-        $page->setTitle('Polytechnique.org - Compte Google Apps');
+        $page->setTitle('Compte Google Apps');
 
         $account = new GoogleAppsAccount(S::v('uid'), S::v('forlife'));
 
@@ -117,7 +117,7 @@ class GoogleAppsModule extends PLModule
     function handler_admin(&$page, $action = null) {
         require_once("googleapps.inc.php");
         $page->changeTpl('googleapps/admin.tpl');
-        $page->setTitle('Polytechnique.org - Administration Google Apps');
+        $page->setTitle('Administration Google Apps');
         $page->assign('googleapps_admin', GoogleAppsAccount::is_administrator(S::v('uid')));
 
         if ($action == 'ack') {
@@ -163,7 +163,7 @@ class GoogleAppsModule extends PLModule
     function handler_admin_job(&$page, $job = null) {
         require_once("googleapps.inc.php");
         $page->changeTpl('googleapps/admin.job.tpl');
-        $page->setTitle('Polytechnique.org - Administration Google Apps');
+        $page->setTitle('Administration Google Apps');
         $page->assign('googleapps_admin', GoogleAppsAccount::is_administrator(S::v('uid')));
 
         if ($job) {
@@ -183,7 +183,7 @@ class GoogleAppsModule extends PLModule
         require_once("emails.inc.php");
         require_once("googleapps.inc.php");
         $page->changeTpl('googleapps/admin.user.tpl');
-        $page->setTitle('Polytechnique.org - Administration Google Apps');
+        $page->setTitle('Administration Google Apps');
         $page->assign('googleapps_admin', GoogleAppsAccount::is_administrator(S::v('uid')));
 
         if (!$user && Post::has('login')) {
index 6a65763..7165237 100644 (file)
@@ -94,7 +94,7 @@ class ListsModule extends PLModule
 
         $page->changeTpl('lists/index.tpl');
         $page->addJsLink('ajax.js');
-        $page->setTitle('Polytechnique.org - Listes de diffusion');
+        $page->setTitle('Listes de diffusion');
 
 
         if (Get::has('del')) {
@@ -884,7 +884,7 @@ class ListsModule extends PLModule
 
     function handler_admin_all(&$page) {
         $page->changeTpl('lists/admin_all.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Mailing lists');
+        $page->setTitle('Administration - Mailing lists');
 
         $client = new MMList(S::v('uid'), S::v('password'));
         $listes = $client->get_all_lists();
index 337ee71..3ebf1b3 100644 (file)
@@ -40,7 +40,7 @@ class MarketingModule extends PLModule
     {
         $page->changeTpl('marketing/index.tpl');
 
-        $page->setTitle('Polytechnique.org - Marketing');
+        $page->setTitle('Marketing');
 
         // Quelques statistiques
 
@@ -267,7 +267,7 @@ class MarketingModule extends PLModule
             $page->assign('promo', $promo);
 
             if (Post::has('valide')) {
-                S::assert_xstf_token();
+                S::assert_xsrf_token();
                 $email = trim(Post::v('mail'));
 
                 if (!isvalid_email_redirection($email)) {
index 42b31b5..9dfe318 100644 (file)
@@ -38,7 +38,7 @@ class NewsletterModule extends PLModule
         require_once 'newsletter.inc.php';
 
         $page->changeTpl('newsletter/index.tpl');
-        $page->setTitle('Polytechnique.org - Lettres mensuelles');
+        $page->setTitle('Lettres mensuelles');
 
         switch ($action) {
           case 'out': Newsletter::unsubscribe(); break;
@@ -76,8 +76,8 @@ class NewsletterModule extends PLModule
         $page->changeTpl('newsletter/submit.tpl');
 
         require_once 'newsletter.inc.php';
-        require_once 'wiki.inc.php';
-        wiki_require_page('Xorg.LettreMensuelle');
+        $wp = new PlWikiPage('Xorg.LettreMensuelle');
+        $wp->buildCache();
 
         if (Post::has('see') || (Post::has('valid') && (!trim(Post::v('title')) || !trim(Post::v('body'))))) {
             if (!Post::has('see')) {
@@ -97,7 +97,7 @@ class NewsletterModule extends PLModule
 
     function handler_admin_nl(&$page, $new = false) {
         $page->changeTpl('newsletter/admin.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Newsletter : liste');
+        $page->setTitle('Administration - Newsletter : liste');
         require_once("newsletter.inc.php");
 
         if($new) {
@@ -111,7 +111,7 @@ class NewsletterModule extends PLModule
     function handler_admin_nl_edit(&$page, $nid = 'last', $aid = null, $action = 'edit') {
         $page->changeTpl('newsletter/edit.tpl');
         $page->addCssLink('nl.css');
-        $page->setTitle('Polytechnique.org - Administration - Newsletter : Edition');
+        $page->setTitle('Administration - Newsletter : Edition');
         require_once("newsletter.inc.php");
 
         $nl  = new NewsLetter($nid);
@@ -157,7 +157,7 @@ class NewsletterModule extends PLModule
     }
 
     function handler_admin_nl_cat(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Newsletter : Catégories');
+        $page->setTitle('Administration - Newsletter : Catégories');
         $page->assign('title', 'Gestion des catégories de la newsletter');
         $table_editor = new PLTableEditor('admin/newsletter/categories','newsletter_cat','cid');
         $table_editor->describe('titre','intitulé',true);
index 3924071..0cd97f1 100644 (file)
@@ -120,7 +120,7 @@ class PaymentModule extends PLModule
             }
         }
         $page->changeTpl('payment/index.tpl');
-        $page->setTitle('Polytechnique.org - Télépaiements');
+        $page->setTitle('Télépaiements');
 
         // initialisation
         $op   = Env::v('op', 'select');
@@ -467,7 +467,7 @@ class PaymentModule extends PLModule
     }
 
     function handler_admin(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Paiements');
+        $page->setTitle('Administration - Paiements');
         $page->assign('title', 'Gestion des télépaiements');
         $table_editor = new PLTableEditor('admin/payments','paiement.paiements','id');
         $table_editor->add_join_table('paiement.transactions','ref',true);
index 1168552..d72c110 100644 (file)
@@ -122,7 +122,7 @@ class PlatalModule extends PLModule
     function handler_prefs(&$page)
     {
         $page->changeTpl('platal/preferences.tpl');
-        $page->setTitle('Polytechnique.org - Mes préférences');
+        $page->setTitle('Mes préférences');
 
         if (Post::has('mail_fmt')) {
             $fmt = Post::v('mail_fmt');
@@ -143,7 +143,7 @@ class PlatalModule extends PLModule
     {
         $page->changeTpl('platal/webredirect.tpl');
 
-        $page->setTitle('Polytechnique.org - Redirection de page WEB');
+        $page->setTitle('Redirection de page WEB');
 
         $log =& S::v('log');
         $url = Env::v('url');
@@ -221,17 +221,18 @@ class PlatalModule extends PLModule
 
         $page->changeTpl('platal/motdepasse.tpl');
         $page->addJsLink('motdepasse.js');
-        $page->setTitle('Polytechnique.org - Mon mot de passe');
+        $page->setTitle('Mon mot de passe');
     }
 
     function handler_smtppass(&$page)
     {
         $page->changeTpl('platal/acces_smtp.tpl');
-        $page->setTitle('Polytechnique.org - Acces SMTP/NNTP');
+        $page->setTitle('Acces SMTP/NNTP');
 
-        require_once 'wiki.inc.php';
-        wiki_require_page('Xorg.SMTPSécurisé');
-        wiki_require_page('Xorg.NNTPSécurisé');
+        $wp = new PlWikiPage('Xorg.SMTPSécurisé');
+        $wp->buildCache();
+        $wp = new PlWikiPage('Xorg.NNTPSécurisé');
+        $wp->buildCache();
 
         $uid  = S::v('uid');
         $pass = Env::v('smtppass1');
@@ -387,7 +388,7 @@ Adresse de secours : " . Post::v('email') : ""));
         global $globals;
 
         $page->changeTpl('platal/skins.tpl');
-        $page->setTitle('Polytechnique.org - Skins');
+        $page->setTitle('Skins');
 
         if (Env::has('newskin'))  {  // formulaire soumis, traitons les données envoyées
             XDB::execute('UPDATE auth_user_quick
@@ -448,21 +449,13 @@ Adresse de secours : " . Post::v('email') : ""));
 
     function handler_review(&$page, $action = null, $mode = null) 
     {
-        require_once 'wiki.inc.php';
         require_once dirname(__FILE__) . '/platal/review.inc.php';
-        $dir = wiki_work_dir();
         $dom = 'Review';
         if (@$GLOBALS['IS_XNET_SITE']) {
             $dom .= 'Xnet';
         }
-        if (!is_dir($dir)) {
-            $page->kill("Impossible de trouver le wiki");
-        }
-        if (!file_exists($dir . '/' . $dom . '.Admin')) {
-            $page->kill("Impossible de trouver la page d'administration");
-        }
-        $conf = preg_grep('/^text=/', explode("\n", file_get_contents($dir . '/' . $dom . '.Admin')));
-        $conf = preg_split('/(text\=|\%0a)/', array_shift($conf), -1, PREG_SPLIT_NO_EMPTY);
+        $wp = new PlWikiPage($dom . '.Admin');
+        $conf = explode('%0a', $wp->getField('text'));
         $wiz = new PlWizard('Tour d\'horizon', 'core/plwizard.tpl', true);
         foreach ($conf as $line) {
             $list = preg_split('/\s*[*|]\s*/', $line, -1, PREG_SPLIT_NO_EMPTY);
index 6111253..2b48319 100644 (file)
@@ -29,11 +29,10 @@ class ReviewPage implements PlWizardPage
 
     public function prepare(PlPage &$page, $id)
     {
-        require_once 'wiki.inc.php';
-        $dom = (@$GLOBALS['IS_XNET_SITE'] ? 'ReviewXnet' : 'Review') . '.' . ucfirst($id);
-        wiki_require_page($dom);
-        $page->assign('cacheExists', wiki_work_dir() . '/cache_' . $dom . '.tpl');
-        $page->assign('article', $dom);
+        $wp = new PlWikiPage((@$GLOBALS['IS_XNET_SITE'] ? 'ReviewXnet' : 'Review') . '.' . ucfirst($id));
+        $wp->buildCache();
+        $page->assign('cacheExists', $wp->cacheFilename());
+        $page->assign('article', $wp->name);
     }
 }
 
index 894578a..62a0ce7 100644 (file)
@@ -353,7 +353,7 @@ class ProfileModule extends PLModule
                       . " la procédure de récupération de mot de passe si un jour tu le perdais");
         }
 
-       $page->setTitle('Polytechnique.org - Mon Profil');
+       $page->setTitle('Mon Profil');
     }
 
     function handler_applis_js(&$page)
@@ -592,9 +592,10 @@ class ProfileModule extends PLModule
 
     function handler_ref_search(&$page, $action = null, $subaction = null)
     {
-        require_once 'wiki.inc.php';
-        wiki_require_page('Docs.Emploi');
-        $page->setTitle('Polytechnique.org - Conseil Pro');
+        $wp = new PlWikiPage('Docs.Emploi');
+        $wp->buildCache();
+
+        $page->setTitle('Conseil Pro');
 
         //recuperation des noms de secteurs
         $res = XDB::iterRow("SELECT id, label FROM emploi_secteur");
@@ -717,7 +718,7 @@ class ProfileModule extends PLModule
     function handler_xnet(&$page)
     {
         $page->changeTpl('profile/groupesx.tpl');
-        $page->setTitle('Polytechnique.org - Promo, Groupes X, Binets');
+        $page->setTitle('Promo, Groupes X, Binets');
 
         $req = XDB::query('
             SELECT m.asso_id, a.nom, diminutif, a.logo IS NOT NULL AS has_logo,
@@ -747,7 +748,7 @@ class ProfileModule extends PLModule
 
     function handler_admin_trombino(&$page, $uid = null, $action = null) {
         $page->changeTpl('profile/admin_trombino.tpl');
-        $page->setTitle('Polytechnique.org - Administration - Trombino');
+        $page->setTitle('Administration - Trombino');
         $page->assign('uid', $uid);
 
         $q   = XDB::query(
@@ -786,7 +787,7 @@ class ProfileModule extends PLModule
         $page->assign('forlife', $forlife);
     }
     function handler_admin_binets(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Binets');
+        $page->setTitle('Administration - Binets');
         $page->assign('title', 'Gestion des binets');
         $table_editor = new PLTableEditor('admin/binets', 'binets_def', 'id');
         $table_editor->add_join_table('binets_ins','binet_id',true);
@@ -794,7 +795,7 @@ class ProfileModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
     function handler_admin_formations(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Formations');
+        $page->setTitle('Administration - Formations');
         $page->assign('title', 'Gestion des formations');
         $table_editor = new PLTableEditor('admin/formations','applis_def','id');
         $table_editor->add_join_table('applis_ins','aid',true);
@@ -803,21 +804,21 @@ class ProfileModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
     function handler_admin_sections(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Sections');
+        $page->setTitle('Administration - Sections');
         $page->assign('title', 'Gestion des sections');
         $table_editor = new PLTableEditor('admin/sections','sections','id');
         $table_editor->describe('text','intitulé',true);
         $table_editor->apply($page, $action, $id);
     }
     function handler_admin_ss_secteurs(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Sous-secteurs');
+        $page->setTitle('Administration - Sous-secteurs');
         $page->assign('title', 'Gestion des sous-secteurs');
         $table_editor = new PLTableEditor('admin/ss_secteurs', 'emploi_ss_secteur', 'id', true);
         $table_editor->describe('label', 'intitulé', true);
         $table_editor->apply($page, $action, $id);
     }
     function handler_admin_fonctions(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Fonctions');
+        $page->setTitle('Administration - Fonctions');
         $page->assign('title', 'Gestion des fonctions');
         $table_editor = new PLTableEditor('admin/fonctions', 'fonctions_def', 'id', true);
         $table_editor->describe('fonction_fr', 'intitulé', true);
@@ -826,7 +827,7 @@ class ProfileModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
     function handler_admin_secteurs(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Secteurs');
+        $page->setTitle('Administration - Secteurs');
         $page->assign('title', 'Gestion des secteurs');
         $table_editor = new PLTableEditor('admin/secteurs', 'emploi_secteur', 'id', true);
         $table_editor->describe('label', 'intitulé', true);
@@ -843,7 +844,7 @@ class ProfileModule extends PLModule
         $table_editor->apply($page, $action, $id);
     }
     function handler_admin_medals(&$page, $action = 'list', $id = null) {
-        $page->setTitle('Polytechnique.org - Administration - Distinctions');
+        $page->setTitle('Administration - Distinctions');
         $page->assign('title', 'Gestion des Distinctions');
         $table_editor = new PLTableEditor('admin/medals','profile_medals','id');
         $table_editor->describe('text', 'intitulé',  true);
index 04f4ffc..cb15051 100644 (file)
@@ -83,8 +83,8 @@ class RegisterModule extends PLModule
 
         switch ($sub_state['step']) {
             case 0:
-                require_once('wiki.inc.php');
-                wiki_require_page('Reference.Charte');
+                $wp = new PlWikiPage('Reference.Charte');
+                $wp->buildCache();
                 if (Post::has('step1')) {
                     $sub_state['step'] = 1;
                     if (isset($sub_state['hash'])) {
@@ -336,7 +336,8 @@ class RegisterModule extends PLModule
              INNER JOIN  aliases            AS sa ON ( sa.id = m.sender
                                                        AND FIND_IN_SET('bestalias', sa.flags) )
                   WHERE  m.uid = {?}
-               GROUP BY  m.sender", $uid);
+               GROUP BY  m.sender
+               ORDER BY  dateDernier DESC", $uid);
         XDB::execute("UPDATE register_mstats SET success=NOW() WHERE uid={?}", $uid);
 
         $market = array();
@@ -379,7 +380,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 dmail de marketing.";
+                $msg .= "$prenom $nom n'a jamais reçu d\'email de marketing.";
             }
             $mymail->setTxtBody($msg);
             $mymail->send();
index b33fa6c..062b676 100644 (file)
@@ -154,7 +154,7 @@ class SearchModule extends PLModule
 
         require_once dirname(__FILE__) . '/search/search.inc.php';
         $page->changeTpl('search/index.tpl');
-        $page->setTitle('Polytechnique.org - Annuaire');
+        $page->setTitle('Annuaire');
     }
 
     function handler_advanced(&$page, $action = null, $subaction = null)
index f92ccbe..1520f53 100644 (file)
@@ -291,6 +291,8 @@ class QuickSearch extends SField
             if (Env::i('with_soundex') && strlen($s) > 1) {
                 $t = soundex_fr($s);
                 $where[] = "sn$i.soundex = '$t'";
+            } elseif (Env::i('exact')) {
+                $where[] = "sn$i.token = '$s'";
             } else {
                 $t = str_replace('*', '%', $s).'%';
                 $t = str_replace('%%', '%', $t);
@@ -469,6 +471,7 @@ class RefSField extends SField
     function compare()
     {
         $val = addslashes($this->value);
+        if (Env::i('exact')) return "='$val'";
         return $this->exact ? "='$val'" : " LIKE '%$val%'";
     }
 
@@ -640,7 +643,9 @@ class StringSField extends SField
      * @param field nom de champ de la bdd concerné par la clause */
     function get_single_where_statement($field)
     {
-        $regexp = strtr(addslashes($this->value), '-*', '_%');
+        $val = addslashes($this->value);
+        if (Env::i('exact')) return "$field = '$val'";
+        $regexp = strtr($val, '-*', '_%');
         return "$field LIKE '$regexp%'";
     }
 
@@ -671,7 +676,9 @@ class NameSField extends StringSField
 
     function get_single_where_statement($field)
     {
-        $regexp = strtr(addslashes($this->value), '-*', '_%');
+        $val = addslashes($this->value);
+        if (Env::i('exact')) return "$field = '$val'";
+        $regexp = strtr($val, '-*', '_%');
         return "$field LIKE '$regexp%' OR $field LIKE '% $regexp%' OR $field LIKE '%-$regexp%'";
     }
 
index 20d5956..e39f2d8 100644 (file)
@@ -48,9 +48,9 @@ function advancedSearchFromInput()
     }
 
     if (!Env::i('cityid')) {
-        $townField      = new RefSField('city',array('ac.city'),'adresses','ac',getadr_join('ac'),false);
+        $townField  = new RefSField('city',array('ac.city', 'ac.postcode'),'adresses','ac',getadr_join('ac'),false);
     } else {
-        $townField    = new RefSField('cityid',array('av.cityid'),'adresses','av',getadr_join('av'));
+        $townField  = new RefSField('cityid',array('av.cityid', 'av.postcode'),'adresses','av',getadr_join('av'));
     }
     $countryField   = new RefSField('country',array('ap.country'),'adresses','ap',getadr_join('ap'));
     $regionField    = new RefSField('region',array('ar.region'),'adresses','ar',getadr_join('ar'));
index e865ee2..af32d67 100644 (file)
@@ -87,7 +87,7 @@
     <tr class="pair">
       <td class="titre" colspan="2">
         <input type="checkbox" {if $xface}checked="checked"{/if} name="bananaxface" id="xface" />
-        <label for="xface">Afficher mon X-Face plutôt que ma photo sil est disponible</label>
+        <label for="xface">Afficher mon X-Face plutôt que ma photo s'il est disponible</label>
       </td>
     </tr>
   </table>
index e8e2eb5..07725fc 100644 (file)
@@ -35,7 +35,7 @@ Tu trouveras les mêmes informations sur [[https://www.polytechnique.org/carnet/
 
 {foreach from=$u.data key=cid item=d}
 
-!{if $d|@count eq 1}{if $d[0].sexe}{$cats[$cid].mail_sg_xette}{else}{$cats[$cid].mail_sg}{/if}{else}{$cats[$cid].mail}{/if}:
+!{if $d|@count eq 1}{if $d[0].sexe}{$cats[$cid].mail_sg_xette}{else}{$cats[$cid].mail_sg}{/if}{else}{$cats[$cid].mail}{/if} :
 
 {foreach from=$d item=x}
 * (X{$x.promo}), le {$x.date|date_format:"%d %B %Y"}, [[https://www.polytechnique.org/profile/private/{$x.bestalias}|{$x.prenom} {$x.nom}]]
@@ -45,7 +45,7 @@ Tu trouveras les mêmes informations sur [[https://www.polytechnique.org/carnet/
 --
 L'Équipe de Polytechnique.org
 
-'''''Note:'''''  Tu reçois cet email car tu as activé la notification automatique par email des événements que tu surveilles.\\
+'''''Note :'''''  Tu reçois cet email car tu as activé la notification automatique par email des événements que tu surveilles.\\
 Tu peux changer cette option sur la [[https://www.polytechnique.org/carnet/notifs|page de configuration des notifications]].
 
 {/if}
index f1ccab1..8ffb32c 100644 (file)
@@ -31,7 +31,7 @@ S'il n'y a rien à te signaler l'email ne t'est pas envoyé.</p>
   <fieldset>
     <legend>Email</legend>
     <input type='checkbox' name='mail' onclick="this.form.submit();" {if $watch->watch_mail}checked="checked"{/if} />
-    Recevoir un email hebdomadaire des événements que je n'ai pas déjà vus sur le site<br />
+    Recevoir un email hebdomadaire des événements que je n'ai pas déjà vus sur le site.<br />
     <input type='hidden' name='flags_mail' value='valider' />
   </fieldset>
 </form>
index 4bc7bb4..f3be2ff 100644 (file)
@@ -172,6 +172,7 @@ Si tu n'es pas {insert name="getName"}, change le login ci-dessous, ou rends-toi
 <!-- 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="response"  value="" />
     <input type="hidden" name="xorpass"  value="" />
index 363959e..f3efb71 100644 (file)
@@ -51,7 +51,7 @@
       </td>
       <td>
         <input type="password" name="password" size="10" maxlength="10" />
-        &nbsp;<a href="recovery">Perdu ?</a>
+        &nbsp;<a href="recovery">Perdu&nbsp;?</a>
       </td>
       <td class="right" rowspan="2" style="vertical-align: middle">
         <input  type="submit" name="submitbtn" value="Envoyer" />
index 35b32d2..7b858e3 100644 (file)
 {if $retour == $smarty.const.ERROR_INVALID_EMAIL}
   {assign var='error_email' value='1'}
   <p class="erreur">
-  Erreur: l'email n'est pas valide.
+  Erreur&nbsp;: l'email n'est pas valide.
   </p>
 {/if}
 {if $retour == $smarty.const.ERROR_LOOP_EMAIL}
   <p class="erreur">
-  Erreur: {$smarty.session.forlife}@{#globals.mail.domain#} ne doit pas être renvoyé
+  Erreur&nbsp;: {$smarty.session.forlife}@{#globals.mail.domain#} ne doit pas être renvoyé
   vers lui-même, ni vers son équivalent en {#globals.mail.domain2#} ni vers polytechnique.edu.
   </p>
 {/if}
index 9ad99bd..c501e94 100644 (file)
     <table cellspacing="0" cellpadding="0">
       {if $c.countrytxt || $c.city}
       <tr>
-        <td class="lt">Géographie:</td>
+        <td class="lt">Géographie&nbsp;:</td>
         <td class="rt">{$c.city}{if $c.city && $c.countrytxt}, {/if}{$c.countrytxt}</td>
       </tr>
       {/if}
       {if $c.mobile && !$c.dcd}
       <tr>
-        <td class="lt">Mobile:</td>
+        <td class="lt">Mobile&nbsp;:</td>
         <td class="rt">{$c.mobile}</td>
       </tr>
       {/if}
index 9292be0..0b8cedd 100644 (file)
   {if $account->g_suspension}
   <tr class="pair">
     <td>
-      Ton compte est actuellement suspendu pour la raison suivante: <em>{$account->g_suspension}</em>.
+      Ton compte est actuellement suspendu pour la raison suivante : <em>{$account->g_suspension}</em>.
     </td>
   </tr>
   {/if}
           Attention, cette opération changera ton mot de passe Google Apps.
         </li>
         <li>
-          Changer le mot de passe de ton compte Google Apps:<br /><br />
+          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>
index a724ca8..ac48047 100644 (file)
        <table>
         {if $address.entreprise || $address.web}
         <tr>
-          <td><em>Ent/Org: </em></td>
+          <td><em>Ent/Org&nbsp;: </em></td>
           <td><strong>{$address.entreprise}{if $address.web} [<a href='{$address.web}'>site</a>]{/if}</strong></td>
         </tr>
         {/if}
         {if $address.secteur}
         <tr>
-          <td><em>Secteur: </em></td>
+          <td><em>Secteur&nbsp;: </em></td>
           <td><strong>{$address.secteur}{if $address.ss_secteur} ({$address.ss_secteur}){/if}</strong></td>
         </tr>
         {/if}
 
         {if $address.fonction}
         <tr>
-          <td><em>Fonction: </em></td>
+          <td><em>Fonction&nbsp;: </em></td>
           <td><strong>{$address.fonction}</strong></td>
         </tr>
         {/if}
         {if $address.poste}
         <tr>
-          <td><em>Poste: </em></td>
+          <td><em>Poste&nbsp;: </em></td>
           <td><strong>{$address.poste}</strong></td>
         </tr>
         {/if}
index 9cf5cf0..5b881c0 100644 (file)
 {if $withtext}
 <a href="Xorg/FAQ?display=light#flags" class="popup_800x240">Quelle couleur ?</a>
 {/if}
-<input type="radio" name="{$name}" value="public" {if $val eq 'public'}checked="checked"{/if}
+<label><input type="radio" name="{$name}" value="public" {if $val eq 'public'}checked="checked"{/if}
        {if $disabled}disabled="disabled"{/if}/>
 {icon name="flag_green" title="site public"}
-{if $withtext}<span class="texte">site public</span>{/if}
-<input type="radio" name="{$name}" value="ax" {if $val eq 'ax'}checked="checked"{/if}
+{if $withtext}<span class="texte">site public</span>{/if}</label>
+<label><input type="radio" name="{$name}" value="ax" {if $val eq 'ax'}checked="checked"{/if}
        {if $disabled}disabled="disabled"{/if}/>
 {icon name="flag_orange" title="transmis à l'AX"}
-{if $withtext}<span class="texte">transmis à l'AX</span>{/if}
-<input type="radio" name="{$name}" value="private" {if $val eq 'private' || (!$val && !$disabled)}checked="checked"{/if}
+{if $withtext}<span class="texte">transmis à l'AX</span>{/if}</label>
+<label><input type="radio" name="{$name}" value="private" {if $val eq 'private' || (!$val && !$disabled)}checked="checked"{/if}
        {if $disabled}disabled="disabled"{/if}/>
 {icon name="flag_red" title="privé"}
-{if $withtext}<span class="texte">privé</span>{/if}
+{if $withtext}<span class="texte">privé</span>{/if}</label>
 {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
index b5b301f..9c4bd58 100644 (file)
@@ -26,8 +26,8 @@
 </p>
 {else}
 <table cellpadding="0" cellspacing="2" style="width: 100%">
-  {section name=trombi loop=$set start=1}
-  {if $smarty.section.trombi.iteration % 3 == 1}
+  {section name=trombi loop=$set start=0}
+  {if $smarty.section.trombi.index % 3 == 1}
   <tr>
     <td class="center" style="vertical-align: middle">
       <a href="{$mainsiteurl}profile/{$set[trombi.index_prev].forlife}" class="popup2">
@@ -75,7 +75,7 @@
     {/if}
     </td>
   </tr>
-  {elseif ($smarty.section.trombi.iteration % 3 == 0) && ($smarty.section.trombi.last)}
+  {elseif ($smarty.section.trombi.index % 3 == 0) && ($smarty.section.trombi.last)}
   <tr>
     <td class="center" style="vertical-align: middle; padding-bottom: 15px">
       <a href="{$mainsiteurl}profile/{$set[trombi].forlife}" class="popup2">
index 522fdee..14a12cf 100644 (file)
@@ -26,7 +26,7 @@
 {if $options|@count}
 <table class='bicol' cellpadding='2' cellspacing='0'>
   <tr><th colspan='3'>Options incorrectes pour {$details.addr}</th></tr>
-  <tr><th>champs</th><th>devrait être:</th><th>est ...</th></tr>
+  <tr><th>champs</th><th>devrait être :</th><th>est ...</th></tr>
   {foreach from=$options key=k item=o}
   <tr>
     <td class='titre'>{$k}</td>
index b1066cc..d77a3e1 100644 (file)
@@ -32,7 +32,7 @@
       <td>{$del_user.name}</td>
     </tr>
     <tr>
-      <td>raison:
+      <td>raison&nbsp;:
         <textarea cols='50' rows='10' name='reason'></textarea>
       </td>
     </tr>
index 2caefb7..3b078ea 100644 (file)
@@ -79,7 +79,7 @@ sa dernière relance date du {$relance|date_format}
     {/iterate}
     <tr>
       <td></td>
-      <td colspan='5' class='smaller'>(*): email perso</td>
+      <td colspan='5' class='smaller'>(*)&nbsp;: email perso</td>
     </tr>
     <tr>
       <td>
@@ -106,7 +106,7 @@ sa dernière relance date du {$relance|date_format}
       <th colspan="2">Edition de l'email de relance</th>
     </tr>
     <tr class="pair">
-      <td align="right"><strong>From:</strong></td>
+      <td align="right"><strong>From&nbsp;:</strong></td>
       <td>
         {if $rel_from_staff neq $rel_from_user}
         <select name="from">
@@ -119,18 +119,18 @@ sa dernière relance date du {$relance|date_format}
       </td>
     </tr>
     <tr class="pair">
-      <td align="right"><strong>To:</strong></td>
+      <td align="right"><strong>To&nbsp;:</strong></td>
       <td>
         <input type="text" value="{$rel_to}" name="to" size="40" maxlength="100" />
         <input type="submit" name="valider" value="Envoyer" />
       </td>
     </tr>
     <tr class="pair">
-      <td align="right"><strong>Objet:</strong></td>
+      <td align="right"><strong>Objet&nbsp;:</strong></td>
       <td><input type="text" name="title" value="{$rel_title}" size="50" maxlength="100" /></td>
     </tr>
     <tr class="pair">
-      <td align="right"><strong>Message:</strong></td>
+      <td align="right"><strong>Message&nbsp;:</strong></td>
       <td>
         <textarea name="message" rows="40" cols="60">{$rel_text}</textarea>
       </td>
index c887968..5ba0dbe 100644 (file)
@@ -26,7 +26,7 @@
     <a href="marketing/promo/{$promo-1}" title="-1"><img src="images/icons/resultset_previous.gif" alt="[&lt;]" /></a>
 
     &nbsp;
-    Promo:<input type="text" name="promo" value="{$promo}" size="4" maxlength="4" /><input type="submit" value="GO" />
+    Promo&nbsp;:<input type="text" name="promo" value="{$promo}" size="4" maxlength="4" /><input type="submit" value="GO" />
     &nbsp;
 
     <a href="marketing/promo/{$promo+1}" title="+1"><img src="images/icons/resultset_next.gif" alt="[&gt;]" /></a>
@@ -58,7 +58,7 @@
       <td>{if $it.last_known_email}{mailto address=$it.last_known_email}{/if}</td>
       <td class="center">
         {if $it.dern_rel && $it.dern_rel != '0000-00-00'}
-        Relance le: {$it.dern_rel}
+        Relance le&nbsp;: {$it.dern_rel}
         {elseif $it.email}
         En cours&nbsp;: {$it.email}
         {else}
index c7968ff..de808fa 100644 (file)
@@ -63,7 +63,7 @@ En voici les adresses&nbsp;:
 Tu peux le désactiver en allant dans Préférences et en cliquant sur "désactiver les fils RSS".
 </p>
 <p>
-Attention: désactiver, puis réactiver le fil RSS en change l'adresse.
+Attention&nbsp;: désactiver, puis réactiver le fil RSS en change l'adresse.
 </p>
 <p>[<a href="{$goback}">retour à la page dont tu venais</a>]</p>
 {/if}
index 368671f..84b1409 100644 (file)
@@ -29,8 +29,8 @@
   <tr>
     <td>
       <div class="flags">
-        <input type="checkbox" name="medals_pub"{if $medals_pub eq 'public'} checked="checked"{/if} />
-        {icon name="flag_green" title="site public"}
+        <label><input type="checkbox" name="medals_pub"{if $medals_pub eq 'public'} checked="checked"{/if} />
+        {icon name="flag_green" title="site public"}</label>
         <span class="texte">
           bien que publiques (JO, ...), tu peux choisir de ne pas associer ces informations à ta fiche publique
         </span>
index 8833356..90c9356 100644 (file)
 {/if}
 
 <table class="bicol"  style="margin-bottom: 1em"
-  summary="Profil: Trombinoscope">
+  summary="Profil&nbsp;: Trombinoscope">
   <tr>
     <th colspan="2">
       <div class="flags" style="float: left">
-        <input type="checkbox" name="photo_pub" {if $photo_pub eq 'public'}checked="checked" {/if}/>
-        {icon name="flag_green" title="site public"}
+        <label><input type="checkbox" name="photo_pub" {if $photo_pub eq 'public'}checked="checked" {/if}/>
+        {icon name="flag_green" title="site public"}</label>
       </div>
       Trombinoscope
     </th>
 </table>
 
 <table class="bicol" style="margin-bottom: 1em"
-  summary="Profil: Divers">
+  summary="Profil&nbsp;: Divers">
   <tr>
     <th colspan="2">
       Divers
     <td>
       <div>
         <span class="flags">
-          <input type="checkbox" name="freetext_pub" {if $freetext_pub eq 'public'}checked="checked"{/if} />
-          {icon name="flag_green" title="site public"}
+          <label><input type="checkbox" name="freetext_pub" {if $freetext_pub eq 'public'}checked="checked"{/if} />
+          {icon name="flag_green" title="site public"}</label>
         </span>&nbsp;
         <span class="titre">Commentaire</span>
       </div>
index 29829cd..09220c7 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-<table class="bicol" style="margin-bottom: 1em" summary="Profil: Informations Polytechniciennes">
+<table class="bicol" style="margin-bottom: 1em" summary="Profil&nbsp;: Informations Polytechniciennes">
   <tr>
     <th colspan="2">
       <div class="flags" style="float: left">
index 70c269b..7521a28 100644 (file)
@@ -44,7 +44,7 @@
   <li>ou bien, plus âgés, qui souhaitent réorienter leur carrière.</li>
 </ul>
 
-<table class="bicol" style="margin-bottom: 1em" summary="Profil: Mentoring">
+<table class="bicol" style="margin-bottom: 1em" summary="Profil&nbsp;: Mentoring">
   <tr>
     <th>
       <div class="flags" style="float: left">
@@ -79,7 +79,7 @@
   </tr>
 </table>
 
-<table class="bicol" style="margin-bottom: 1em" summary="Profil: Mentoring">
+<table class="bicol" style="margin-bottom: 1em" summary="Profil&nbsp;: Mentoring">
   <tr>
     <th>
       <div class="flags" style="float: left">
   </tr>
 </table>
 
-<table class="bicol" summary="Profil: Mentoring">
+<table class="bicol" summary="Profil&nbsp;: Mentoring">
   <tr>
     <th>
       <div class="flags" style="float: left">
index acb6553..1cdde60 100644 (file)
@@ -47,7 +47,7 @@
     <tr class="pair">
       <td></td>
       <td>
-        6 chiffres terminant par le numéro d'entrée (ex: 
+        6 chiffres terminant par le numéro d'entrée (ex 
         {if $promo < 2000}
         {math equation="promo % 100" promo=$promo}0532)<br />
         {else}
index b5477bb..53f7ffd 100644 (file)
@@ -36,7 +36,9 @@
           return '...';
         }
 
-        return name + '<em>&nbsp;&nbsp;-&nbsp;&nbsp;' + row[1] + ' camarades<\/em>';
+        camarades = (row[1] > 1) ? "camarades" : "camarade";
+
+        return name + '<em>&nbsp;&nbsp;-&nbsp;&nbsp;' + row[1] + '&nbsp;' + camarades + '<\/em>';
       };
   }
 
       $("[@name='diploma']").parent().load(baseurl + 'list/diploma/', { school:schoolId }, function() {
           if ($("select[@name='diploma']").children("option").size() > 1) {
             $("select[@name='diploma']").attr('value', '{/literal}{$smarty.request.diploma}{literal}');
-
-            $("tr#diploma_ln").show();
           } else {
             $("select[@name='diploma']").attr('value', '');
-
-            $("tr#diploma_ln").hide();
           }
         });
     } else {
       $(".autocomplete[@name='schoolTxt']").removeClass('hidden_valid');
 
       $("select[@name='diploma']").attr('value', '');
-
-      $("tr#diploma_ln").hide();
     }
   }
 
       <th colspan="2">Géographie</th>
     </tr>
     <tr>
-      <td>Ville</td>
+      <td>Ville ou code postal</td>
       <td><input type="text" class="autocomplete" name="city" size="32" value="{$smarty.request.city}" /></td>
     </tr>
     <tr>
@@ -398,10 +394,10 @@ checked="checked"{/if}/>Chercher uniquement les adresses où les camarades sont
         <a href="school" class="autocompleteToSelect">{icon name="table" title="Toutes les formations"}</a>
       </td>
     </tr>
-    <tr id="diploma_ln">
+    <tr>
       <td>Diplôme</td>
       <td>
-        <input name="diploma" type="hidden" size="32" value="{$smarty.request.diploma}"/>
+        <input name="diploma" size="32" value="{$smarty.request.diploma}"/>
       </td>
     </tr>
     <tr>
@@ -438,6 +434,12 @@ checked="checked"{/if}/>Chercher uniquement les adresses où les camarades sont
           <label for="order">Mettre les fiches modifiées récemment en premier.</label>
       </td>
     </tr>
+    <tr>
+      <td colspan="2">
+           <input type='checkbox' name='exact' id="exact" {if $smarty.request.exact}checked='checked'{/if} value='1'/>
+           <label for="exact">Faire une recherche exacte.</label>
+      </td>
+    </tr>
         {/if}
     <tr><td colspan="2"></td></tr>
     <tr>
index 65889e4..029f04b 100644 (file)
@@ -26,7 +26,7 @@
 {if $validate}
   <div id="dev">
     @HOOK@
-    Validation:
+    Validation&nbsp;:
     <a href="http://jigsaw.w3.org/css-validator/validator?uri={#globals.baseurl#}/valid.html">CSS</a>
     &nbsp;&nbsp;|&nbsp;&nbsp;
     références&nbsp;:
index 1eb652a..9362807 100644 (file)
@@ -36,7 +36,7 @@
 {elseif $survey_message neq ""}
   {$survey_message}
 {else}
-Une erreur inconnue est survenue dans l'&#233;dition de ce sondage. N'hésite pas &#224; <a href='send_bug/{ $smarty.server.REQUEST_URI }'>signaler ce bug</a> sil persiste.
+Une erreur inconnue est survenue dans l'&#233;dition de ce sondage. N'hésite pas &#224; <a href='send_bug/{ $smarty.server.REQUEST_URI }'>signaler ce bug</a> s'il persiste.
 {/if}
 <br/>
 <a href="{$survey_link}">Retour</a>
index 7f63c8d..4005e42 100644 (file)
@@ -180,7 +180,7 @@ A très bientôt,
 
 -- 
 {$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:$platal->ns}" /><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 />
         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 b638dcc..02b1d5b 100644 (file)
@@ -143,7 +143,7 @@ Le groupe {$asso.nom} compte {$nb_tot} membres&nbsp;:
 
 {if $broken}
 <p class="smaller">
-  {icon name=error}&nbsp;Un camarade signalé par ce symbole n'a plus d'adresse de redirection et ne peut donc
+  {icon name=error}&nbsp;Un camarade signalé par ce symbole n'a plus d'adresse de redirection et ne peut donc
   plus être contacté via son adresse polytechnique.org. Si tu connais sa nouvelle adresse, tu peux nous la communiquer en
   cliquant sur le symbole.
 </p>
index f36a8f5..ab1561f 100644 (file)
@@ -26,7 +26,7 @@
   {if $asso.site}
   <tr>
     <td class="titre">
-      Site Web:
+      Site Web&nbsp;:
     </td>
     <td><a href="{$asso.site}">{$asso.site}</a></td>
   </tr>
@@ -35,7 +35,7 @@
   {if $asso.resp || $asso.mail}
   <tr>
     <td class="titre">
-      Contact:
+      Contact&nbsp;:
     </td>
     <td>
       {if $asso.mail}
@@ -50,7 +50,7 @@
   {if $asso.forum}
   <tr>
     <td class="titre">
-      Forum:
+      Forum&nbsp;:
     </td>
     <td>
       <a href="{$platal->ns}forum">par le web</a>
index 444c38e..bd354b8 100644 (file)
@@ -80,7 +80,7 @@ function searchX()
     <tr>
       <td colspan="2">
         <input type="checkbox" id="x" name="x" onchange="xStateChange(this);" />
-        <label for="x">Coche cette case sil s'agit d'un X non inscrit à Polytechnique.org.</label>
+        <label for="x">Coche cette case s'il s'agit d'un X non inscrit à Polytechnique.org.</label>
       </td>
     </tr>
     <tr id="xnom" style="display: none">
index f30c160..62c2675 100644 (file)
       <td colspan="2">
         <span id="make_X_cb">
           <input type="checkbox" name="is_x" id="is_x" onclick="showXInput(this);" onchange="showXInput(this);" />
-          <label for="is_x">coche cette case sil s'agit d'un X</label>
+          <label for="is_x">coche cette case s'il s'agit d'un X</label>
         </span>
         <span id="make_X_login" style="display: none">
           <span class="titre">Identifiant (prenom.nom.promo)&nbsp;:</span>