Merge branch 'master' of /home/git/platal into profile_edit
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 27 Aug 2007 21:19:38 +0000 (23:19 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Mon, 27 Aug 2007 21:25:08 +0000 (23:25 +0200)
Conflicts:

htdocs/css/keynote.css
modules/profile/get_general.inc.php
modules/profile/verif_general.inc.php

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
130 files changed:
bin/cron/banana.feedgen.php [changed from symlink to file mode: 0755]
bin/cron/checkdb.php
bin/cron/connect.db.inc.php [changed from symlink to file mode: 0644]
bin/cron/cron_validations.php
bin/cron/emails.check.php
bin/cron/homonymes.php
bin/cron/notifs.send.php
bin/csv2sql.php
bin/devel/xhtml.classes.pl
bin/lists.mhonarc_by_month.pl
bin/lists.rpc.py
classes/corelogger.php
classes/csvimporter.php
classes/env.php
classes/flagset.php
classes/miniwiki.php
classes/mmlist.php
classes/platal.php
classes/platalpage.php
classes/plmailer.php
classes/plset.php
classes/pltableeditor.php
classes/plupload.php
classes/session.php
classes/xnet.php
htdocs/css/ax.css
htdocs/css/default.css
htdocs/css/espace.css
htdocs/css/humlinux.css
htdocs/css/keynote.css
htdocs/css/linux.css
htdocs/css/nbviolet.css
htdocs/css/openweb.css
htdocs/css/spectral.css
htdocs/css/trapped.css
htdocs/css/wiki.css
htdocs/listes_redirect.php
htdocs/webredirect.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/emails.inc.php
include/geoloc.inc.php
include/homonymes.inc.php
include/marketing.inc.php
include/massmailer.inc.php
include/newsletter.inc.php
include/notifs.inc.php
include/platal.inc.php
include/profil.func.inc.php
include/rss.inc.php
include/secure_hash.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/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.server.inc.php
include/wiki.inc.php
include/wiki/engine.php
include/wiki/farmconfig.php
include/xnet/page.inc.php
include/xnet/session.inc.php
include/xorg.misc.inc.php
include/xorg/session.inc.php
modules/admin.php
modules/auth.php
modules/auth/auth.inc.php
modules/axletter.php
modules/axletter/axletter.inc.php
modules/banana.php
modules/bandeau.php
modules/core.php
modules/email.php
modules/events.php
modules/geoloc.php
modules/lists.php
modules/marketing.php
modules/newsletter.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/profile/assign_adresses.inc.php
modules/profile/assign_poly.inc.php
modules/profile/get_adresses.inc.php
modules/profile/get_deco.inc.php
modules/profile/get_mentor.inc.php
modules/profile/update_adresses.inc.php
modules/profile/verif_adresses.inc.php
modules/register.php
modules/register/register.inc.php
modules/search.php
modules/search/classes.inc.php
modules/search/search.inc.php
modules/stats.php
modules/survey.php
modules/xnet.php
modules/xnetevents/xnetevents.inc.php
modules/xnetgrp.php
modules/xnetgrp/mail.inc.php
plugins/block.tidy.php
plugins/function.display_address.php
plugins/function.select_db_table.php
plugins/insert.getNbIns.php
plugins/insert.getNbNotifs.php
plugins/insert.getUserName.php
plugins/insert.mkStats.php
upgrade/0.0.0_to_0.9.0/new_newsletter.sh
upgrade/0.0.0_to_0.9.0/to_mailman.py
upgrade/0.9.14/connect.db.inc.php [changed from symlink to file mode: 0644]
upgrade/0.9.2/update.sh
upgrade/0.9.3/update.sh
upgrade/0.9.4/update.sh

deleted file mode 120000 (symlink)
index 355e1d0eb8a39d93a3bd5fb57abe44e007b62694..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../banana.feedgen.php
\ No newline at end of file
new file mode 100755 (executable)
index 0000000000000000000000000000000000000000..b573adfe2d41a3a9b3e0684109953c929c0f4967
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/php5
+<?php
+/********************************************************************************
+ * spoolgen.php : spool generation
+ * --------------
+ *
+ * This file is part of the banana distribution
+ * Copyright: See COPYING files that comes with this distribution
+ ********************************************************************************/
+
+require_once 'connect.db.inc.php';
+require_once dirname(__FILE__).'/../include/banana/ml.inc.php';
+
+Banana::$mbox_helper = $globals->banana->mbox_helper;
+Banana::$spool_root = $globals->banana->spool_root;
+Banana::$nntp_host = "news://{$globals->banana->web_user}:{$globals->banana->web_pass}@{$globals->banana->server}:{$globals->banana->port}/";
+Banana::refreshAllFeeds(array('NNTP', 'MLArchive'));
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
index f6b4889..7f51b78 100755 (executable)
  ***************************************************************************/
 /*
  * verifie qu'il n'y a pas d'incoherences dans les tables de jointures
- * 
-*/ 
+ *
+*/
 
 require('./connect.db.inc.php');
 require("Console/Getopt.php");
 
-function check($sql, $commentaire='') 
+function check($sql, $commentaire='')
 {
     $it = XDB::iterRow($sql);
     if ($err = XDB::error()) echo $err;
@@ -43,7 +43,7 @@ function check($sql, $commentaire='')
             echo "|";
             foreach ($arr as $val) echo "\t$val\t|";
             echo "\n";
-        } 
+        }
         echo "\n";
     }
 }
@@ -139,7 +139,7 @@ check("SELECT e.uid, e.country, e.region FROM entreprises AS e LEFT JOIN geoloc_
 /* donne la liste des emails douteux que les administrateurs n'ont pas encore traité */
 check("SELECT  a1.alias, a2.alias, e1.email, e2.flags
         FROM  emails        AS e1
-        INNER JOIN  emails        AS e2 ON(e1.email = e2.email AND e1.uid!=e2.uid AND 
+        INNER JOIN  emails        AS e2 ON(e1.email = e2.email AND e1.uid!=e2.uid AND
             (e1.uid<e2.uid  OR  NOT FIND_IN_SET('active', e2.flags))
             )
         INNER JOIN  emails_watch  AS w  ON(w.email = e1.email AND w.state = 'pending')
@@ -154,7 +154,7 @@ check("SELECT  a1.alias, a2.alias, e1.email, e2.flags
 /* donne la liste des emails dangereux ou douteux*/
 info("SELECT  a1.alias, a2.alias, e1.email, e2.flags, w.state
         FROM  emails        AS e1
-        INNER JOIN  emails        AS e2 ON(e1.email = e2.email AND e1.uid!=e2.uid AND 
+        INNER JOIN  emails        AS e2 ON(e1.email = e2.email AND e1.uid!=e2.uid AND
             (e1.uid<e2.uid  OR  NOT FIND_IN_SET('active', e2.flags))
             )
         INNER JOIN  emails_watch  AS w  ON(w.email = e1.email AND w.state != 'safe')
deleted file mode 120000 (symlink)
index 55b7297113b8aa90cb3a11cd7ba5276521e2bc95..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../connect.db.inc.php
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..1cade25c72898226666f92f40aad3a486560cb7f
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2007 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                *
+ ***************************************************************************/
+
+ini_set('include_path',dirname(__FILE__).'/../include:' . dirname(__FILE__).'/../classes:/usr/share/php');
+
+require_once('xorg.inc.php');
+require_once('xorg.misc.inc.php');
+
+require_once 'xdb.php';
+
+$globals->baseurl = "https://www.polytechnique.org";
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
index dce1a64..4cab467 100755 (executable)
@@ -21,7 +21,7 @@
  ***************************************************************************/
 /* vim: set sw=4 ts=4 sts=4 tw=100:
  * vérifie qu'il n'y a pas de validations en cours, et maile si c'est le cas
-*/ 
+*/
 
 $M_PERIOD = "INTERVAL 3 HOUR"; // période d'envoi des mails de 3h
 $R_PERIOD = "INTERVAL 6 HOUR"; // période de réponse moyenne de 6h
@@ -58,7 +58,7 @@ while (list($type, $nb) = $res->next()) {
     $message .= "- $type: $nb\n";
 }
 
-$message = wordwrap($message,78);  
+$message = wordwrap($message,78);
 $mymail->setTxtBody($message);
 $mymail->send();
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index 5ad8bbe..b6aaf86 100755 (executable)
@@ -26,12 +26,12 @@ $panne_level = 3;
 
 require('./connect.db.inc.php');
 
-/* 
+/*
  * Check duplicated addresses
  */
 $sql = "SELECT a1.alias, a2.alias, e1.email
           FROM emails        AS e1
-    INNER JOIN emails        AS e2 ON (e1.email = e2.email AND e1.uid != e2.uid 
+    INNER JOIN emails        AS e2 ON (e1.email = e2.email AND e1.uid != e2.uid
                                        AND (e1.uid < e2.uid OR NOT FIND_IN_SET('active', e2.flags)))
      LEFT JOIN emails_watch  AS w  ON (e1.email = w.email)
     INNER JOIN aliases       AS a1 ON (a1.id = e1.uid AND a1.type = 'a_vie')
index 0c6338c..1530531 100755 (executable)
@@ -22,7 +22,7 @@
 /* vim: set sw=4 ts=4 sts=4 tw=100:
  * crée des demandes de validation pour les kill d'alias
  * une demande 10 jours avant pour un warning, puis une autre pour le robot
-*/ 
+*/
 
 $W_PERIOD = "INTERVAL 7 DAY"; // temps d'envoi du warning avant la deadline
 
index 583f0e1..12253c5 100755 (executable)
@@ -81,7 +81,7 @@ EOF;
   </body>
 </html>
 EOF;
-    
+
     $mailer = new PlMailer();
     $mailer->setFrom('Carnet Polytechnicien <support_carnet@' . $globals->mail->domain . '>');
     $mailer->addTo("\"$u['prenom']} {$u['nom']}\" <{$u['bestalias']}@" . $globals->mail->domain . '>');
index 20963d6..b2bdee3 100755 (executable)
@@ -20,7 +20,7 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once(dirname(__FILE__) . '/../classes/csvimporter.php'); 
+require_once(dirname(__FILE__) . '/../classes/csvimporter.php');
 
 // {{{ function showHelp()
 
@@ -81,9 +81,9 @@ function processArgs()
 // }}}
 
 global $debug, $action, $keys;
-$debug           = false; 
-$action          = CSV_INSERT; 
-$keys            = 'id'; 
+$debug           = false;
+$action          = CSV_INSERT;
+$keys            = 'id';
 
 processArgs();
 require_once(dirname(__FILE__) . '/../classes/xdb.php');
index f0524ef..2b66b6e 100755 (executable)
@@ -91,7 +91,7 @@ sub parse_tag($$) {
         if($tag =~ / (checked|disabled|multiple|readonly)( |$)/);
     print STDERR "${red}XHTML error: ${yel}attribut $1 ${blu}($file)${gra}\n"
         if($tag =~ / (align|width|border|color|valign)=/);
-   
+
     # récupération des classes utilisées ...
     if($tag =~ /^(\w+).* class=('{[^}]*}'|"{[^}]*}"|'[^{}']*'|"[^{}"]*")/) {
         my $t = lc($1);
@@ -102,7 +102,7 @@ sub parse_tag($$) {
             foreach my $cl (@cycle) {
                     &class_add($file,$t,$cl) if($cl);
             }
-        } else {   
+        } else {
             &class_add($file,$t,$c);
         }
     }
index c1b41d1..330434f 100755 (executable)
@@ -13,7 +13,7 @@ my $list   = shift;
 #
 ################################################################################
 # CONSTANTS
-# 
+#
 my $spool  = "/var/spool/platal/archives/";
 my $tmpbox = "mytmpbox.mbox";
 
@@ -64,13 +64,13 @@ while(<>) {
                 # dummy init
                 $odir = 1;
             }
-                
+
             $m = $conv{$1};
             $y = $2;
             open FILE,"> $tmpbox";
         }
     }
-    
+
     print FILE $line;
 }
 
index 4c07c5e..ea7e412 100755 (executable)
@@ -172,7 +172,7 @@ def quote(s, is_header=False):
     else:
         h = s
     h = str('').join(re.split('[\x00-\x08\x0B-\x1f]+', h))
-    return Utils.uquote(h.replace('&', '&amp;').replace('>', '&gt;').replace('<', '&lt;')) 
+    return Utils.uquote(h.replace('&', '&amp;').replace('>', '&gt;').replace('<', '&lt;'))
 
 def to_forlife(email):
     try:
index 611a7b1..baadf79 100644 (file)
@@ -54,7 +54,7 @@ class CoreLogger
     }
 
     /** Creates a new session entry in database and return its ID.
-     * 
+     *
      * @param $uid the id of the logged user
      * @param $suid the id of the administrator who has just su'd to the user
      * @return session the session id
index 6bb92ee..809a82c 100644 (file)
@@ -134,7 +134,7 @@ class CSVImporter
         VarStream::init();
         global $csv_source;
         $this->index     = null;
-        
+
         $csv_source = $csv;
         $res        = fopen('var://csv_source', 'r');
 
@@ -291,13 +291,13 @@ class CSVImporter
         }
         if ($current == 'values' && Env::has('csv_valid')) {
             $next = 'valid';
-        }    
+        }
         if (empty($csv)) {
             $next = 'source';
         }
         if (Env::has('csv_action')) {
             $_SESSION['csv_action'] = Env::v('csv_action');
-        } 
+        }
         if ($next == 'valid') {
             if ($current != 'valid') {
                 $cpyfields = array('csv_value', 'csv_user_value', 'csv_cond_field',
@@ -346,7 +346,7 @@ class CSVImporter
         $page->assign('csv_field_desc', $this->field_desc);
         $page->assign('csv_page', $next);
         $page->assign('csv_path', $url);
-        $page->assign('csv_fields', $fields);  
+        $page->assign('csv_fields', $fields);
     }
 }
 
index 378305f..7448a71 100644 (file)
@@ -41,10 +41,10 @@ class Env
         return Env::_get($key, $default);
     }
 
-    public static function s($key, $default = '') 
-    { 
-        return (string)Env::_get($key, $default); 
-    } 
+    public static function s($key, $default = '')
+    {
+        return (string)Env::_get($key, $default);
+    }
 
     public static function b($key, $default = false)
     {
@@ -90,10 +90,10 @@ class Post
         return (bool)Post::_get($key, $default);
     }
 
-    public static function s($key, $default = '') 
-    { 
-        return (string)Post::_get($key, $default); 
-    } 
+    public static function s($key, $default = '')
+    {
+        return (string)Post::_get($key, $default);
+    }
 
     public static function i($key, $default = 0)
     {
@@ -173,9 +173,9 @@ class Cookie
         return Cookie::_get($key, $default);
     }
 
-    public static function s($key, $default = '') 
+    public static function s($key, $default = '')
     {
-        return (string)Cookie::_get($key, $default); 
+        return (string)Cookie::_get($key, $default);
     }
 
     public static function b($key, $default = false)
index 40a3b14..ce3d558 100644 (file)
@@ -44,7 +44,7 @@ class Flagset
      * @param $flag XXX
      * @return VOID
      */
-    public function addFlag($flag) 
+    public function addFlag($flag)
     {
         if (!$flag) return;
         if (!$this->hasflag($flag)) {
@@ -59,7 +59,7 @@ class Flagset
      * @param $flag XXX
      * @return 1 || 0
      */
-    public function hasFlag($flag) 
+    public function hasFlag($flag)
     {
         $tok = strtok($this->value,$this->sep);
         while ($tok) {
@@ -75,8 +75,8 @@ class Flagset
     {
         $perms = explode(',', $flag);
         foreach ($perms as $perm)
-        {   
-            $ok = true; 
+        {
+            $ok = true;
             $rights = explode(':', $perm);
             foreach ($rights as $right) {
                 if (($right{0} == '!' && $this->hasFlag(substr($right, 1))) || !$this->hasFlag($right)) {
@@ -85,16 +85,16 @@ class Flagset
             }
             if ($ok) {
                 return true;
-            }       
+            }
         }
-        return false; 
+        return false;
     }
 
     /** remove flag
      * @param $flag XXX
      * @return VOID
      */
-    public function rmFlag($flag) 
+    public function rmFlag($flag)
     {
         if (!$flag) return;
         $newvalue = "";
@@ -116,7 +116,7 @@ class Flagset
     {
         return $this->value;
     }
-} 
+}
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>
index eb5e94e..e81d9b7 100644 (file)
@@ -21,25 +21,25 @@ class MiniWiki
         }
         return $id;
     }
-    
+
     public static function init()
     {
         if (isset(MiniWiki::$patternsWiki[0])) {
             return;
         }
         MiniWiki::Markup("/(\r\n|\r([^\n]))/", "\n$2", "\n$2");
-                
+
         // retours à la ligne avec \\
         MiniWiki::Markup("/\\\\(?".">(\\\\*))\n/e", "str_repeat('<br />\n',mb_strlen('$1'))", "str_repeat('\n',mb_strlen('$1'))", "ligne1\\\\\nligne2");
-        
-        // * unordered list 
+
+        // * unordered list
         MiniWiki::Markup("/(^|\n)\*(([^\n]*(\n|$))(\*[^\n]*(\n|$))*)/se",
                          "'</p><ul><li>'.str_replace(\"\\n*\",'</li><li>','$2').'</li></ul><p>'",
                          "'$1 -' . str_replace(\"\\n*\", \"\\n -\", '$2')",
-                         "* element1\n* element2\n* element3"); 
-        // # unordered list 
-        MiniWiki::Markup("/(^|\n)#(([^\n]*(\n|$))(#[^\n]*(\n|$))*)/se", "'<ol><li>'.str_replace(\"\\n#\",'</li><li>','$2').'</li></ol>'", "'$0'", "# element1\n# element2\n# element3"); 
-        
+                         "* element1\n* element2\n* element3");
+        // # unordered list
+        MiniWiki::Markup("/(^|\n)#(([^\n]*(\n|$))(#[^\n]*(\n|$))*)/se", "'<ol><li>'.str_replace(\"\\n#\",'</li><li>','$2').'</li></ol>'", "'$0'", "# element1\n# element2\n# element3");
+
         // bold, italic and others
         // ''' bold '''
         MiniWiki::Markup("/'''(.*?)'''/",'<strong>$1</strong>','*$1*', "'''gras'''");
@@ -62,14 +62,14 @@ class MiniWiki
                          "%red% texte en rouge %%\\\\\n%#ff0% texte en jaune %%\\\\\n%#0000ff% texte en bleu %%");
         // [+ big +] [++ bigger ++] [+++ even bigger +++] ...
         MiniWiki::Markup("/\\[(([-+])+)(.*?)\\1\\]/e","'<span style=\'font-size:'.(round(pow(6/5,$2mb_strlen('$1'))*100,0)).'%\'>$3</span>'", "'$3'", "[+ grand +]\n\n[++ plus grand ++]\n\n[+++ encore plus grand +++]");
-        
+
         // ----- <hr/>
         MiniWiki::Markup("/(\n|^)--(--+| \n)/s", '$1<hr/>', '$1-- '."\n", "----\n");
         // titles
         MiniWiki::$title_index = MiniWiki::Markup('/(\n|^)(!+)([^\n]*)/se',
                                                   "'$1<h'.mb_strlen('$2').'>$3</h'.mb_strlen('$2').'>'",
                                                   "'$1$3'", "!titre1\n\n!!titre2\n\n!!!titre3");
-        
+
         // links
         MiniWiki::Markup('/((?:https?|ftp):\/\/(?:[\.\,\;\!\:]*[\w@~%$£µ&i#\-+=_\/\?])*)/ui',
                          '<a href="\\0">\\0</a>', '<\\0>');
@@ -79,7 +79,7 @@ class MiniWiki
         MiniWiki::Markup('/\\[\\[\\s*<(?:a href=")?([^>]*)(?:">.*<\/a)?>\\s*\|([^\\]]+)\\]\\]/i',
                          '<a href="\\1">\\2</a>', '\\2 <\\1>',
                          "[[http://www.example.com|Mon site web]]\n\nhttp://www.example.com\n\ntest@example.com");
-        
+
         // paragraphs and empty lines
         MiniWiki::Markup("/\n\n/", '</p><p>', "\n\n", "paragraphe1\n\nparagraphe2");
         MiniWiki::Markup("/\n/", ' ', "\n");
@@ -100,7 +100,7 @@ class MiniWiki
         }
         return $html;
     }
-    
+
     private static function justify($text, $n)
     {
         $arr = explode("\n", wordwrap($text, $n));
@@ -111,28 +111,28 @@ class MiniWiki
             $nxl_split = preg_split('! +!u', $nxl);
             $nxw_len   = count($nxl_split) ? mb_strlen($nxl_split[0]) : 0;
             $line      = trim($line);
-        
+
             if (mb_strlen($line)+1+$nxw_len < $n) {
                 $res .= "$line\n";
                 continue;
             }
-            
+
             if (preg_match('![.:;]$!u',$line)) {
                 $res .= "$line\n";
                 continue;
             }
-        
+
             $tmp   = preg_split('! +!u', trim($line));
             $words = count($tmp);
             if ($words <= 1) {
                 $res .= "$line\n";
                 continue;
             }
-        
+
             $len   = array_sum(array_map('mb_strlen', $tmp));
             $empty = $n - $len;
             $sw    = floatval($empty) / floatval($words-1);
-            
+
             $cur = 0;
             $l   = '';
             foreach ($tmp as $word) {
@@ -145,7 +145,7 @@ class MiniWiki
         }
         return trim($res);
     }
-    
+
 
     public static function WikiToText($wiki, $just=false, $indent=0, $width=68, $title=false)
     {
index b70fcbf..b6fe5b5 100644 (file)
@@ -30,7 +30,7 @@ class MMList extends XmlrpcClient
         parent::__construct($url);
         if ($globals->debug & DEBUG_BT) {
             $this->bt = new PlBacktrace('MMList');
-        }   
+        }
     }
 
     public function __call($method, $args)
index f97f5e9..46de900 100644 (file)
@@ -142,7 +142,7 @@ class Platal
                 if (!isset($place[$part])) {
                     $place[$part] = array();
                 }
-                $place =& $place[$part]; 
+                $place =& $place[$part];
             }
             $place["#final#"] = array();
         }
index cfe745e..bf35d60 100644 (file)
@@ -95,7 +95,7 @@ abstract class PlatalPage extends Smarty
         if (Env::has('json') && count($this->_jsonVars)) {
             return $this->jsonDisplay();
         }
-        
+
         if (Env::v('display') == 'light') {
             $this->_page_type = SIMPLE;
         } elseif (Env::v('display') == 'raw') {
@@ -222,7 +222,7 @@ abstract class PlatalPage extends Smarty
     {
         if (!empty($css)) {
             $this->append('xorg_inline_css', $css);
-        }    
+        }
     }
 
     // }}}
@@ -276,7 +276,7 @@ function escape_xorgDB(&$item, $key)
 
 /**
  * default smarty plugin, used to auto-escape dangerous html.
- * 
+ *
  * < --> &lt;
  * > --> &gt;
  * " --> &quot;
@@ -331,7 +331,7 @@ function trimwhitespace($source, &$smarty)
     $source = preg_replace('/((?<!\?>)\n)[\s]+/m', '\1', $source);
     $source = preg_replace("!&&&tags&&&!e",  'array_shift($tagsmatches[0])', $source);
 
-    return $source; 
+    return $source;
 }
 
 // }}}
@@ -362,7 +362,7 @@ function _hide_email($source)
     $source = str_replace("\n", '', $source);
     return '<script type="text/javascript">//<![CDATA[' . "\n" .
            'Nix.decode("' . addslashes(str_rot13($source)) . '");' . "\n" .
-           '//]]></script>'; 
+           '//]]></script>';
 }
 
 function hide_emails($source, &$smarty)
@@ -385,7 +385,7 @@ function hide_emails($source, &$smarty)
     $source = preg_replace("!<[^>]+[-a-z0-9_+.]+@[-a-z0-9_.]+.+?>!ius", '&&&misc&&&', $source);
 
     //catch !
-    $source = preg_replace('!([-a-z0-9_+.]+@[-a-z0-9_.]+)!iue', '_hide_email("\1")', $source); 
+    $source = preg_replace('!([-a-z0-9_+.]+@[-a-z0-9_.]+)!iue', '_hide_email("\1")', $source);
     $source = preg_replace('!&&&ahref&&&!e', '_hide_email(array_shift($ahref[0]))', $source);
 
     // restore data
index 0377d80..eb26208 100644 (file)
@@ -38,7 +38,7 @@ class PlMail extends Smarty
         $this->template_dir  = $globals->spoolroot . "/templates/";
         $this->compile_dir   = $globals->spoolroot . "/spool/mails_c/";
         $this->config_dir    = $globals->spoolroot . "/configs/";
-        
+
 
         $this->register_outputfilter(Array($this, 'mail_format'));
         $this->register_function('from',    Array($this, 'setFrom'));
@@ -123,7 +123,7 @@ class PlMail extends Smarty
     }
 
     /** template function : subject.
-     * {subject text=...} 
+     * {subject text=...}
      */
     public function setSubject($params, &$smarty)
     {
@@ -234,7 +234,7 @@ class PlMailer extends Mail_Mime {
             $this->page->assign($var, $value);
         }
     }
-    
+
     public function assign_by_ref($var, &$value)
     {
         if (!is_null($this->page)) {
@@ -248,7 +248,7 @@ class PlMailer extends Mail_Mime {
             $this->page->register_modifier($var, $callback);
         }
     }
-    
+
     public function register_function($var, $callback)
     {
         if (!is_null($this->page)) {
@@ -306,12 +306,12 @@ class PlMailer extends Mail_Mime {
         if(empty($addrs)) {
             return false;
         }
-    
+
         $dests = Array();
         foreach($addrs as $a) {
             $dests[] = "{$a->mailbox}@{$a->host}";
         }
-    
+
         // very important to do it in THIS order very precisely.
         $body = $this->get(array('text_charset' => $this->charset,
                                  'text_encoding' => '8bit',
index 8cf1ba2..2338706 100644 (file)
@@ -277,7 +277,7 @@ abstract class MultipageView implements PlView
         unset($list['page']);
         unset($list['order']);
         return $list;
-    } 
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index ba57c72..be664fd 100644 (file)
@@ -19,7 +19,7 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-class PLTableEditor 
+class PLTableEditor
 {
     // the plat/al name of the page
     public $pl;
@@ -84,7 +84,7 @@ class PLTableEditor
                     $a['Value'] = $a['List'][0];
                 } else {
                     $a['Type'] = 'set';
-                } 
+                }
             }
             elseif (substr($a['Type'],0,5) == 'enum(') {
                 // get the list of options
@@ -111,7 +111,7 @@ class PLTableEditor
     }
 
     // called before editing $entry
-    private function prepare_edit(&$entry) 
+    private function prepare_edit(&$entry)
     {
         foreach ($this->vars as $field => $descr) {
             if ($descr['Type'] == 'set') {
@@ -133,7 +133,7 @@ class PLTableEditor
         }
         return $entry;
     }
-    
+
     // set whether the save button show redirect to list view or edit view
     public function list_on_edit($var)
     {
@@ -146,14 +146,14 @@ class PLTableEditor
         $this->vars[$name]['desc'] = $desc;
         $this->vars[$name]['display'] = $display;
     }
-    
+
     // add a join table, when deleting a row corresponding entries will be deleted in these tables
     public function add_join_table($name,$joinid,$joindel,$joinextra="")
     {
         if ($joindel)
             $this->jtables[$name] = array("joinid" => $joinid,"joinextra" => $joinextra?(" AND ".$joinextra):"");
     }
-    
+
     // add a sort key
     public function add_sort_field($key, $desc = false, $default = false)
     {
index 8844bc4..bab7286 100644 (file)
@@ -74,7 +74,7 @@ class PlUpload
         } else if (!move_uploaded_file($file['tmp_name'], $this->filename)) {
             return false;
         }
-        $this->checkContentType(); 
+        $this->checkContentType();
         return true;
     }
 
index 8fa0db7..4a80761 100644 (file)
@@ -53,10 +53,10 @@ class Session
         return isset($_SESSION[$key]) ? $_SESSION[$key] : $default;
     }
 
-    public static function s($key, $default = '') 
+    public static function s($key, $default = '')
     {
         return (string)Session::v($key, $default);
-    } 
+    }
 
     public static function i($key, $default = 0)
     {
index 58d1375..ad8a0b7 100644 (file)
@@ -53,8 +53,8 @@ class Xnet extends Platal
         $link = str_replace('%grp', $globals->asso('diminutif'), parent::near_hook());
         if ($link != $this->path) {
             return $link;
-        }   
-        return null; 
+        }
+        return null;
     }
 
     protected function find_hook()
index 560c205..d1254d3 100644 (file)
@@ -89,7 +89,7 @@ div.ax_mail div.body h2 {
     color : #a40000;
     border-width : 0 0 thin 0;
     border-style : dotted;
-    border-color : #a40000; 
+    border-color : #a40000;
 }
 
 div.ax_mail div.signature {
index 2957cc6..21e3537 100644 (file)
@@ -277,7 +277,7 @@ div.long td.rt { width: 65%; }
     6   Profil
         [ onglets des profils ]
 *******************************************************************************/
-  
+
 table.flags {
     margin: 1em 0em 0em 0em;
 }
index 4048436..2ecad1c 100644 (file)
@@ -122,7 +122,7 @@ td.conteneur_tab {
 #onglet li {
     background-color: #ddddff;
     border-color: #2f006f;
-} 
+}
 
 #onglet li:hover {
     background-color: #2f006f;
@@ -171,7 +171,7 @@ td.conteneur_tab {
     float: right;
     padding-right: 0.2em;
 }
-                
+
 #fiche_identite div.contact {
     border-color: #2f006f;
     background-color: #eeeeff;
index 10b57b7..c462e83 100644 (file)
@@ -30,7 +30,7 @@ fieldset {
 legend {
     background-color: #dddddd;
 }
-    
+
 
 /*******************************************************************************
     2   Styles <p>, <div>, <span>, <li>
@@ -90,7 +90,7 @@ div.contact div.long {
     background-repeat: repeat-y;
     background-position: top left;
 }
-            
+
 #body-logo {
     border-top: none;
     border-bottom: none;
index 6fa6dc3..3c1a22c 100644 (file)
@@ -39,7 +39,7 @@ a:hover { color: #999; }
 img   { vertical-align: middle; }
 a img { border: 0px; }
 td    { vertical-align: top; }
-li    { padding-left: 3px; padding-right: 3px; 
+li    { padding-left: 3px; padding-right: 3px;
         text-align: justify; }
 hr    { text-align: center; }
 dt    { font-weight: bold; }
@@ -191,7 +191,7 @@ table.tinybicol th, table.bicol th {
 }
 
 table.tinybicol tr:first-child th, table.bicol tr:first-child th {
-    color: #fff; 
+    color: #fff;
     background: url('../images/skins/keynote_title.gif') #000 top left repeat-x;
 }
 
@@ -483,8 +483,8 @@ td.conteneur_tab {
 #fiche_identite div.civilite {
     text-align: center;
     font-weight: bold;
-    width: 80%; 
-    float: left; 
+    width: 80%;
+    float: left;
     color: #fff;
     background: inherit;
     padding-top: 0.5ex;
@@ -518,7 +518,7 @@ td.conteneur_tab {
 
 
 #fiche_identite div.email {
-    clear: left; 
+    clear: left;
     float: left;
 }
 
@@ -530,7 +530,7 @@ td.conteneur_tab {
 
 #fiche_identite div.formation {
     margin: 0em 1em;
-    clear: both;  
+    clear: both;
 }
 
 div.adresse {
index 9edcabc..f0e79b5 100644 (file)
@@ -34,7 +34,7 @@ legend {
     border: 1px #777777 solid;
     color: inherit;
 }
-    
+
 
 /*******************************************************************************
     2   Styles <p>, <div>, <span>, <li>
@@ -49,7 +49,7 @@ h1 a:link, h1 a:visited, h1 a:active {
 h1 a:hover {
     color: #cccccc;
 }
-        
+
 h1 {
     color: #eeeeee;
     background-color: #444444;
index 0492410..7fc0ae9 100644 (file)
@@ -98,7 +98,7 @@ table.tinybicol th, table.bicol th {
 #skin td.skigauche {
     background-color: #efddff;
 }
-                        
+
 /*******************************************************************************
     5   Contacts
         [ Styles liés à l'affichage de contacts ]
index 482b3a1..f0f9d9a 100644 (file)
@@ -268,7 +268,7 @@ div.long td.rt { width: 65%; }
     6   Profil
         [ onglets des profils ]
 *******************************************************************************/
-  
+
 table.flags {
     margin: 1em 0em 0em 0em;
 }
@@ -507,33 +507,33 @@ div.adresse div.titre { color: purple; }
 .backtrace:hover div.hide { display: block }
 .backtrace h1 { margin: 0px; }
 
-#suid { 
-    color: red; 
-    background: #ffc0cb; 
-    width: auto; 
-    font-weight: bold; 
-    text-align: center; 
-} 
-#suid a { 
-    color: red; 
-    background: inherit; 
-    text-decoration: none; 
-    display: block; 
-} 
-#suid:hover { 
-    color: red; 
-    background: #ffffcb; 
-} 
-#suid a:hover { 
-    color: #ff7000; 
-    background: inherit; 
-} 
+#suid {
+    color: red;
+    background: #ffc0cb;
+    width: auto;
+    font-weight: bold;
+    text-align: center;
+}
+#suid a {
+    color: red;
+    background: inherit;
+    text-decoration: none;
+    display: block;
+}
+#suid:hover {
+    color: red;
+    background: #ffffcb;
+}
+#suid a:hover {
+    color: #ff7000;
+    background: inherit;
+}
 
 table#body {
     color: #000;
     background: #fff;
     border: 3px solid #000;
-    
+
     width: 900px;
     margin: 1em auto;
 }
index a897a22..9c5ddfc 100644 (file)
@@ -47,7 +47,7 @@ h1 a:link, h1 a:visited, h1 a:active {
 h1 a:hover {
     color: #cccccc;
 }
-            
+
 h1 {
     color: #eeeeee;
     background-color: #444444;
@@ -99,7 +99,7 @@ table.bicol th a:active, table.bicol th a:hover {
 
 #skin td.skigauche {
     background-color: #ccddff;
-}                        
+}
 
 /*******************************************************************************
     5   Contacts
@@ -132,8 +132,8 @@ td.conteneur_tab {
     background-color: #ccddff;
 }
 
-#onglet li:hover { 
-    background-color: 
+#onglet li:hover {
+    background-color:
 }
 
 #onglet li.actif {
index e46db2f..8b3a917 100644 (file)
@@ -50,7 +50,7 @@ legend {
     border: 1px #ab8b7d solid;
     color: inherit;
 }
-    
+
 
 /*******************************************************************************
     2   Styles <p>, <div>, <span>, <li>
@@ -63,7 +63,7 @@ h1 a:link, h1 a:visited, h1 a:active {
 }
 
 h1 a:hover { color: #e2d9c2; }
-        
+
 h1 {
     color: #ffffff;
     background-image: url("../images/skins/trapped_titre.gif");
@@ -85,7 +85,7 @@ table.tinybicol, table.bicol {
 table.tinybicol tr, table.bicol tr { }
 table.tinybicol tr.pair, table.bicol tr.pair { background-color: #e2d9c2; }
 table.tinybicol th, table.bicol th {
-    background-color: #291602;  
+    background-color: #291602;
 }
 
 table.tinybicol th a:link,
@@ -181,9 +181,9 @@ td.conteneur_tab {
 
 #fiche h2 {
     color: #7a614f;
-    background-color: #f2e9e2;    
+    background-color: #f2e9e2;
     border-top: 1px solid #ab8b7d;
-    border-bottom: 1px solid #ab8b7d; 
+    border-bottom: 1px solid #ab8b7d;
     border-right: 1px solid #ab8b7d;
 }
 
@@ -222,7 +222,7 @@ td.conteneur_tab {
 /* only for fiche_referent.php*/
 
 #fiche_referent em{color: #5a412f;}
-                                                                                                            
+
 /*******************************************************************************
     A   SKIN
         [ choix de classes faites par le skinneur
index a8612d4..89fc8e8 100644 (file)
@@ -43,38 +43,38 @@ table.quickref td {
 
 .diffbox {
     border: 1px #999999 solid;
-    margin-top: 1.33em; 
+    margin-top: 1.33em;
 }
 .diffauthor {
-    font-weight: bold; 
+    font-weight: bold;
 }
 .diffchangesum {
-    font-weight: bold; 
+    font-weight: bold;
 }
 .difftime {
     font-size: 66%;
-    background-color: #dddddd; 
+    background-color: #dddddd;
 }
 .difftype {
     clear: both;
     font-size: 66%;
-    font-weight: bold; 
+    font-weight: bold;
 }
 .diffadd {
     border-left: 5px #99ff99 solid;
-    padding-left: 5px; 
+    padding-left: 5px;
 }
 .diffdel {
     border-left: 5px #ffff99 solid;
-    padding-left: 5px; 
+    padding-left: 5px;
 }
 .diffrestore {
     clear: both;
     font-size: 66%;
-    margin: 1.5em 0px; 
+    margin: 1.5em 0px;
 }
 a.varlink {
-    text-decoration: none; 
+    text-decoration: none;
 }
 a.createlink {
     font-size: smaller;
index c3eba99..ef1d86a 100644 (file)
@@ -29,7 +29,7 @@ if ($matches) {
     $mbox   = $matches[2];
     $fqdn   = strtolower($matches[3]);
     $sup    = $matches[4];
+
     if ($fqdn == 'polytechnique.org') {
         http_redirect("https://www.polytechnique.org/lists/$action/$mbox$sup");
     }
index dfecc26..fd83b8d 100644 (file)
@@ -24,9 +24,9 @@ require_once dirname(__FILE__).'/../include/xorg.inc.php';
 global $globals;
 list($username, $path) = preg_split('/\//', $_SERVER["REQUEST_URI"], 2, PREG_SPLIT_NO_EMPTY);
 $res = XDB::query(
-        "SELECT  redirecturl 
-           FROM  auth_user_quick AS a 
-     INNER JOIN  aliases         AS al ON (al.id = a.user_id AND (al.type='a_vie' OR al.type='alias')) 
+        "SELECT  redirecturl
+           FROM  auth_user_quick AS a
+     INNER JOIN  aliases         AS al ON (al.id = a.user_id AND (al.type='a_vie' OR al.type='alias'))
       LEFT JOIN  virtuals_redirect AS vr ON (vr.redirect LIKE CONCAT(al.alias, '@%')
      INNER JOIN  virtuals        AS v ON (v.vid = vr.vid)
           WHERE  al.alias = {?} OR v.alias = CONCAT({?}, '@', {?})
index eacbc34..babf28e 100644 (file)
@@ -24,7 +24,7 @@ global $page;
 function applis_options($current=0) {
     $html = '<option value="-1"></option>';
     $res  = XDB::iterator("select * from applis_def order by text");
-    while ($arr_appli = $res->next()) { 
+    while ($arr_appli = $res->next()) {
         $html .= '<option value="'.$arr_appli["id"].'"';
         if ($arr_appli["id"]==$current) $html .= " selected='selected'";
         $html .= '>'.htmlspecialchars($arr_appli["text"])."</option>\n";
@@ -73,9 +73,9 @@ function applis_fmt($type, $text, $url) {
         $txt .= $type;
     if ($text != "Université") {
         if ($txt) $txt .= ' ';
-        if ($url) 
+        if ($url)
             $txt .= "<a href=\"$url\" onclick=\"return popup(this)\">$text</a>";
-        else 
+        else
             $txt .= $text;
     }
     if (!$txt) {
index 1a493c6..10302d8 100644 (file)
@@ -80,8 +80,8 @@ class ForumsBanana extends Banana
         }
 
         // Build user profile
-        $req = XDB::query("      
-                 SELECT  nom     
+        $req = XDB::query("
+                 SELECT  nom
                    FROM  {$globals->banana->table_prefix}abos
               LEFT JOIN  {$globals->banana->table_prefix}list ON list.fid=abos.fid
                   WHERE  uid={?}", S::i('uid'));
@@ -93,7 +93,7 @@ class ForumsBanana extends Banana
         Banana::$profile['lastnews']                = S::v('banana_last');
         Banana::$profile['subscribe']               = $req->fetchColumn();
 
-        // Update the "unread limit" 
+        // Update the "unread limit"
         if (!is_null($time)) {
             XDB::execute("UPDATE  auth_user_quick
                              SET  banana_last = FROM_UNIXTIME({?})
@@ -105,14 +105,14 @@ class ForumsBanana extends Banana
             Banana::$page->killPage('forums');
             Banana::$page->killPage('subscribe');
             Banana::$spool_boxlist = false;
-        } else {            
+        } else {
             // Register custom Banana links and tabs
             if (!Banana::$profile['autoup']) {
                 Banana::$page->registerAction('<a href=\'javascript:dynpostkv("'
                                     . $platal->path . '", "updateall", ' . time() . ')\'>'
                                     . 'Marquer tous les messages comme lus'
                                     . '</a>', array('forums', 'thread', 'message'));
-            }   
+            }
             Banana::$page->registerPage('profile', 'Préférences', null);
         }
 
index 9271fb4..54c5f53 100644 (file)
@@ -39,7 +39,7 @@ function hook_formatDisplayHeader($_header, $_text, $in_spool = false)
                         . '<img src="images/icons/user_suit.gif" title="fiche" alt="" /></a>';
                 } else {
                     return $address;
-                }    
+                }
             }
             if (!empty($text)) {
                 $text .= ', ';
@@ -143,7 +143,7 @@ function hook_makeLink($params)
         if (@$params['action'] == 'subscribe') {
             return $base . '/subscription';
         }
-    
+
         if (!isset($params['group'])) {
             return $base;
         }
@@ -151,8 +151,8 @@ function hook_makeLink($params)
     } else if (Banana::$protocole->name() == 'NNTP' && $xnet) {
         if ($feed) {
             return 'http://www.polytechnique.org/banana' . hook_platalRSS(@$params['group']);
-        }   
-        $base = $globals->baseurl . '/' . $platal->ns . 'forum';        
+        }
+        $base = $globals->baseurl . '/' . $platal->ns . 'forum';
     } else if (Banana::$protocole->name() == 'MLArchives') {
         if ($feed) {
             return $globals->baseurl . '/' . $platal->ns . hook_platalRSS(MLBanana::$listname);
@@ -184,9 +184,9 @@ function get_banana_params(array &$get, $group = null, $action = null, $artid =
     }
     if (!is_null($action)) {
         if ($action == 'new') {
-            $get['action'] = 'new'; 
+            $get['action'] = 'new';
         } elseif (!is_null($artid)) {
-            $get['artid'] = $artid; 
+            $get['artid'] = $artid;
             if ($action == 'reply') {
                 $get['action'] = 'new';
             } elseif ($action == 'cancel') {
@@ -203,9 +203,9 @@ function get_banana_params(array &$get, $group = null, $action = null, $artid =
             } elseif ($action) {
                 $get['part'] = str_replace('.', '/', $action);
             }
-            if (Get::v('action') == 'showext') { 
-                $get['action'] = 'showext'; 
-            }   
+            if (Get::v('action') == 'showext') {
+                $get['action'] = 'showext';
+            }
         }
     }
 }
@@ -227,7 +227,7 @@ function run_banana(&$page, $class, array $args)
     $bt = $banana->backtrace();
     if ($bt) {
         new PlBacktrace(Banana::$protocole->name(), $banana->backtrace(), 'response', 'time');
-    }    
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index 4880a53..a4be8df 100644 (file)
@@ -38,7 +38,7 @@ class MLBanana extends Banana
         Banana::$mbox_helper = $globals->banana->mbox_helper;
         if (S::has_perms()) {
             Banana::$msgshow_mimeparts[] = 'source';
-        }    
+        }
         array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail');
         if (!S::v('core_rss_hash')) {
             Banana::$feed_active = false;
@@ -63,10 +63,10 @@ class MLBanana extends Banana
         Banana::$profile['headers']['From']         = "$nom <$mail>";
         Banana::$profile['headers']['Organization'] = 'Utilisateur de Polytechnique.org';
         Banana::$profile['signature']               = $sig;
-        
+
         // Page design
         Banana::$page->killPage('forums');
-        Banana::$page->killPage('subscribe'); 
+        Banana::$page->killPage('subscribe');
 
         // Run Banana
         return parent::run();
index 76ca291..4931902 100644 (file)
@@ -108,23 +108,23 @@ class BananaMLInterface implements BananaProtocoleInterface
 
     public function __construct()
     {
-        $this->infos = ModerationBanana::$client->get_members(ModerationBanana::$listname); 
+        $this->infos = ModerationBanana::$client->get_members(ModerationBanana::$listname);
         $this->infos = $this->infos[0];
-        
+
         $mods = ModerationBanana::$client->get_pending_ops(ModerationBanana::$listname);
         $this->helds = $mods[1];
     }
-    
+
     public function isValid()
     {
         return !is_null(ModerationBanana::$client);
     }
-    
+
     public function lastErrNo()
     {
         return 0;
     }
-    
+
     public function lastError()
     {
         return null;
index d167af1..325c5ab 100644 (file)
@@ -287,7 +287,7 @@ class Redirect
 
     // public function modify_one_email() {{{2
 
-    public function modify_one_email($email, $activate) 
+    public function modify_one_email($email, $activate)
     {
         $allinactive = true;
         $thisone = false;
@@ -310,7 +310,7 @@ class Redirect
             return ERROR_INACTIVE_REDIRECTION;
         } else {
             return SUCCESS;
-        } 
+        }
     }
 
     // public function modify_one_email_redirect() {{{2
index bb341fd..de0d4d4 100644 (file)
@@ -95,7 +95,7 @@ $GLOBALS['page']->register_function('geoloc_region', '_geoloc_region_smarty');
  * store on the fly the info of the city concerned
  * @param $txt the raw text of an address
  */
-function get_address_infos($txt) 
+function get_address_infos($txt)
 {
     global $globals;
     $url = $globals->geoloc->webservice_url."address.php?precise=1&txt=" . urlencode($txt);
@@ -171,7 +171,7 @@ function get_new_maps($url)
 /** make the text of an address that can be read by a mailman
  * @param $adr an array with all the usual fields
  */
-function get_address_text($adr) 
+function get_address_text($adr)
 {
     $t = "";
     if (isset($adr['adr1']) && $adr['adr1']) $t.= $adr['adr1'];
@@ -217,7 +217,7 @@ function compare_addresses_text($a, $b)
 {
     $ta = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $a));
     $tb = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $b));
-   
+
     $la = explode("\n", $ta);
     $lb = explode("\n", $tb);
 
@@ -299,7 +299,7 @@ function localize_addresses($uid)
 /** synchronise the local geoloc_city base to geoloc.org
  * @param $id the id of the city to synchronize
  */
-function synchro_city($id) 
+function synchro_city($id)
 {
     global $globals;
     $url = $globals->geoloc->webservice_url."cityFinder.php?method=id&id=".$id."&out=sql";
@@ -318,7 +318,7 @@ function fix_cities_not_on_map($limit=false, $cityid=false)
 {
     $missing = XDB::query("SELECT  c.id
                              FROM  geoloc_city AS c
-                        LEFT JOIN  geoloc_city_in_maps AS m ON(c.id = m.city_id) 
+                        LEFT JOIN  geoloc_city_in_maps AS m ON(c.id = m.city_id)
                             WHERE  m.city_id IS NULL"
                             . ($cityid ? " AND c.id = '" . $cityid . "'" : "" )
                             . ($limit ?  " LIMIT $limit" : "" ));
@@ -368,7 +368,7 @@ function geoloc_to_y($lon, $lat)
     if ($lat > 75) {
         return latToY(75);
     }
-    return -100 * log(tan(pi()/4 + deg2rad(1)/2*$lat));   
+    return -100 * log(tan(pi()/4 + deg2rad(1)/2*$lat));
 }
 
 function size_of_city($nb)
@@ -431,18 +431,18 @@ function geoloc_getData_subcities($mapid, $SFields, &$cities, $direct=true)
     }
 }
 
-function geoloc_getData_subcountries($mapid, $sin, $minentities) 
+function geoloc_getData_subcountries($mapid, $sin, $minentities)
 {
     $countries = array();
     $cities = array();
-    
+
     if ($mapid === false) {
         $wheremapid = "WHERE gm.parent IS NULL";
     } else {
         $wheremapid = "WHERE   gm.parent = {?}";
     }
     $submapres = XDB::iterator(
-        "SELECT  gm.map_id AS id, gm.name, gm.x, gm.y, gm.xclip, gm.yclip, 
+        "SELECT  gm.map_id AS id, gm.name, gm.x, gm.y, gm.xclip, gm.yclip,
                  gm.width, gm.height, gm.scale, 1 AS rat
            FROM  geoloc_maps AS gm
         ". $wheremapid, Env::v('mapid',''));
@@ -455,7 +455,7 @@ function geoloc_getData_subcountries($mapid, $sin, $minentities)
         $country['swf'] = $globals->geoloc->webservice_url."maps/mercator/map_".$c['id'].".swf";
         $countries[$c['id']] = $country;
     }
-    
+
     if ($mapid === false) {
         return array($countries, $cities);
     }
@@ -480,8 +480,8 @@ function geoloc_getData_subcountries($mapid, $sin, $minentities)
                                           array('map.parent'),
                                           array('adresses','geoloc_city_in_maps','geoloc_maps'),
                                           array('am','gcim','map'),
-                                          array(getadr_join('am'), 
-                                          'am.cityid = gcim.city_id', 
+                                          array(getadr_join('am'),
+                                          'am.cityid = gcim.city_id',
                                           'map.map_id = gcim.map_id'));
     $fields = new SFieldGroup(true, $SFields);
     $where  = $fields->get_where_statement();
@@ -496,7 +496,7 @@ function geoloc_getData_subcountries($mapid, $sin, $minentities)
                             $where,
                             'map.map_id',
                             'NULL');
-    
+
     $maxpop = 0;
     $nbentities = $nbcities + $countryres->total();
     while ($c = $countryres->next()) {
@@ -507,28 +507,28 @@ function geoloc_getData_subcountries($mapid, $sin, $minentities)
         $c['xPop'] = geoloc_to_x($c['lonPop'], $c['latPop']);
         $c['yPop'] = geoloc_to_y($c['lonPop'], $c['latPop']);
         @$countries[$c['id']] = array_merge($countries[$c['id']], $c);
-    
+
         $nbcities += $c['nbCities'];
-    } 
-    
+    }
+
     if ($nocity && $nbcities < $minentities){
         foreach($countries as $i => $c) {
             $countries[$i]['nbPop'] = 0;
             if (@$c['nbCities'] > 0) {
                 geoloc_getData_subcities($c['id'], $sin, $cities, false);
-            }   
+            }
         }
     }
-    
+
     foreach ($countries as $i => $c) {
         if ($c['nbPop'] > 0) {
             $lambda = pow($c['nbPop'] / $maxpop,0.3);
             $countries[$i]['color'] = 0x0000FF + round((1-$lambda) * 0xFF)*0x010100;
         }
     }
-    
-    return array($countries, $cities);   
-} 
+
+    return array($countries, $cities);
+}
 // }}}
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index dd592f0..93406c0 100644 (file)
@@ -57,7 +57,7 @@ function switch_bestalias($uid, $loginbis) {
     $res = XDB::query("SELECT alias FROM aliases WHERE id = {?} AND FIND_IN_SET('bestalias', flags)", $uid);
     $bestalias = $res->fetchOneCell();
     if ($bestalias && $bestalias != $loginbis) return false;
-    
+
     // select the shortest alias still alive
     $res = XDB::query("SELECT alias FROM aliases WHERE id = {?} AND alias != {?} AND expire IS NULL ORDER BY LENGTH(alias) LIMIT 1", $uid, $loginbis);
     $newbest = $res->fetchOneCell();
index 699fb54..abd8482 100644 (file)
@@ -48,7 +48,7 @@ class Marketing
         $this->type   = $type;
         $this->data   = $data;
         $this->from   = $from;
-        $this->sender = $sender; 
+        $this->sender = $sender;
     }
 
     private function getUser($uid, $email)
@@ -59,7 +59,7 @@ class Marketing
                             WHERE  user_id = {?}", $uid);
         if ($res->numRows() == 0) {
             return null;
-        } 
+        }
         $user            = $res->fetchOneAssoc();
         $user['id']      = $uid;
         $user['forlife'] = make_forlife($user['prenom'], $user['nom'], $user['promo']);
@@ -71,7 +71,7 @@ class Marketing
     private function getFrom($from, $sender)
     {
         global $globals;
-        
+
         if ($from == 'staff') {
             return '"L\'équipe de Polytechnique.org" <register@' . $globals->mail->domain . '>';
         } else {
@@ -143,7 +143,7 @@ class Marketing
         if ($valid) {
             require_once 'validations.inc.php';
             $valid = new MarkReq($this->sender, $this->user['id'], $this->user['mail'],
-                                 $this->from == 'user', $this->type, $this->data); 
+                                 $this->from == 'user', $this->type, $this->data);
             $valid->submit();
         }
         return true;
@@ -188,7 +188,7 @@ class Marketing
         if (!$email) {
             XDB::execute("DELETE FROM register_marketing WHERE uid = {?}", $uid);
         } else {
-            XDB::execute("DELETE FROM register_marketing WHERE uid = {?} AND email = {?}", $uid, $email);        
+            XDB::execute("DELETE FROM register_marketing WHERE uid = {?} AND email = {?}", $uid, $email);
         }
     }
 
@@ -200,7 +200,7 @@ class Marketing
             $res = XDB::query("SELECT COUNT(*) FROM auth_user_md5 WHERE deces=0");
             $nbx = $res->fetchOneCell();
         }
-    
+
         $res = XDB::query("SELECT  r.date, u.promo, u.nom, u.prenom, r.email, r.bestalias
                              FROM  register_pending AS r
                        INNER JOIN  auth_user_md5    AS u ON u.user_id = r.uid
@@ -208,13 +208,13 @@ class Marketing
         if (!list($date, $promo, $nom, $prenom, $email, $alias) = $res->fetchOneRow()) {
             return false;
         }
-    
+
         require_once('secure_hash.inc.php');
         $hash     = rand_url_id(12);
         $pass     = rand_pass();
         $pass_encrypted = hash_encrypt($pass);
         $fdate    = strftime('%d %B %Y', strtotime($date));
-    
+
         $mymail = new PlMailer('marketing/mail.relance.tpl');
         $mymail->assign('nbdix',      $nbx);
         $mymail->assign('fdate',      $fdate);
@@ -240,7 +240,7 @@ interface MarketingEngine
     public function process(array $user);
 }
 
-// 
+//
 class AnnuaireMarketing implements MarketingEngine
 {
     protected $titre;
index af9a5bd..530d554 100644 (file)
@@ -58,7 +58,7 @@ abstract class MassMailer
         $res = XDB::query("SELECT  IF (n.short_name IS NULL, n.id, n.short_name)
                              FROM  {$this->_table} AS n
                             WHERE  n.bits != 'new' AND {$where}
-                            LIMIT  1"); 
+                            LIMIT  1");
         if ($res->numRows() != 1) {
             return null;
         }
@@ -108,7 +108,7 @@ abstract class MassMailer
     public function head($prenom = null, $nom = null, $sexe = null, $type = 'text')
     {
         if (is_null($prenom)) {
-            return $this->_head; 
+            return $this->_head;
         } else {
             $head = $this->_head;
             $head = str_replace('<cher>',   $sexe ? 'Chère' : 'Cher', $head);
@@ -204,7 +204,7 @@ abstract class MassMailer
             XDB::execute("UPDATE  {$this->_subscriptionTable}
                              SET  last = {?}
                            WHERE " . implode(' OR ', $sent), $this->_id);
-            
+
             sleep(60);
         }
     }
index 9840775..0ab9899 100644 (file)
@@ -58,7 +58,7 @@ class NewsLetter extends MassMailer
         while (list($cid, $title) = $res->next()) {
             $this->_cats[$cid] = $title;
         }
-    
+
         $res = XDB::iterRow(
                 "SELECT  a.title,a.body,a.append,a.aid,a.cid,a.pos
                    FROM  newsletter_art AS a
@@ -76,7 +76,7 @@ class NewsLetter extends MassMailer
         XDB::execute('UPDATE newsletter SET date={?},titre={?},titre_mail={?},head={?},short_name={?} WHERE id={?}',
                      $this->_date, $this->_title, $this->_title_mail, $this->_head, $this->_shortname,$this->_id);
     }
-  
+
     public function getArt($aid)
     {
         foreach ($this->_arts as $key=>$artlist) {
@@ -104,7 +104,7 @@ class NewsLetter extends MassMailer
                          $this->_arts['a'.$a->_aid] = $a;
         }
     }
-   
+
     public function delArticle($aid)
     {
         XDB::execute('DELETE FROM newsletter_art WHERE id={?} AND aid={?}', $this->_id, $aid);
@@ -121,7 +121,7 @@ class NewsLetter extends MassMailer
     protected function setSent()
     {
         XDB::execute("UPDATE newsletter  SET bits='sent' WHERE id={?}", $this->_id);
-    }   
+    }
 
     static public function subscriptionState($uid = null)
     {
@@ -130,8 +130,8 @@ class NewsLetter extends MassMailer
                              FROM  newsletter_ins
                             WHERE  user_id={?}", $user);
         return $res->fetchOneCell();
-    }   
-    
+    }
+
     static public function unsubscribe($uid = null)
     {
         $user = is_null($uid) ? S::v('uid') : $uid;
@@ -181,7 +181,7 @@ class NewsLetter extends MassMailer
 class NLArticle
 {
     // {{{ properties
-    
+
     var $_aid;
     var $_cid;
     var $_pos;
@@ -191,7 +191,7 @@ class NLArticle
 
     // }}}
     // {{{ constructor
-    
+
     function __construct($title='', $body='', $append='', $aid=-1, $cid=0, $pos=0)
     {
         $this->_body   = $body;
@@ -210,13 +210,13 @@ class NLArticle
 
     // }}}
     // {{{ function body()
-    
+
     public function body()
     { return trim($this->_body); }
-    
+
     // }}}
     // {{{ function append()
-    
+
     public function append()
     { return trim($this->_append); }
 
@@ -239,14 +239,14 @@ class NLArticle
         $title = "<h2 class='xorg_nl'><a id='art{$this->_aid}'></a>".pl_entities($this->title()).'</h2>';
         $body  = MiniWiki::WikiToHTML($this->_body);
         $app   = MiniWiki::WikiToHTML($this->_append);
-    
+
         $art   = "$title\n";
         $art  .= "<div class='art'>\n$body\n";
         if ($app) {
             $art .= "<div class='app'>$app</div>";
         }
         $art  .= "</div>\n";
-    
+
         return $art;
     }
 
index 3e691c1..4295b16 100644 (file)
@@ -132,7 +132,7 @@ function select_notifs($mail, $uid=null, $last=null, $iterator=true)
 // }}}
 // {{{ function getNbNotifs
 
-function getNbNotifs() 
+function getNbNotifs()
 {
     if (!S::has('uid')) {
         return 0;
@@ -155,7 +155,7 @@ function getNbNotifs()
 // }}}
 // {{{ class AllNotifs
 
-class AllNotifs 
+class AllNotifs
 {
     public $_cats = Array();
     public $_data = Array();
@@ -187,7 +187,7 @@ class AllNotifs
 // }}}
 // {{{ class Notifs
 
-class Notifs 
+class Notifs
 {
     public $_uid;
     public $_cats = Array();
@@ -220,7 +220,7 @@ class Notifs
 // }}}
 // {{{ class Watch
 
-class Watch 
+class Watch
 {
     public $_uid;
     public $_promos;
index 073479c..7ab9ef8 100644 (file)
@@ -119,22 +119,22 @@ set_error_handler('pl_error_handler', E_ALL | E_STRICT);
 register_shutdown_function('pl_print_errors');
 // register_shutdown_function('pl_dump_env');
 
-/** Check if the string is utf8 
+/** Check if the string is utf8
  */
 function is_utf8($s)
 {
     return @iconv('utf-8', 'utf-8', $s) == $s;
 }
 
-/** vérifie si une adresse email est bien formatée  * ATTENTION, cette fonction ne doit pas être appelée sur une chaîne ayant subit un addslashes (car elle accepte le "'" qui it alors un "\'" 
- * @param $email l'adresse email a verifier 
+/** vérifie si une adresse email est bien formatée  * ATTENTION, cette fonction ne doit pas être appelée sur une chaîne ayant subit un addslashes (car elle accepte le "'" qui it alors un "\'"
+ * @param $email l'adresse email a verifier
  * @return BOOL  */
-function isvalid_email($email) 
+function isvalid_email($email)
 {
-    // la rfc2822 authorise les caractères "a-z", "0-9", "!", "#", "$", "%", "&", "'", "*", "+", "-", "/", "=", "?", "^",  `", "{", "|", "}", "~" aussi bien dans la partie locale que dans le domaine. 
-    // Pour la partie locale, on réduit cet ensemble car il n'est pas utilisé. 
-    // Pour le domaine, le système DNS limite à [a-z0-9.-], on y ajoute le "_" car il est parfois utilisé. 
-    return preg_match("/^[a-z0-9_.'+-]+@[a-z0-9._-]+\.[a-z]{2,4}$/i", $email); 
+    // la rfc2822 authorise les caractères "a-z", "0-9", "!", "#", "$", "%", "&", "'", "*", "+", "-", "/", "=", "?", "^",  `", "{", "|", "}", "~" aussi bien dans la partie locale que dans le domaine.
+    // Pour la partie locale, on réduit cet ensemble car il n'est pas utilisé.
+    // Pour le domaine, le système DNS limite à [a-z0-9.-], on y ajoute le "_" car il est parfois utilisé.
+    return preg_match("/^[a-z0-9_.'+-]+@[a-z0-9._-]+\.[a-z]{2,4}$/i", $email);
 }
 
 function pl_url($path, $query = null, $fragment = null)
index 803dc30..cd493cd 100644 (file)
@@ -46,7 +46,7 @@ function put_in_db($string){
 }
 
 // example of use for diff_user_details : get $b from database, $a from other site
-//  calculate diff $c and add $c in database (with set_user_details)            
+//  calculate diff $c and add $c in database (with set_user_details)
 function diff_user_details(&$a, &$b, $view = 'private') { // compute $c = $a - $b
 //    if (!isset($b) || !$b || !is_array($b) || count($b) == 0)
 //        return $a;
@@ -131,11 +131,11 @@ function diff_user_address($a, $b) {
         $a['pub'] = $b['pub'];
     if (isset($b['tels'])) {
         $bvar = $b['tels'];
-        
+
         $telids_b = array();
-        foreach ($bvar as $i => $telb) $telids_b[$telb['telid']] = $i; 
+        foreach ($bvar as $i => $telb) $telids_b[$telb['telid']] = $i;
 
-        if (isset($a['tels']))            
+        if (isset($a['tels']))
             $avar = $a['tels'];
         else
             $avar = array();
@@ -161,7 +161,7 @@ function diff_user_address($a, $b) {
                 }
             }
         }
-        
+
         foreach ($telids_b as $telidb => $i)
             $ctels[] = array('telid' => $telidb, 'remove' => 1);
 
@@ -183,8 +183,8 @@ function diff_user_address($a, $b) {
 function diff_user_addresses(&$a, &$b) {
     $c = $a;
     $adrids_b = array();
-    foreach ($b as $i => $adrb) $adrids_b[$adrb['adrid']] = $i; 
-    
+    foreach ($b as $i => $adrb) $adrids_b[$adrb['adrid']] = $i;
+
     foreach ($a as $j => $adra) {
         if (isset($adra['adrid'])) {
             // if b has an address with the same adrid, compute diff
index b461376..22a8a2b 100644 (file)
@@ -51,7 +51,7 @@ function init_rss($template, $alias, $hash, $require_uid = true)
 
     if ($template) {
         header('Content-Type: application/rss+xml; charset=utf8');
-    }    
+    }
     return $uid;
 }
 
index af1cfdc..dd8dd96 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
+
 function hash_encrypt($s) {
     return sha1($s);
 }
index 3648e54..58384d0 100644 (file)
@@ -37,7 +37,7 @@ function get_user_ax($matricule_ax, $raw=false)
 
     $userax = Array();
     $userax['matricule_ax'] = $matricule_ax;
-    
+
     $userax['nom'] = strtoupper($ancien->Nom_patr());
     $userax['nom_usage'] = strtoupper($ancien->Nom_usuel());
     if ($userax['nom_usage'] == $userax['nom']) $userax['nom_usage'] = '';
@@ -54,8 +54,8 @@ function get_user_ax($matricule_ax, $raw=false)
         $userax['corps'] = $ancien->Corps();
         $userax['corps_grade'] = $ancien->Grade();
     } */
-    $userax['adr_pro'] = array(); 
-    
+    $userax['adr_pro'] = array();
+
     for ($i = 0; $i < $ancien->Num_Activite(); $i++) {
         $jobax = array();
         $jobax['entreprise'] = $ancien->Entreprise($i);
@@ -100,7 +100,7 @@ function get_user_ax($matricule_ax, $raw=false)
         if ($ancien->Mobile($i)) $userax['mobile'] = $ancien->Mobile($i);
         $userax['adr'][$i] = $adrax;
     }
-    
+
 /*    $userax['formation'] = array();
     for($i=$ancien->Num_formation() - 1; $i >= 0; $i--)
         $userax['formation'][$i] = $ancien->Formation($i);*/
index 03e437e..b515c0c 100644 (file)
@@ -44,7 +44,7 @@ function user_clear_all_subs($user_id, $really_del=true)
         array_push($tables_to_clear['uid'], 'emails', 'groupex.membres', 'contacts', 'adresses', 'tels',
                                             'photo', 'perte_pass', 'langues_ins', 'forums.abos', 'forums.profils');
         array_push($tables_to_clear['user_id'], 'newsletter_ins', 'auth_user_quick', 'binets_ins');
-        $tables_to_clear['id'] = array('aliases'); 
+        $tables_to_clear['id'] = array('aliases');
         $tables_to_clear['contact'] = array('contacts');
         $tables_to_clear['guid'] = array('groupesx_ins');
         XDB::execute("UPDATE auth_user_md5
@@ -108,7 +108,7 @@ function get_user_login($data, $get_forlife = false, $callback = '_default_user_
     if (strstr($data, '@')===false) {
         $data = $data.'@'.$globals->mail->domain;
     }
-    
+
     list($mbox, $fqdn) = explode('@', $data);
     if ($fqdn == $globals->mail->domain || $fqdn == $globals->mail->domain2) {
 
@@ -134,7 +134,7 @@ function get_user_login($data, $get_forlife = false, $callback = '_default_user_
         return false;
 
     } elseif ($fqdn == $globals->mail->alias_dom || $fqdn == $globals->mail->alias_dom2) {
-    
+
         $res = XDB::query("SELECT  redirect
                              FROM  virtual_redirect
                        INNER JOIN  virtual USING(vid)
@@ -156,10 +156,10 @@ function get_user_login($data, $get_forlife = false, $callback = '_default_user_
             case 0:
                 call_user_func($callback, $data);
                 return false;
-                
+
             case 1:
                 return $res->fetchOneCell();
-                
+
             default:
                 if (S::has_perms()) {
                     $aliases = $res->fetchColumn();
@@ -169,7 +169,7 @@ function get_user_login($data, $get_forlife = false, $callback = '_default_user_
                 }
         }
     }
-    
+
     return false;
 }
 
@@ -210,12 +210,12 @@ function get_users_forlife_list($members, $strict = false, $callback = '_default
 // {{{ function has_user_right()
 function has_user_right($pub, $view = 'private') {
     if ($pub == $view) return true;
-    // all infos available for private 
+    // all infos available for private
     if ($view == 'private') return true;
-    // public infos available for all 
+    // public infos available for all
     if ($pub == 'public') return true;
     // here we have view = ax or public, and pub = ax or private, and pub != view
-    return false;    
+    return false;
 }
 // }}}
 // {{{ function get_not_registered_user()
@@ -240,7 +240,7 @@ function get_not_registered_user($login, $iterator = false)
     $sql = "SELECT  user_id, nom, prenom, promo
               FROM  auth_user_md5
              WHERE  $where
-          ORDER BY  promo, nom, prenom"; 
+          ORDER BY  promo, nom, prenom";
     if ($iterator) {
         return XDB::iterator($sql, $nom, $prenom, $promo);
     } else {
@@ -293,7 +293,7 @@ function get_user_details_pro($uid, $view = 'private')
             }
             if (!has_user_right($pro['tel_pub'], $view)) {
                 // if no tel was defined, then the viewer will be able to write it
-                if ($pro['tel'] == '' && 
+                if ($pro['tel'] == '' &&
                     $pro['fax'] == '' &&
                     $pro['mobile'] == '') {
                     $all_pro[$i]['tel_pub'] = $view;
@@ -353,7 +353,7 @@ function get_user_details_adr($uid, $view = 'private') {
         else
             $adrid_index[$adr['adrid']] = $i;
     }
-    
+
     $sql = "SELECT  t.adrid, t.tel_pub, t.tel_type, t.tel, t.telid
               FROM  tels AS t
         INNER JOIN  adresses AS a ON (a.uid = t.uid) AND (a.adrid = t.adrid)
@@ -365,7 +365,7 @@ function get_user_details_adr($uid, $view = 'private') {
             $adrid = $nexttel['adrid'];
             unset($nexttel['adrid']);
             if (isset($adrid_index[$adrid])) {
-                if (!isset($all_adr[$adrid_index[$adrid]]['tels'])) 
+                if (!isset($all_adr[$adrid_index[$adrid]]['tels']))
                     $all_adr[$adrid_index[$adrid]]['tels'] = array($nexttel);
                 else
                     $all_adr[$adrid_index[$adrid]]['tels'][] = $nexttel;
@@ -399,7 +399,7 @@ function &get_user_details($login, $from_uid = '', $view = 'private')
             LEFT JOIN  contacts        AS c  ON (c.uid = {?} and c.contact = u.user_id)
             LEFT JOIN  geoloc_pays     AS gp ON (gp.a2 = u.nationalite)
            INNER JOIN  sections        AS s  ON (s.id  = u.section)
-            LEFT JOIN  photo           AS p  ON (p.uid = u.user_id) 
+            LEFT JOIN  photo           AS p  ON (p.uid = u.user_id)
             LEFT JOIN  mentor          AS m  ON (m.uid = u.user_id)
             LEFT JOIN  emails          AS e  ON (e.uid = u.user_id AND e.flags='active')
                 WHERE  a.alias = {?}
@@ -447,7 +447,7 @@ function &get_user_details($login, $from_uid = '', $view = 'private')
         $res  = XDB::query($sql, $uid);
         $user['binets']      = $res->fetchColumn();
         $user['binets_join'] = join(', ', $user['binets']);
-    
+
         $res  = XDB::iterRow("SELECT  text, url
                                 FROM  groupesx_ins
                            LEFT JOIN  groupesx_def ON groupesx_ins.gid = groupesx_def.id
@@ -457,7 +457,7 @@ function &get_user_details($login, $from_uid = '', $view = 'private')
         while (list($gxt, $gxu) = $res->next()) {
             $user['gpxs'][] = $gxu ? "<a href=\"$gxu\">$gxt</a>" : $gxt;
             $user['gpxs_name'][] = $gxt;
-        } 
+        }
         $user['gpxs_join'] = join(', ', $user['gpxs']);
     }
 
@@ -466,7 +466,7 @@ function &get_user_details($login, $from_uid = '', $view = 'private')
                      INNER JOIN  applis_def ON applis_def.id = applis_ins.aid
                           WHERE  uid={?}
                        ORDER BY  ordre", $uid);
-    
+
     $user['applis_fmt'] = Array();
     $user['formation'] = Array();
     while (list($txt, $url, $type) = $res->next()) {
@@ -514,7 +514,7 @@ function add_user_address($uid, $adrid, $adr) {
 function update_user_address($uid, $adrid, $adr) {
     // update address
     XDB::execute(
-        "UPDATE adresses AS a LEFT JOIN geoloc_pays AS gp ON (gp.pays = {?}) 
+        "UPDATE adresses AS a LEFT JOIN geoloc_pays AS gp ON (gp.pays = {?})
         SET `adr1` = {?}, `adr2` = {?}, `adr3` = {?},
         `postcode` = {?}, `city` = {?}, a.`country` = gp.a2, `datemaj` = NOW(), `pub` = {?}
         WHERE adrid = {?} AND uid = {?}",
@@ -594,7 +594,7 @@ function update_user_pro($uid, $entrid, $pro) {
     $set = "";
     $args_join = array();
     $args_set = array();
-    
+
     $join .= "LEFT JOIN  emploi_secteur AS s ON(s.label LIKE {?})
             LEFT JOIN  emploi_ss_secteur AS ss ON(s.id = ss.secteur AND ss.label LIKE {?})
             LEFT JOIN  fonctions_def AS f ON(f.fonction_fr LIKE {?} OR f.fonction_en LIKE {?})";
@@ -607,7 +607,7 @@ function update_user_pro($uid, $entrid, $pro) {
     $args_set[] = $pro['poste'];
     $args_set[] = $pro['web'];
     $args_set[] = $pro['pub'];
-    
+
     if (isset($pro['adr1'])) {
         $join .= "LEFT JOIN  geoloc_pays AS gp ON (gp.country LIKE {?} OR gp.pays LIKE {?})
                 LEFT JOIN  geoloc_region AS gr ON (gr.a2 = gp.a2 AND gr.name LIKE {?})";
@@ -622,7 +622,7 @@ function update_user_pro($uid, $entrid, $pro) {
         $args_set[] = $pro['city'];
         $args_set[] = $pro['adr_pub'];
     }
-    
+
     if (isset($pro['tel'])) {
         $set .= ", e.`tel` = {?}, e.`fax` = {?}, e.`mobile` = {?}, e.tel_pub = {?}";
         $args_set[] = $pro['tel'];
@@ -634,7 +634,7 @@ function update_user_pro($uid, $entrid, $pro) {
         $set .= ", e.`email` = {?}, e.`email_pub` = {?}";
         $args_set[] = $pro['email'];
         $args_set[] = $pro['email_pub'];
-    }    
+    }
     $query = "UPDATE entreprises AS e ".$join." SET ".substr($set,1)." WHERE e.uid = {?} AND e.entrid = {?}";
     $args_where = array($uid, $entrid);
     $args = array_merge(array($query), $args_join, $args_set, $args_where);
@@ -712,7 +712,7 @@ function set_user_details($uid, $details) {
             XDB::execute(
             "INSERT INTO binets_ins (`user_id`, `binet_id`)
                 SELECT {?}, id FROM binets_def WHERE text = {?} LIMIT 1",
-                $uid, $binet);                
+                $uid, $binet);
     }
     if (isset($details['gpxs']) && is_array($details['gpxs'])) {
         XDB::execute("DELETE FROM groupesx_ins WHERE user_id = {?}", $uid);
@@ -722,7 +722,7 @@ function set_user_details($uid, $details) {
             "INSERT INTO groupesx_ins (`user_id`, `binet_id`)
                 SELECT {?}, id FROM groupesx_def WHERE text = {?} LIMIT 1",
                 $uid, $groupex);
-        }                
+        }
     }
     // applis
     // medals
@@ -787,7 +787,7 @@ function user_reindex($uid) {
 // {{{ function set_new_usage()
 
 function set_new_usage($uid, $usage, $alias=false)
-{ 
+{
     XDB::execute("UPDATE auth_user_md5 set nom_usage={?} WHERE user_id={?}",$usage ,$uid);
     XDB::execute("DELETE FROM aliases WHERE FIND_IN_SET('usage',flags) AND id={?}", $uid);
     if ($alias && $usage) {
@@ -808,15 +808,15 @@ function set_new_usage($uid, $usage, $alias=false)
 // {{{ function get_X_mat
 function get_X_mat($ourmat)
 {
-    if (!preg_match('/^[0-9]{8}$/', $ourmat)) { 
+    if (!preg_match('/^[0-9]{8}$/', $ourmat)) {
         // le matricule de notre base doit comporter 8 chiffres
         return 0;
-    }   
-    
+    }
+
     $year = intval(substr($ourmat, 0, 4));
     $rang = intval(substr($ourmat, 5, 3));
     if ($year < 1996) {
-        return; 
+        return;
     } elseif ($year < 2000) {
         $year = intval(substr(1900 - $year, 1, 3));
         return sprintf('%02u0%03u', $year, $rang);
@@ -824,8 +824,8 @@ function get_X_mat($ourmat)
         $year = intval(substr(1900 - $year, 1, 3));
         return sprintf('%03u%03u', $year, $rang);
     }
-}           
-    
+}
+
 // }}}
 
 
index 7595292..8789ea9 100644 (file)
@@ -44,10 +44,10 @@ class UserSet extends PlSet
     {
         global $globals;
         parent::__construct('auth_user_md5 AS u',
-                            (!empty($GLOBALS['IS_XNET_SITE']) ? 
-                                'INNER JOIN groupex.membres AS gxm ON (u.user_id = gxm.uid 
+                            (!empty($GLOBALS['IS_XNET_SITE']) ?
+                                'INNER JOIN groupex.membres AS gxm ON (u.user_id = gxm.uid
                                                                        AND gxm.asso_id = ' . $globals->asso('id') . ') ' : '')
-                           . 'LEFT JOIN auth_user_quick AS q USING (user_id) 
+                           . 'LEFT JOIN auth_user_quick AS q USING (user_id)
                               LEFT JOIN aliases         AS a ON (a.id = u.user_id AND type = \'a_vie\')
                               ' . $joins,
                             $where,
@@ -204,7 +204,7 @@ class MinificheView extends MultipageView
                  LEFT JOIN  geoloc_pays    AS gp  ON (adr.country = gp.a2)
                  LEFT JOIN  geoloc_region  AS gr  ON (adr.country = gr.a2 AND adr.region = gr.region)
                  LEFT JOIN  emails         AS em  ON (em.uid = u.user_id AND em.flags = 'active')" .
-                (S::logged() ? 
+                (S::logged() ?
                  "LEFT JOIN  contacts       AS c   On (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")"
                  : "");
     }
@@ -219,12 +219,12 @@ class MentorView extends MultipageView
 {
     public function __construct(PlSet &$set, $data, array $params)
     {
-        $this->entriesPerPage = 10; 
+        $this->entriesPerPage = 10;
         $this->addSortKey('rand', array('RAND(' . S::i('uid') . ')'), 'aléatoirement');
-        $this->addSortKey('name', array('nom', 'prenom'), 'nom'); 
-        $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion'); 
-        $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification'); 
-        parent::__construct($set, $data, $params); 
+        $this->addSortKey('name', array('nom', 'prenom'), 'nom');
+        $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion');
+        $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification');
+        parent::__construct($set, $data, $params);
     }
 
     public function fields()
index 0b1eeac..81c3041 100644 (file)
@@ -57,7 +57,7 @@ class ValidateIterator extends XOrgDBIterator
 abstract class Validate
 {
     // {{{ properties
-    
+
     public $uid;
     public $prenom;
     public $nom;
@@ -70,7 +70,7 @@ abstract class Validate
     public $unique;
     // enable the refuse button
     public $refuse = true;
-    
+
     public $type;
     public $comments = Array();
     // the validations rules : comments for admins
@@ -78,7 +78,7 @@ abstract class Validate
 
     // }}}
     // {{{ constructor
-    
+
     /** constructeur
      * @param       $_uid       user id
      * @param       $_unique    requête pouvant être multiple ou non
@@ -98,7 +98,7 @@ abstract class Validate
                   WHERE  u.user_id={?}", $_uid);
         list($this->prenom, $this->nom, $this->promo, $this->sexe, $this->forlife, $this->bestalias) = $res->fetchOneRow();
     }
-    
+
     // }}}
     // {{{ function submit()
 
@@ -110,7 +110,7 @@ abstract class Validate
         if ($this->unique) {
             XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}', $this->uid, $this->type);
         }
-       
+
         $this->stamp = date('YmdHis');
         XDB::execute('INSERT INTO requests (user_id, type, data, stamp) VALUES ({?}, {?}, {?}, {?})',
                 $this->uid, $this->type, $this, $this->stamp);
@@ -131,7 +131,7 @@ abstract class Validate
 
     // }}}
     // {{{ function clean()
-    
+
     /** fonction à utiliser pour nettoyer l'entrée de la requête dans la table requests
      * attention, tout est supprimé si c'est un unique
      */
@@ -148,7 +148,7 @@ abstract class Validate
 
     // }}}
     // {{{ function handle_formu()
-    
+
     /** fonction à réaliser en cas de valistion du formulaire
      */
     public function handle_formu()
@@ -190,7 +190,7 @@ abstract class Validate
             $mailer->addTo($globals->core->admin_emails);
 
             $body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n"
-              . S::v('bestalias')." a ajouté le commentaire :\n\n" 
+              . S::v('bestalias')." a ajouté le commentaire :\n\n"
               . Env::v('comm')."\n\n"
               . "cf la discussion sur : ".$globals->baseurl."/admin/validate";
 
@@ -251,13 +251,13 @@ abstract class Validate
 
     // }}}
     // {{{ function trig()
-    
+
     protected function trig($msg)
     {
         global $page;
         $page->trig($msg);
     }
-    
+
     // }}}
     // {{{ function get_typed_request()
 
@@ -312,22 +312,22 @@ abstract class Validate
     // {{{ function _mail_body
 
     abstract protected function _mail_body($isok);
-    
+
     // }}}
     // {{{ function _mail_subj
 
     abstract protected function _mail_subj();
-    
+
     // }}}
     // {{{ function commit()
-    
+
     /** fonction à utiliser pour insérer les données dans x4dat
      */
     abstract public function commit();
 
     // }}}
     // {{{ function formu()
-    
+
     /** nom du template qui contient le formulaire */
     abstract public function formu();
 
index c89e48d..6ff67a0 100644 (file)
@@ -31,7 +31,7 @@ class AliasReq extends Validate
 
     public $old='';
     public $public='private';
-    
+
     public $rules = "Interdire ce qui peut nous servir (virus@, postmaster@, ...),
                   les alias vulgaires, et les prenom.nom (sauf si c'est pour l'utilisateur prenom.nom).
                   Pas de contrainte pour les tirets ou les points, en revanche le souligné (_) est interdit";
index 9dc5dca..80317a7 100644 (file)
@@ -67,7 +67,7 @@ class BrokenReq extends Validate
 
     // }}}
     // {{{ function _mail_subj
-    
+
     protected function _mail_subj()
     {
         return "[Polytechnique.org] Récupération de {$this->m_prenom} {$this->m_nom} ({$this->m_promo})";
@@ -100,7 +100,7 @@ class BrokenReq extends Validate
         global $globals;
         $email =  $this->m_bestalias . '@' . $globals->mail->domain;
 
-        XDB::execute("UPDATE  emails AS e 
+        XDB::execute("UPDATE  emails AS e
                   INNER JOIN  aliases AS a ON (a.id = e.uid)
                          SET  e.flags = 'active'
                        WHERE  a.alias = {?} AND e.email = {?}", $this->m_forlife, $this->m_email);
@@ -121,7 +121,7 @@ class BrokenReq extends Validate
             $mailer->send();
             return true;
         }
-        
+
         $email =  $this->m_bestalias . '@' . $globals->mail->domain;
         if ($this->old_email) {
             $subject = "Ton adresse $email semble ne plus fonctionner";
@@ -142,7 +142,7 @@ class BrokenReq extends Validate
             } elseif (count($redirect) == 1) {
                 $reason .= ' car sa redirection vers ' . $redirect[0] . ' est hors-service depuis plusiers mois.';
             } else {
-                $reason .= ' car ses redirections vers ' . implode(', ', $redirect) 
+                $reason .= ' car ses redirections vers ' . implode(', ', $redirect)
                         . ' sont hors-services depuis plusieurs mois.';
             }
         }
index f9c2441..4a3a0ce 100644 (file)
@@ -30,14 +30,14 @@ class EvtReq extends Validate
     public $texte;
     public $pmin;
     public $pmax;
-    public $peremption;    
+    public $peremption;
     public $comment;
 
     public $imgtype;
     public $imgx;
     public $imgy;
     public $img;
-    
+
     // }}}
     // {{{ constructor
 
@@ -52,7 +52,7 @@ class EvtReq extends Validate
         $this->comment    = $_comment;
         if ($upload) {
             $this->readImage($upload);
-        } 
+        }
     }
 
     // }}}
@@ -111,7 +111,7 @@ class EvtReq extends Validate
 
     // }}}
     // {{{ function _mail_subj
-    
+
     protected function _mail_subj()
     {
         return "[Polytechnique.org/EVENEMENTS] Proposition d'événement";
index 8fe93e6..b88586c 100644 (file)
@@ -25,7 +25,7 @@ require_once 'validations.inc.php';
 class HomonymeReq extends Validate
 {
     // {{{ properties
-    
+
     public $loginbis;
 
     public $warning = true;
@@ -36,7 +36,7 @@ class HomonymeReq extends Validate
 
     // }}}
     // {{{ constructor
-   
+
     public function __construct($_uid, $_loginbis, $_homonymes_forlife, $warning=true)
     {
         $this->warning = $warning;
@@ -47,10 +47,10 @@ class HomonymeReq extends Validate
         $this->loginbis = $_loginbis;
         $this->homonymes_forlife = $_homonymes_forlife;
     }
-    
+
     // }}}
     // {{{ title()
-    
+
     private function title()
     {
         return $this->warning?'alerte alias':'robot répondeur';
@@ -74,7 +74,7 @@ class HomonymeReq extends Validate
 
     // }}}
     // {{{ function _mail_body
-    
+
     protected function _mail_body($isok)
     {
         global $globals;
@@ -115,7 +115,7 @@ est ambigu pour des raisons d'homonymie et signalera ton email exact.";
     }
     // }}}
     // {{{ function commit()
-    
+
     public function commit()
     {
         require_once('homonymes.inc.php');
@@ -125,7 +125,7 @@ est ambigu pour des raisons d'homonymie et signalera ton email exact.";
             XDB::execute("UPDATE aliases SET type='homonyme',expire=NOW() WHERE alias={?}", $this->loginbis);
             XDB::execute("REPLACE INTO homonymes (homonyme_id,user_id) VALUES({?},{?})", $this->uid, $this->uid);
         }
-        
+
         return true;
     }
 
index cd7356d..8558c38 100644 (file)
@@ -24,7 +24,7 @@
 class ListeReq extends Validate
 {
     // {{{ properties
-    
+
     public $liste;
     public $desc;
 
@@ -39,12 +39,12 @@ class ListeReq extends Validate
         Refuser également des listes qui pourraient nous servir (admin, postmaster,...)";
     // }}}
     // {{{ constructor
-    
+
     public function __construct($_uid, $_liste, $_desc, $_advertise, $_modlevel,
                                 $_inslevel, $_owners, $_members, $_stamp=0)
     {
         parent::__construct($_uid, true, 'liste', $_stamp);
-        
+
         $this->liste     = $_liste;
         $this->desc      = $_desc;
         $this->advertise = $_advertise;
index 7b5c759..adf3fd0 100644 (file)
@@ -35,9 +35,9 @@ class MarkReq extends Validate
     public $m_type;
     public $m_data;
 
-    public $rules = "Accepter si l'adresse mail parait correcte, et pas absurde (ou si le marketeur est de confiance). Si le 
+    public $rules = "Accepter si l'adresse mail parait correcte, et pas absurde (ou si le marketeur est de confiance). Si le
     demandeur marque sa propre adresse mail, refuser dans tous les cas.
-    Ne pas marqueter au nom de Polytechnique.org plus d'une 
+    Ne pas marqueter au nom de Polytechnique.org plus d'une
     fois par an.";
     // }}}
     // {{{ constructor
@@ -55,7 +55,7 @@ class MarkReq extends Validate
                              FROM  auth_user_md5      AS u
                             WHERE  user_id = {?}
                          GROUP BY  u.user_id', $mark_id);
-        list ($this->m_nom, $this->m_prenom, $this->m_promo) = $res->fetchOneRow(); 
+        list ($this->m_nom, $this->m_prenom, $this->m_promo) = $res->fetchOneRow();
     }
 
     // }}}
@@ -75,7 +75,7 @@ class MarkReq extends Validate
 
     // }}}
     // {{{ function _mail_subj
-    
+
     protected function _mail_subj()
     {
         return "[Polytechnique.org] Marketing de {$this->m_prenom} {$this->m_nom} ({$this->m_promo})";
@@ -105,7 +105,7 @@ class MarkReq extends Validate
         if ($market == null) {
             return false;
         }
-        $market->send(); 
+        $market->send();
         return true;
     }
 
index a742da5..e419e46 100644 (file)
@@ -42,7 +42,7 @@ class MedalReq extends Validate
     // {{{ function formu()
 
     public function formu()
-    { 
+    {
         return 'include/form.valid.medals.tpl';
     }
 
@@ -73,11 +73,11 @@ class MedalReq extends Validate
     {
         //var_dump($this);
         $r = XDB::query("
-            SELECT IF (g.text IS NOT NULL, CONCAT(m.text,' - ', g.text), m.text) 
+            SELECT IF (g.text IS NOT NULL, CONCAT(m.text,' - ', g.text), m.text)
               FROM profile_medals AS m
          LEFT JOIN profile_medals_grades AS g ON(g.mid = m.id AND g.gid = {?})
              WHERE m.id = {?}", $this->gid, $this->mid);
-        return $r->fetchOneCell(); 
+        return $r->fetchOneCell();
     }
 
     // }}}
index f9aff28..fe4114e 100644 (file)
@@ -29,7 +29,7 @@ class NLReq extends Validate
 
     public $art;
     public $rules = "Laisser valider par le NL-MASTER";
-    
+
     // }}}
     // {{{ constructor
 
@@ -68,7 +68,7 @@ class NLReq extends Validate
 
     // }}}
     // {{{ function _mail_subj
-    
+
     protected function _mail_subj()
     {
         return "[Polytechnique.org/NL] Proposition d'article dans la NL";
index cdfa4ee..5c01b0c 100644 (file)
@@ -35,10 +35,10 @@ class UsageReq extends Validate
 
     public $homonyme;
     public $reason;
-    
-    public $rules = "Refuser 
-    tout ce qui n'est visiblement pas un nom de famille (ce qui est 
-    extremement rare car à peu près n'importe quoi peut être un nom de 
+
+    public $rules = "Refuser
+    tout ce qui n'est visiblement pas un nom de famille (ce qui est
+    extremement rare car à peu près n'importe quoi peut être un nom de
     famille...)";
 
     // }}}
index f7a0402..f734421 100644 (file)
@@ -29,9 +29,9 @@ class OrangeReq extends Validate
 
     public $promo;
     public $promo_sortie;
-    
+
     public $rules = "A priori accepter (la validation sert à repousser les
-    petits malins). Refuse si tu connais la personne et que tu es sure 
+    petits malins). Refuse si tu connais la personne et que tu es sure
     qu'elle n'est pas orange.";
 
     // }}}
@@ -42,7 +42,7 @@ class OrangeReq extends Validate
         parent::__construct($_uid, true, 'orange');
         $this->promo_sortie  = $_sortie;
         $res = XDB::query("SELECT promo FROM auth_user_md5 WHERE user_id = {?}", $_uid);
-        $this->promo = $res->fetchOneCell(); 
+        $this->promo = $res->fetchOneCell();
     }
 
     // }}}
index 7e7f96b..54a01ba 100644 (file)
@@ -24,7 +24,7 @@
 class PayReq extends Validate
 {
     // {{{ properties
-    
+
     public $titre;
     public $site;
 
@@ -77,7 +77,7 @@ class PayReq extends Validate
         $where = "%".$wassoid."%".$wevt."%";
         return $where;
     }
-  
+
     // }}}
     // {{{ function accept()
 
@@ -96,9 +96,9 @@ class PayReq extends Validate
         return true;
     }
 
-    // }}}    
-    // {{{ function submit() 
-  
+    // }}}
+    // {{{ function submit()
+
     // supprime les demandes de paiments pour le meme evenement
     public function submit()
     {
@@ -160,7 +160,7 @@ class PayReq extends Validate
 
     // }}}
     // {{{ function commit()
-    
+
     public function commit()
     {
         global $globals;
@@ -174,7 +174,7 @@ class PayReq extends Validate
             $id, $this->titre, $this->site,
             $this->montant, $this->montant_min, $this->montant_max,
             $this->bestalias."@".$globals->mail->domain, $this->msg_reponse, $this->asso_id);
-        if ($this->asso_id && $this->evt) 
+        if ($this->asso_id && $this->evt)
             $ret = XDB::execute("UPDATE groupex.evenements SET paiement_id = {?} WHERE asso_id = {?} AND eid = {?}", $id, $this->asso_id, $this->evt);
 
         return $ret;
index 9010dea..c62cff7 100644 (file)
@@ -54,7 +54,7 @@ class PhotoReq extends Validate
 
     private function read(PlUpload &$upload)
     {
-        $this->valid = $upload->resizeImage(240, 300, 160, 0, SIZE_MAX); 
+        $this->valid = $upload->resizeImage(240, 300, 160, 0, SIZE_MAX);
         if (!$this->valid) {
             $this->trig('Le fichier que tu as transmis n\'est pas une image valide, ou est trop gros pour être traité');
         }
@@ -62,7 +62,7 @@ class PhotoReq extends Validate
         list($this->x, $this->y, $this->mimetype) = $upload->imageInfo();
         $upload->rm();
     }
-    
+
     // }}}
     // {{{ function isValid()
 
index 7c26267..c0be8bb 100644 (file)
@@ -54,7 +54,7 @@ class SurveyReq extends Validate
 
     // }}}
     // {{{ function _mail_subj
-    
+
     protected function _mail_subj()
     {
         return "[Polytechnique.org/SONDAGES] Proposition de sondage";
index 52d6905..f357f74 100644 (file)
@@ -87,7 +87,7 @@ class VCardIterator implements PlIterator
                 S::v('uid'),
                 $user['forlife'].'@'.$globals->mail->domain,
                 $user['forlife'].'@'.$globals->mail->domain2);
-        
+
         $user['virtualalias'] = $res->fetchOneCell();
         $user['gpxs_vcardjoin'] = join(',', array_map(array('VCard', 'text_encode'), $user['gpxs_name']));
         $user['binets_vcardjoin'] = join(',', array_map(array('VCard', 'text_encode'), $user['binets']));
index 8fbd891..50a5854 100644 (file)
@@ -75,7 +75,7 @@ function get_annuaire_infos($method, $params) {
                         $i++;
                     }
                 }
-                
+
                 // on rajoute les numéros de tél
                 $adrid_index = array();
                 foreach ($array['adresse'] as $i => $a) $adrid_index[$a['adrid']] = $i;
@@ -89,10 +89,10 @@ function get_annuaire_infos($method, $params) {
                 foreach ($array['adresse'] as $i => $adr) {
                     unset($lasttel);
                     foreach($adr['tels'] as $j => $t){
-                        if (!isset($array['adresse'][$i]['tel']) && (strpos($t['tel_type'], 'Tél') === 0)) $array['adresse'][$i]['tel'] = $t['tel']; 
+                        if (!isset($array['adresse'][$i]['tel']) && (strpos($t['tel_type'], 'Tél') === 0)) $array['adresse'][$i]['tel'] = $t['tel'];
                         elseif (!isset($array['adresse'][$i]['fax']) && (strpos($t['tel_type'], 'Fax') === 0)) $array['adresse'][$i]['fax'] = $t['tel'];
                         else $lasttel = $t['tel'];
-                        if (isset($array['adresse'][$i]['tel']) && isset($array['adresse'][$i]['fax'])) break; 
+                        if (isset($array['adresse'][$i]['tel']) && isset($array['adresse'][$i]['fax'])) break;
                     }
                     if (!isset($array['adresse'][$i]['tel']) && isset($lasttel))
                         $array['adresse'][$i]['tel'] = $lasttel;
@@ -137,9 +137,9 @@ function get_annuaire_infos($method, $params) {
         $args  = array("erreur" => 1, "erreurstring" => $error_mat);
         $reply = xmlrpc_encode_request(NULL,$args);
     }
-            
-    return $reply; 
-} 
+
+    return $reply;
+}
 
 function get_nouveau_infos($method, $params) {
     global $error_mat, $error_key, $globals;
@@ -149,14 +149,14 @@ function get_nouveau_infos($method, $params) {
 
         $res = XDB::query(
             "SELECT  a.nom, a.nom_usage,a.prenom, FIND_IN_SET('femme', a.flags) as femme ,a.deces!= 0 as decede ,
-            a.naissance, a.promo, concat(al.alias, '@m4x.org') as mail 
+            a.naissance, a.promo, concat(al.alias, '@m4x.org') as mail
             FROM  auth_user_md5 AS a
             INNER JOIN aliases as al ON a.user_id=al.id
             WHERE al.flags='bestalias' and  a.matricule = {?}",$params[1]);
         $data=$res->fetchOneAssoc();
         //$data['mail'].='@polytechnique.org';
 
-        
+
         //on commence le cryptage des donnees
         if (manageurs_encrypt_init($params[1]) == 1) {//on a pas trouve la cle pour crypter
             $args  = array("erreur" => 3, "erreurstring" => $error_key);
index aa0c654..ae81f03 100644 (file)
@@ -180,7 +180,7 @@ function wiki_delete_page($pagename)
         return false;
     }
     $file  = wiki_work_dir().'/'.wiki_filename($pagename_dots);
-    $cachefile = wiki_work_dir().'/cache_'.$pagename_dots.'.tpl'; 
+    $cachefile = wiki_work_dir().'/cache_'.$pagename_dots.'.tpl';
     if (is_file($cachefile)) {
         unlink($cachefile);
     }
@@ -227,7 +227,7 @@ function wiki_rename_page($pagename, $newname, $changeLinks = true)
     }
     $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)) {
index 08d7572..dfd587f 100644 (file)
@@ -35,7 +35,7 @@ switch (Env::v('action')) {
   case 'rss': case 'atom': case 'sdf': case 'dc':
     wiki_apply_feed_perms($perms[0]);
     $feed = true;
-  case '': case 'search': 
+  case '': case 'search':
     break;
 
   case 'edit':
@@ -135,7 +135,7 @@ 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);
 }
 
index a4adf9d..b867000 100644 (file)
@@ -18,7 +18,7 @@ $InterMapFiles[]  = $globals->spoolroot.'/configs/pmwiki.intermap.txt';
 $Skin             = 'empty';
 
 @include_once("$FarmD/cookbook/e-protect.php");
-include_once($FarmD.'/scripts/xlpage-utf-8.php'); 
+include_once($FarmD.'/scripts/xlpage-utf-8.php');
 ResolvePageName();
 
 if ($action == 'rss'  || $action == 'atom' || $action == 'rdf'  || $action == 'dc') {
@@ -49,16 +49,16 @@ $GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
 $GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
                  '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
 $GUIButtons['table'] = array(600,
-                   '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n||     ||     ||     ||\\n||     ||     ||     ||\\n', '', '', 
+                   '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n||     ||     ||     ||\\n||     ||     ||     ||\\n', '', '',
                  '$GUIButtonDirUrlFmt/table.gif"$[Table]"');
 
 // set default author
 $Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
 
 $InputTags['e_form'] = array(
-  ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input 
-    type='hidden' name='action' value='edit' /><input 
-    type='hidden' name='n' value='{\$FullName}' /><input 
+  ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input
+    type='hidden' name='action' value='edit' /><input
+    type='hidden' name='n' value='{\$FullName}' /><input
     type='hidden' name='basetime' value='\$EditBaseTime' /></div>");
 
 // set profiles to point to plat/al fiche
@@ -76,9 +76,9 @@ Markup('restorelinks','<%%',"//", '');
 ## [[#anchor]] in standard XHTML
 Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
   "Keep(\"<a id='$1'></a>\",'L')");
-  
+
 Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")');
-Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e', 
+Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
     "($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')");
 Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th');
 
@@ -95,7 +95,7 @@ function doBicol($column=false)
 
 function doPlatalLink($link, $text)
 {
-    if (strlen(trim($text)) == 0) { 
+    if (strlen(trim($text)) == 0) {
         $res = XDB::query("SELECT u.nom, u.prenom, u.promo, q.profile_nick AS surnom
                              FROM auth_user_md5   AS u
                        INNER JOIN auth_user_quick AS q USING(user_id)
index 0bbfbad..6190b5f 100644 (file)
@@ -57,14 +57,14 @@ class XnetPage extends PlatalPage
         global $globals;
         parent::changeTpl($tpl, $type);
         $this->assign('is_logged', S::logged());
-        if ($globals->asso('id')) {  
+        if ($globals->asso('id')) {
             $this->assign('asso', $globals->asso());
             $this->setType($globals->asso('cat'));
             $this->assign('is_admin', may_update());
             $this->assign('is_member', is_member());
         }
     }
-    
+
     // }}}
     // {{{ function setType
 
@@ -85,9 +85,9 @@ class XnetPage extends PlatalPage
         $sub = array();
         $sub['liste des groupes'] = 'plan';
         $sub['documentation']     = 'Xnet';
-        $sub['signaler un bug']   = array('href' => 'send_bug', 'class' => 'popup_840x600'); 
+        $sub['signaler un bug']   = array('href' => 'send_bug', 'class' => 'popup_840x600');
         $menu["no_title"]   = $sub;
-        
+
         if (S::logged() && $globals->asso()) {
             $sub = array();
             $dim = $globals->asso('diminutif');
index 3fbeac4..2159954 100644 (file)
@@ -23,7 +23,7 @@ class XnetSession
 {
     // {{{ function init
 
-    public static function init() 
+    public static function init()
     {
         global $globals;
 
@@ -104,7 +104,7 @@ class XnetSession
     // }}}
     // {{{ doAuthX
 
-    public static function doAuthX() 
+    public static function doAuthX()
     {
         global $globals, $page;
 
@@ -159,7 +159,7 @@ class XnetSession
     // {{{ killSuid
 
     public static function killSuid()
-    {   
+    {
         if (!S::has('suid')) {
             return;
         }
@@ -211,7 +211,7 @@ function may_update($force = false, $lose = false)
 /** Get membership informations for the current asso
  * @param force Force membership to be read from database
  * @param lose  Force membership to be false
- */ 
+ */
 function is_member($force = false, $lose = false)
 {
     if (!isset($_SESSION['is_member'])) {
index 1a22f22..96db292 100644 (file)
@@ -52,13 +52,13 @@ function quoted_printable_encode($input, $line_max = 76)
     return trim($output);
 }
 
-/** vérifie si une adresse email convient comme adresse de redirection 
+/** vérifie si une adresse email convient comme adresse de redirection
  * @param $email l'adresse email a verifier
  * @return BOOL
  */
 function isvalid_email_redirection($email)
 {
-    return isvalid_email($email) && 
+    return isvalid_email($email) &&
         !preg_match("/@(polytechnique\.(org|edu)|melix\.(org|net)|m4x\.org)$/", $email);
 }
 
@@ -83,7 +83,7 @@ function rand_token($len = 22)
 
 /** genere une chaine aleatoire convenable pour une url
  * @param $len longueur souhaitée, 22 par défaut
- * @return la chaine aleatoire 
+ * @return la chaine aleatoire
  */
 function rand_url_id($len = 22)
 {
@@ -108,11 +108,11 @@ $lc_convert = array('é' => 'e', 'è' => 'e', 'ë' => 'e', 'ê' => 'e',
     'ô' => 'o', 'ö' => 'o', 'ò' => 'o', 'ó' => 'o', 'õ' => 'o', 'ø' => 'o',
     'ú' => 'u', 'ù' => 'u', 'û' => 'u', 'ü' => 'u',
     'ç' => 'c', 'ñ' => 'n');
-$uc_convert = array('É' => 'E', 'È' => 'E', 'Ë' => 'E', 'Ê' => 'E', 
-    'Á' => 'A', 'À' => 'A', 'Ä' => 'A', 'Â' => 'A', 'Å' => 'A', 'Ã' => 'A', 
-    'Ï' => 'I', 'Î' => 'I', 'Ì' => 'I', 'Í' => 'I', 
-    'Ô' => 'O', 'Ö' => 'O', 'Ò' => 'O', 'Ó' => 'O', 'Õ' => 'O', 'Ø' => 'O', 
-    'Ú' => 'U', 'Ù' => 'U', 'Û' => 'U', 'Ü' => 'U', 
+$uc_convert = array('É' => 'E', 'È' => 'E', 'Ë' => 'E', 'Ê' => 'E',
+    'Á' => 'A', 'À' => 'A', 'Ä' => 'A', 'Â' => 'A', 'Å' => 'A', 'Ã' => 'A',
+    'Ï' => 'I', 'Î' => 'I', 'Ì' => 'I', 'Í' => 'I',
+    'Ô' => 'O', 'Ö' => 'O', 'Ò' => 'O', 'Ó' => 'O', 'Õ' => 'O', 'Ø' => 'O',
+    'Ú' => 'U', 'Ù' => 'U', 'Û' => 'U', 'Ü' => 'U',
     'Ç' => 'C', 'Ñ' => 'N');
 
 function replace_accent($string)
@@ -173,28 +173,28 @@ function soundex_fr($sIn)
         $accents['Ç'] = 'S';
         $accents['¿'] = 'E';
     }
-    // Si il n'y a pas de mot, on sort immédiatement 
-    if ( $sIn === '' ) return '    '; 
-    // On supprime les accents 
+    // Si il n'y a pas de mot, on sort immédiatement
+    if ( $sIn === '' ) return '    ';
+    // On supprime les accents
     $sIn = strtr( $sIn, $accents);
-    // On met tout en minuscule 
-    $sIn = strtoupper( $sIn ); 
-    // On supprime tout ce qui n'est pas une lettre 
-    $sIn = preg_replace( '`[^A-Z]`', '', $sIn ); 
-    // Si la chaîne ne fait qu'un seul caractère, on sort avec. 
-    if ( strlen( $sIn ) === 1 ) return $sIn . '   '; 
-    // on remplace les consonnances primaires 
+    // On met tout en minuscule
+    $sIn = strtoupper( $sIn );
+    // On supprime tout ce qui n'est pas une lettre
+    $sIn = preg_replace( '`[^A-Z]`', '', $sIn );
+    // Si la chaîne ne fait qu'un seul caractère, on sort avec.
+    if ( strlen( $sIn ) === 1 ) return $sIn . '   ';
+    // on remplace les consonnances primaires
     $sIn = str_replace( $convGuIn, $convGuOut, $sIn );
     // on supprime les lettres répétitives
     $sIn = preg_replace( '`(.)\1`', '$1', $sIn );
     // on réinterprète les voyelles
     $sIn = preg_replace( $convVIn, $convVOut, $sIn);
-    // on supprime les terminaisons T, D, S, X (et le L qui précède si existe) 
+    // on supprime les terminaisons T, D, S, X (et le L qui précède si existe)
     $sIn = preg_replace( '`L?[TDSX]$`', '', $sIn );
     // on supprime les E, A et Y qui ne sont pas en première position
     $sIn = preg_replace( '`(?!^)Y([^AEOU]|$)`', '\1', $sIn);
     $sIn = preg_replace( '`(?!^)[EA]`', '', $sIn);
-    return substr( $sIn . '    ', 0, 4); 
+    return substr( $sIn . '    ', 0, 4);
 }
 
 /** met les majuscules au debut de chaque atome du prénom
@@ -284,9 +284,9 @@ function check_redirect($red = null)
     require_once 'emails.inc.php';
     if (is_null($red)) {
         $red = new Redirect(S::v('uid'));
-    }    
+    }
     $_SESSION['no_redirect'] = !$red->other_active('');
-    $_SESSION['mx_failures'] = $red->get_broken_mx();    
+    $_SESSION['mx_failures'] = $red->get_broken_mx();
 }
 
 function send_warning_mail($title)
index a0467b9..35de42e 100644 (file)
@@ -25,7 +25,7 @@ class XorgSession
 {
     // {{{ public static function init
 
-    public static function init() 
+    public static function init()
     {
         S::init();
         if (!S::has('uid')) {
@@ -158,7 +158,7 @@ class XorgSession
      * @param page the calling page (by reference)
      */
     public static function doAuthCookie()
-        
+
     {
         if (S::logged()) {
             return true;
index dbc30fc..99e594a 100644 (file)
@@ -396,12 +396,12 @@ class AdminModule extends PLModule
                               LEFT JOIN aliases       AS a ON (a.id = u.user_id AND type= 'a_vie')
                                   WHERE u.user_id = {?}", $login);
             } else {
-                $r  = XDB::query("SELECT  *, a.alias AS forlife, 
+                $r  = XDB::query("SELECT  *, a.alias AS forlife,
                                           FIND_IN_SET('watch', u.flags) AS watch, FIND_IN_SET('femme', u.flags) AS sexe,
                                           (year(naissance) > promo - 15 or year(naissance) < promo - 25) AS naiss_err
                                     FROM  auth_user_md5 AS u
                               INNER JOIN  aliases       AS a ON ( a.id = u.user_id AND a.alias={?} AND type!='homonyme' )", $login);
-            }   
+            }
             $mr = $r->fetchOneAssoc();
 
             if (!is_numeric($login)) { //user has a forlife
@@ -435,7 +435,7 @@ class AdminModule extends PLModule
                             XDB::execute("UPDATE emails
                                              SET rewrite = ''
                                            WHERE uid = {?} AND rewrite LIKE CONCAT({?}, '@%')",
-                                         $mr['user_id'], $val);               
+                                         $mr['user_id'], $val);
                             fix_bestalias($mr['user_id']);
                             $page->trig($val." a été supprimé");
                         }
@@ -552,7 +552,7 @@ class AdminModule extends PLModule
 
                             $res = XDB::query($watch);
                             $new_fields = $res->fetchOneAssoc();
-            
+
                             $mailer = new PlMailer("admin/mail_intervention.tpl");
                             $mailer->assign("user", S::v('forlife'));
                             $mailer->assign('old', $old_fields);
@@ -633,7 +633,7 @@ class AdminModule extends PLModule
     {
         if (Env::has('promo')) {
             if(Env::i('promo') > 1900 && Env::i('promo') < 2050) {
-                $action = Env::v('valid_promo') == 'Ajouter des membres' ? 'add' : 'ax'; 
+                $action = Env::v('valid_promo') == 'Ajouter des membres' ? 'add' : 'ax';
                 pl_redirect('admin/promo/' . $action . '/' . Env::i('promo'));
             } else {
                 $page->trig('Promo non valide');
@@ -963,7 +963,7 @@ class AdminModule extends PLModule
                 }
             }
         }
-        
+
         if ($action == 'delete' && $wikipage != '') {
             if (wiki_delete_page($wikipage)) {
                 $page->trig("La page ".$wikipage." a été supprimée.");
@@ -971,7 +971,7 @@ class AdminModule extends PLModule
                 $page->trig("Impossible de supprimer la page ".$wikipage.".");
             }
         }
-        
+
         if ($action == 'rename' && $wikipage != '' && $wikipage2 != '' && $wikipage != $wikipage2) {
             if ($changedLinks = wiki_rename_page($wikipage, $wikipage2)) {
                 $s = 'La page <em>'.$wikipage.'</em> a été déplacée en <em>'.$wikipage2.'</em>.';
@@ -1018,9 +1018,9 @@ class AdminModule extends PLModule
     }
 
     function handler_ipwatch(&$page, $action = 'list', $ip = null)
-    { 
+    {
         $page->changeTpl('admin/ipwatcher.tpl');
-            
+
         $states = array('safe'      => 'Ne pas surveiller',
                         'unsafe'    => 'Surveiller les inscriptions',
                         'dangerous' => 'Surveiller tous les accès',
@@ -1033,15 +1033,15 @@ class AdminModule extends PLModule
                 Xdb::execute('INSERT IGNORE INTO ip_watch (ip, state, detection, last, uid, description)
                                           VALUES ({?}, {?}, CURDATE(), NOW(), {?}, {?})',
                              trim(Post::v('ipN')), Post::v('stateN'), S::i('uid'), Post::v('descriptionN'));
-            };      
-            break;  
-                                   
-        case 'edit':               
-            Xdb::execute('UPDATE ip_watch 
+            };
+            break;
+
+        case 'edit':
+            Xdb::execute('UPDATE ip_watch
                              SET state = {?}, last = NOW(), uid = {?}, description = {?}
                            WHERE ip = {?}', Post::v('stateN'), S::i('uid'), Post::v('descriptionN'), Post::v('ipN'));
             break;
-            
+
         default:
             if ($action == 'delete' && !is_null($ip)) {
                 Xdb::execute('DELETE FROM emails_watch WHERE ip = {?}', $ip);
@@ -1085,7 +1085,7 @@ class AdminModule extends PLModule
             $sql = "SELECT  w.detection, w.state, w.last, w.description,
                             a1.alias AS edit, a2.alias AS forlife, s.host
                       FROM  ip_watch        AS w
-                 LEFT JOIN  aliases         AS a1 ON (a1.id = w.uid AND a1.type = 'a_vie')     
+                 LEFT JOIN  aliases         AS a1 ON (a1.id = w.uid AND a1.type = 'a_vie')
                  LEFT JOIN  logger.sessions AS s  ON (w.ip = s.ip)
                  LEFT JOIN  aliases         AS a2 ON (a2.id = s.uid AND a2.type = 'a_vie')
                      WHERE  w.ip = {?}
@@ -1111,7 +1111,7 @@ class AdminModule extends PLModule
             $page->assign('ip', $props);
         }
     }
-    
+
     function handler_icons(&$page)
     {
         $page->changeTpl('admin/icons.tpl');
index 3781291..e4c8b89 100644 (file)
@@ -180,7 +180,7 @@ class AuthModule extends PLModule
         $table_editor->describe('privkey','clé privée',false);
         $table_editor->describe('datafields','champs renvoyés',true);
         $table_editor->apply($page, $action, $id);
-    }  
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index e8502a7..bcd8b5b 100644 (file)
@@ -56,7 +56,7 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
             if (isset($_GET['group'])) {
                 $res = XDB::query("SELECT  perms
                                      FROM  groupex.membres
-                               INNER JOIN  groupex.asso ON(id = asso_id) 
+                               INNER JOIN  groupex.asso ON(id = asso_id)
                                     WHERE  uid = {?} AND diminutif = {?}",
                                   S::v('uid'), $_GET['group']);
                 $perms = $res->fetchOneCell();
index 945a55b..7c8c936 100644 (file)
@@ -217,7 +217,7 @@ class AXLetterModule extends PLModule
                 $select .= "<option value=\"$stamp\"$sel>{$i}h</option>\n";
             }
             $page->assign('echeance_time', $select);
-        }    
+        }
     }
 
     function handler_cancel(&$page, $force = null)
@@ -319,7 +319,7 @@ class AXLetterModule extends PLModule
                           INNER JOIN auth_user_md5   AS u USING(user_id)
                           INNER JOIN aliases         AS a ON (u.user_id = a.id AND a.type = 'a_vie')");
         $page->assign('admins', $res);
-        
+
         $importer = new CSVImporter('axletter_ins');
         $importer->registerFunction('user_id', 'email vers Id X.org', array($this, 'idFromMail'));
         $importer->forceValue('hash', array($this, 'createHash'));
@@ -344,7 +344,7 @@ class AXLetterModule extends PLModule
             $user  = $email;
             $domain = $globals->mail->domain2;
         } else {
-            list($user, $domain) = explode('@', $email);    
+            list($user, $domain) = explode('@', $email);
         }
         if ($domain != $globals->mail->domain && $domain != $globals->mail->domain2
                 && $domain != $globals->mail->alias_dom && $domain != $globals->mail->alias_dom2) {
index af34cac..386eb26 100644 (file)
@@ -113,7 +113,7 @@ class AXLetter extends MassMailer
                  WHERE  ni.last < {?} AND {$this->subscriptionWhere()}
                         AND (e.email IS NOT NULL OR ni.user_id = 0)
               GROUP BY  u.user_id";
-    }              
+    }
 
     static public function subscriptionState($uid = null)
     {
@@ -122,8 +122,8 @@ class AXLetter extends MassMailer
                              FROM  axletter_ins
                             WHERE  user_id={?}", $user);
         return $res->fetchOneCell();
-    }   
-    
+    }
+
     static public function unsubscribe($uid = null, $hash = false)
     {
         $user = is_null($uid) ? S::v('uid') : $uid;
@@ -177,7 +177,7 @@ class AXLetter extends MassMailer
         if (!is_numeric($uid)) {
             $res = XDB::query("SELECT id FROM aliases WHERE alias = {?}", $uid);
             $uid = $res->fetchOneCell();
-        }   
+        }
         if (!$uid) {
             return false;
         }
@@ -222,16 +222,16 @@ class AXLetter extends MassMailer
     }
 
     static public function listSent()
-    {   
+    {
         $res = XDB::query("SELECT  IF(shortname IS NULL, id, shortname) as id, date, subject AS titre
                              FROM  axletter
                             WHERE  NOT (FIND_IN_SET('new', bits))
                          ORDER BY  date DESC");
         return $res->fetchAllAssoc();
     }
-    
+
     static public function listAll()
-    {   
+    {
         $res = XDB::query("SELECT  IF(shortname IS NULL, id, shortname) as id, date, subject AS titre
                              FROM  axletter
                          ORDER BY  date DESC");
index 9bd9988..891b505 100644 (file)
@@ -83,7 +83,7 @@ class BananaModule extends PLModule
         {
             $req = XDB::query("
                 SELECT  nom,mail,sig,if(FIND_IN_SET('threads',flags),'1','0'),
-                        IF(FIND_IN_SET('automaj',flags),'1','0') 
+                        IF(FIND_IN_SET('automaj',flags),'1','0')
                   FROM  forums.profils
                  WHERE  uid = {?}", S::v('uid'));
             if (!(list($nom,$mail,$sig,$disp,$maj) = $req->fetchOneRow())) {
index 4f77b0c..87fa509 100644 (file)
@@ -36,7 +36,7 @@ class BandeauModule extends PLModule
         readfile('../htdocs/images/x.png');
         exit();
     }
-    
+
     function handler_html(&$page, $login = '')
     {
         $page->changeTpl('skin/common.bandeau.tpl', NO_SKIN);
@@ -49,7 +49,7 @@ class BandeauModule extends PLModule
         readfile('../htdocs/css/bandeau.css');
         exit();
     }
-    
+
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index cc0c4f6..ac99545 100644 (file)
@@ -94,7 +94,7 @@ class CoreModule extends PLModule
 
         if (isset($_SESSION['log'])) {
             $_SESSION['log']->log("suid_start", "login by ".S::v('forlife'));
-        }    
+        }
         $_SESSION['suid'] = $_SESSION;
         $_SESSION['perms'] =& XorgSession::make_perms($level);
 
index 1350ec7..356d32c 100644 (file)
@@ -79,7 +79,7 @@ class EmailModule extends PLModule
                 "SELECT  alias
                    FROM  virtual          AS v
              INNER JOIN  virtual_redirect AS vr USING(vid)
-                  WHERE  (redirect={?} OR redirect={?}) 
+                  WHERE  (redirect={?} OR redirect={?})
                          AND alias LIKE '%@{$globals->mail->alias_dom}'",
                 $forlife.'@'.$globals->mail->domain, $forlife.'@'.$globals->mail->domain2);
         $page->assign('melix', $res->fetchOneCell());
@@ -115,7 +115,7 @@ class EmailModule extends PLModule
                    FROM  auth_user_quick, virtual
              INNER JOIN  virtual_redirect USING(vid)
                    WHERE ( redirect={?} OR redirect= {?} )
-                         AND alias LIKE '%@{$globals->mail->alias_dom}' AND user_id = {?}", 
+                         AND alias LIKE '%@{$globals->mail->alias_dom}' AND user_id = {?}",
                 $forlife.'@'.$globals->mail->domain,
                 $forlife.'@'.$globals->mail->domain2, S::v('uid'));
         list($alias, $visibility) = $res->fetchOneRow();
@@ -241,7 +241,7 @@ class EmailModule extends PLModule
                    FROM  virtual
              INNER JOIN  virtual_redirect USING(vid)
                   WHERE  (redirect={?} OR redirect={?})
-                         AND alias LIKE '%@{$globals->mail->alias_dom}'", 
+                         AND alias LIKE '%@{$globals->mail->alias_dom}'",
                 $forlife.'@'.$globals->mail->domain, $forlife.'@'.$globals->mail->domain2);
         $melix = $res->fetchOneCell();
         if ($melix) {
@@ -454,7 +454,7 @@ L'équipe d'administration <support@" . $globals->mail->domain . '>';
                         "SELECT  e1.uid, e1.panne != 0 AS panne, count(e2.uid) AS nb_mails,
                                  u.nom, u.prenom, u.promo, a.alias AS forlife
                            FROM  emails as e1
-                      LEFT JOIN  emails as e2 ON(e1.uid = e2.uid 
+                      LEFT JOIN  emails as e2 ON(e1.uid = e2.uid
                                                  AND FIND_IN_SET('active', e2.flags)
                                                  AND e1.email != e2.email)
                      INNER JOIN  auth_user_md5 as u ON(e1.uid = u.user_id)
@@ -546,7 +546,7 @@ L'équipe d'administration <support@" . $globals->mail->domain . '>';
             $sql = "SELECT  w.detection, w.state, w.last, w.description,
                             a1.alias AS edit, a2.alias AS forlife
                       FROM  emails_watch AS w
-                 LEFT JOIN  aliases      AS a1 ON (a1.id = w.uid AND a1.type = 'a_vie')     
+                 LEFT JOIN  aliases      AS a1 ON (a1.id = w.uid AND a1.type = 'a_vie')
                  LEFT JOIN  emails       AS e  ON (w.email = e.email)
                  LEFT JOIN  aliases      AS a2 ON (a2.id = e.uid AND a2.type = 'a_vie')
                      WHERE  w.email = {?}
@@ -573,7 +573,7 @@ L'équipe d'administration <support@" . $globals->mail->domain . '>';
     function handler_lost(&$page, $action = 'list', $email = null)
     {
         $page->changeTpl('emails/lost.tpl');
-        
+
         $page->assign('lost_emails', XDB::iterator('
                                        SELECT u.user_id,       a.alias
                                        FROM auth_user_md5 AS u
index e29b7f2..67e6abd 100644 (file)
@@ -76,7 +76,7 @@ class EventsModule extends PLModule
         } while ($priority && !$res->numRows());
         if (!$res->numRows()) {
             return null;
-        } 
+        }
         return $res->fetchOneAssoc();
     }
 
@@ -86,7 +86,7 @@ class EventsModule extends PLModule
         // annonces promos triées par présence d'une limite sur les promos
         // puis par dates croissantes d'expiration
         $promo = S::v('promo');
-        $uid   = S::i('uid'); 
+        $uid   = S::i('uid');
         $sql = "SELECT  e.id,e.titre, ev.user_id IS NULL AS nonlu
                   FROM  evenements    AS e
             LEFT JOIN   evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
@@ -181,7 +181,7 @@ class EventsModule extends PLModule
         // cache les evenements lus et raffiche les evenements a relire
         if ($action == 'read' && $eid) {
             XDB::execute('DELETE evenements_vus.*
-                            FROM evenements_vus AS ev 
+                            FROM evenements_vus AS ev
                       INNER JOIN evenements AS e ON e.id = ev.evt_id
                            WHERE peremption < NOW()');
             XDB::execute('REPLACE INTO evenements_vus VALUES({?},{?})',
@@ -245,11 +245,11 @@ class EventsModule extends PLModule
     }
 
     function handler_rss(&$page, $user = null, $hash = null)
-    {       
+    {
         require_once 'rss.inc.php';
-            
+
         $uid = init_rss('events/rss.tpl', $user, $hash);
-            
+
         $rss = XDB::iterator(
                 'SELECT  e.id, e.titre, e.texte, e.creation_date, e.post_id, p.attachmime IS NOT NULL AS photo,
                          IF(u2.nom_usage = "", u2.nom, u2.nom_usage) AS nom, u2.prenom, u2.promo
@@ -286,7 +286,7 @@ class EventsModule extends PLModule
     {
         $page->changeTpl('events/submit.tpl');
         $page->addJsLink('ajax.js');
-        
+
         require_once('wiki.inc.php');
         wiki_require_page('Xorg.Annonce');
 
@@ -363,7 +363,7 @@ class EventsModule extends PLModule
         }
     }
 
-    function handler_admin_events(&$page, $action = 'list', $eid = null) 
+    function handler_admin_events(&$page, $action = 'list', $eid = null)
     {
         $page->changeTpl('events/admin.tpl');
         $page->addJsLink('ajax.js');
@@ -401,12 +401,12 @@ class EventsModule extends PLModule
                     $flags->addFlag('important');
                 } else {
                     $flags->rmFlag('important');
-                } 
+                }
                 XDB::execute('UPDATE evenements
-                                 SET creation_date = creation_date, 
+                                 SET creation_date = creation_date,
                                      titre={?}, texte={?}, peremption={?}, promo_min={?}, promo_max={?},
                                      flags = {?}
-                               WHERE id = {?}', 
+                               WHERE id = {?}',
                               Post::v('titre'), Post::v('texte'), Post::v('peremption'),
                               Post::v('promo_min'), Post::v('promo_max'),
                               $flags->flags(), $eid);
@@ -416,7 +416,7 @@ class EventsModule extends PLModule
                                  $eid, $type, $x, $y, $upload->getContents());
                     $upload->rm();
                 }
-            }    
+            }
         }
 
         if ($action == 'edit') {
@@ -444,7 +444,7 @@ class EventsModule extends PLModule
                 $month=substr($p_stamp,4,2);
                 $day=substr($p_stamp,6,2);
 
-                $select .= "<option value=\"$p_stamp\"" 
+                $select .= "<option value=\"$p_stamp\""
                         . (($p_stamp == strtr($peremption, array("-" => ""))) ? " selected" : "")
                         . "> $day / $month / $year</option>\n";
             }
@@ -500,7 +500,7 @@ class EventsModule extends PLModule
         }
         $page->assign('arch', $arch);
         $page->assign('admin_evts', true);
-    }   
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index cc437ea..d9d7358 100644 (file)
@@ -43,28 +43,28 @@ class GeolocModule extends PLModule
         $page->changeTpl('geoloc/admin.tpl');
         require_once("geoloc.inc.php");
         $page->assign('xorg_title','Polytechnique.org - Administration - Geolocalisation');
-        
+
         $nb_synchro = 0;
-        
+
         if (Env::has('id') && is_numeric(Env::v('id'))) {
             if (synchro_city(Env::v('id'))) $nb_synchro ++;
         }
-        
+
         if ($action == 'missinglat') {
             $res = XDB::iterRow("SELECT id FROM geoloc_city WHERE lat = 0 AND lon = 0");
             while ($a = $res->next()) if (synchro_city($a[0])) $nb_synchro++;
         }
-        
-        if ($nb_synchro) 
+
+        if ($nb_synchro)
             $page->trig(($nb_synchro > 1)?($nb_synchro." villes ont été synchronisées"):"Une ville a été synchronisée");
-        
+
         $res = XDB::query("SELECT COUNT(*) FROM geoloc_city WHERE lat = 0 AND lon = 0");
         $page->assign("nb_missinglat", $res->fetchOneCell());
     }
-    
+
     function handler_admin_dynamap(&$page, $action = false) {
         $page->changeTpl('geoloc/admin_dynamap.tpl');
-        
+
         if ($action == 'cities_not_on_map') {
             require_once('geoloc.inc.php');
             if (!fix_cities_not_on_map(20))
@@ -72,31 +72,31 @@ class GeolocModule extends PLModule
             else
                 $refresh = true;
         }
-        
+
         if ($action == 'smallest_maps') {
             require_once('geoloc.inc.php');
             set_smallest_levels();
         }
-        
+
         if ($action == 'precise_coordinates') {
             XDB::execute("UPDATE adresses AS a INNER JOIN geoloc_city AS c ON(a.cityid = c.id) SET a.glat = c.lat / 100000, a.glng = c.lon / 100000");
         }
-        
+
         if ($action == 'newmaps') {
             require_once('geoloc.inc.php');
             if (!get_new_maps(Env::v('url')))
                 $page->trig("Impossible d'accéder aux nouvelles cartes");
         }
-        
+
         $countMissing = XDB::query("SELECT COUNT(*) FROM geoloc_city AS c LEFT JOIN geoloc_city_in_maps AS m ON(c.id = m.city_id) WHERE m.city_id IS NULL");
         $missing = $countMissing->fetchOneCell();
-        
+
         $countNoSmallest = XDB::query("SELECT SUM(IF(infos = 'smallest',1,0)) AS n FROM geoloc_city_in_maps GROUP BY city_id ORDER BY n");
         $noSmallest = $countNoSmallest->fetchOneCell() == 0;
-        
+
         $countNoCoordinates = XDB::query("SELECT COUNT(*) FROM adresses WHERE cityid IS NOT NULL AND glat = 0 AND glng = 0");
         $noCoordinates = $countNoCoordinates->fetchOneCell();
-        
+
         if (isset($refresh) && $missing) {
             $page->assign("xorg_extra_header", "<meta http-equiv='Refresh' content='3'/>");
         }
@@ -104,7 +104,7 @@ class GeolocModule extends PLModule
         $page->assign("no_smallest", $noSmallest);
         $page->assign("no_coordinates", $noCoordinates);
     }
-    
+
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index b2bacc0..89c21de 100644 (file)
@@ -372,7 +372,7 @@ class ListsModule extends PLModule
         if (list($det) = $this->client->get_members($liste)) {
             if (substr($liste,0,5) != 'promo' && ($det['ins'] || $det['priv'])
                     && !$det['own'] && ($det['sub'] < 2)) {
-                exit;  
+                exit;
             }
             require_once('banana/ml.inc.php');
             $banana = new MLBanana(S::v('forlife'), Array('listname' => $liste, 'domain' => $domain, 'action' => 'rss2'));
@@ -437,7 +437,7 @@ class ListsModule extends PLModule
             }
             if (Env::has('sadd')) {
                 pl_redirect('lists/moderate/'.$liste);
-            } 
+            }
         }
 
         if (Post::has('moderate_mails') && Post::has('select_mails')) {
index 1b62a06..b967df7 100644 (file)
@@ -267,7 +267,7 @@ class MarketingModule extends PLModule
                 } else {
                     // On cherche les marketings précédents sur cette adresse
                     // email, en se restreignant au dernier mois
-                    
+
                     if (Marketing::get($uid, $email, true)) {
                         $page->assign('already', true);
                     } else {
index d05c52a..3abc1ee 100644 (file)
@@ -97,28 +97,28 @@ class NewsletterModule extends PLModule
         $page->changeTpl('newsletter/admin.tpl');
         $page->assign('xorg_title','Polytechnique.org - Administration - Newsletter : liste');
         require_once("newsletter.inc.php");
-        
+
         if($new) {
             Newsletter::create();
             pl_redirect("admin/newsletter");
         }
-        
+
         $page->assign('nl_list', Newsletter::listAll());
     }
-    
+
     function handler_admin_nl_edit(&$page, $nid = 'last', $aid = null, $action = 'edit') {
         $page->changeTpl('newsletter/edit.tpl');
         $page->addCssLink('nl.css');
-        $page->assign('xorg_title','Polytechnique.org - Administration - Newsletter : Edition'); 
+        $page->assign('xorg_title','Polytechnique.org - Administration - Newsletter : Edition');
         require_once("newsletter.inc.php");
-        
+
         $nl  = new NewsLetter($nid);
-        
+
         if($action == 'delete') {
             $nl->delArticle($aid);
             pl_redirect("admin/newsletter/edit/$nid");
         }
-        
+
         if($aid == 'update') {
             $nl->_title     = Post::v('title');
             $nl->_title_mail= Post::v('title_mail');
@@ -132,14 +132,14 @@ class NewsletterModule extends PLModule
                 pl_redirect('admin/newsletter/edit/' . $nl->_id);
             }
         }
-        
+
         if(Post::v('save')) {
             $art  = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append'),
                     $aid, Post::v('cid'), Post::v('pos'));
             $nl->saveArticle($art);
             pl_redirect("admin/newsletter/edit/$nid");
         }
-        
+
         if($action == 'edit' && $aid != 'update') {
             $eaid = $aid;
             if(Post::has('title')) {
@@ -150,7 +150,7 @@ class NewsletterModule extends PLModule
             }
             $page->assign('art', $art);
         }
-        
+
         $page->assign_by_ref('nl',$nl);
     }
 
index 5ecc7f4..6cd2b14 100644 (file)
@@ -85,7 +85,7 @@ class PaymentModule extends PLModule
             '%grp/payment/cyber_return'  => $this->make_hook('cyber_return', AUTH_PUBLIC),
             '%grp/payment/paypal_return' => $this->make_hook('paypal_return', AUTH_PUBLIC),
             'admin/payments'        => $this->make_hook('admin', AUTH_MDP, 'admin'),
-        
+
         );
     }
 
@@ -200,7 +200,7 @@ class PaymentModule extends PLModule
                                 WHERE  rcb.id='$champ906'");
             if (list($rcb_text, $c_id, $c_text) = $res->fetchOneRow()) {
                 cb_erreur("erreur lors du paiement : $c_text ($c_id)");
-            } else{ 
+            } else{
                 cb_erreur("erreur inconnue lors du paiement");
             }
         }
@@ -337,12 +337,12 @@ class PaymentModule extends PLModule
     function handler_xnet_payment(&$page, $pid = null)
     {
         global $globals;
-        
+
         if (!is_null($pid)) {
             return  $this->handler_payment($page, $pid);
         }
         $page->changeTpl('payment/xnet.tpl');
-        
+
         $res = XDB::query(
                 "SELECT  id, text, url
                    FROM  {$globals->money->mpay_tprefix}paiements
@@ -436,7 +436,7 @@ class PaymentModule extends PLModule
         $page->assign('trans', $trans);
         $page->assign('event', $event);
     }
-    
+
     function handler_admin(&$page, $action = 'list', $id = null) {
         $page->assign('xorg_title','Polytechnique.org - Administration - Paiements');
         $page->assign('title', 'Gestion des télépaiements');
@@ -453,7 +453,7 @@ class PaymentModule extends PLModule
         $table_editor->describe('mail','email contact',true);
         $table_editor->describe('confirmation','message confirmation',false);
         $table_editor->apply($page, $action, $id);
-    }  
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index ab32ff9..a79f03a 100644 (file)
@@ -37,7 +37,7 @@ class Payment
 
     // }}}
     // {{{ constructor
-    
+
     function Payment($ref=-1)
     {
         global $globals;
@@ -46,7 +46,7 @@ class Payment
                                        FROM  {$globals->money->mpay_tprefix}paiements WHERE id={?}", $r);
         list($this->id, $this->text, $this->url, $flags, $this->mail,
                 $this->montant_min, $this->montant_max, $this->montant_def, $this->asso_id) = $res->fetchOneRow();
-        
+
         $this->montant_min = (float)$this->montant_min;
         $this->montant_max = (float)$this->montant_max;
         $this->flags       = new Flagset($flags);
@@ -54,7 +54,7 @@ class Payment
 
     // }}}
     // {{{ function check()
-    
+
     function check($value)
     {
         $v = (float)strtr($value, ',', '.');
@@ -114,7 +114,7 @@ class PayMethod
         $i   = $id==-1 ? $globals->money->mpay_def_meth : $id;
         $res = XDB::query("SELECT id,text,include FROM {$globals->money->mpay_tprefix}methodes WHERE id={?}", $i);
         list($this->id, $this->text, $this->inc) = $res->fetchOneRow();
-    } 
+    }
 
     // }}}
 }
index ff37371..d031c9e 100644 (file)
@@ -31,7 +31,7 @@ class CyberPayment
 
     // }}}
     // {{{ constructor
-    
+
     function CyberPayment($val)
     {
         $this->val = strtr(sprintf("%.02f", (float)$val), '.', ',');
index 9bc7b03..fb7fab4 100644 (file)
@@ -27,12 +27,12 @@ class PayPal
     var $urlform;
     var $nomsite = "PayPal";
     var $text;
-    
+
     var $infos;
 
     // }}}
     // {{{ constructor
-    
+
     function PayPal($val)
     {
        $this->val_number = $val;
@@ -68,7 +68,7 @@ class PayPal
                'return'      => $roboturl,
                'cn'          => 'Commentaires',
                'no_shipping' => 1,
-            'cbt'         => empty($GLOBALS['IS_XNET_SITE']) ? 
+            'cbt'         => empty($GLOBALS['IS_XNET_SITE']) ?
                                 'Revenir sur polytechnique.org' :
                                 'Revenir sur polytechnique.net');
        
index e2de116..4ba4740 100644 (file)
@@ -185,7 +185,7 @@ class PlatalModule extends PLModule
 
             $_SESSION['password'] = $password = Post::v('response2');
 
-            XDB::execute('UPDATE  auth_user_md5 
+            XDB::execute('UPDATE  auth_user_md5
                              SET  password={?}
                            WHERE  user_id={?}', $password,
                            S::v('uid'));
@@ -210,7 +210,7 @@ class PlatalModule extends PLModule
     {
         $page->changeTpl('platal/acces_smtp.tpl');
         $page->assign('xorg_title','Polytechnique.org - Acces SMTP/NNTP');
-        
+
         require_once 'wiki.inc.php';
         wiki_require_page('Xorg.SMTPSécurisé');
         wiki_require_page('Xorg.NNTPSécurisé');
@@ -219,8 +219,8 @@ class PlatalModule extends PLModule
         $pass = Env::v('smtppass1');
         $log  = S::v('log');
 
-        if (Env::v('op') == "Valider" && strlen($pass) >= 6 
-        &&  Env::v('smtppass1') == Env::v('smtppass2')) 
+        if (Env::v('op') == "Valider" && strlen($pass) >= 6
+        &&  Env::v('smtppass1') == Env::v('smtppass2'))
         {
             XDB::execute('UPDATE auth_user_md5 SET smtppass = {?}
                                      WHERE user_id = {?}', $pass, $uid);
@@ -233,7 +233,7 @@ class PlatalModule extends PLModule
             $log->log("passwd_del");
         }
 
-        $res = XDB::query("SELECT IF(smtppass != '', 'actif', '') 
+        $res = XDB::query("SELECT IF(smtppass != '', 'actif', '')
                                        FROM auth_user_md5
                                       WHERE user_id = {?}", $uid);
         $page->assign('actif', $res->fetchOneCell());
@@ -283,8 +283,8 @@ class PlatalModule extends PLModule
 
             $page->assign('ok', true);
 
-            $url   = rand_url_id(); 
-            XDB::execute('INSERT INTO  perte_pass (certificat,uid,created) 
+            $url   = rand_url_id();
+            XDB::execute('INSERT INTO  perte_pass (certificat,uid,created)
                                VALUES  ({?},{?},NOW())', $url, $uid);
             $res   = XDB::query('SELECT  email
                                    FROM  emails
@@ -307,7 +307,7 @@ class PlatalModule extends PLModule
 
 Si en cliquant dessus tu n'y arrives pas, copie intégralement l'adresse dans la barre de ton navigateur. Si tu n'as pas utilisé ce lien dans six heures, tu peux tout simplement recommencer cette procédure.
 
--- 
+--
 Polytechnique.org
 \"Le portail des élèves & anciens élèves de l'Ecole polytechnique\"
 
index 8dfb88c..e9afd63 100644 (file)
@@ -52,7 +52,7 @@ foreach($adresses as $adrid => $adr){
       array('tel' => '', 'tel_pub' => 'private', 'tel_type' => 'Tél.', 'telid' => 0, 'new_tel' => true),
       array('tel' => '', 'tel_pub' => 'private', 'tel_type' => 'Fax', 'telid' => 1, 'new_tel' => true));
   } elseif (count($adr['tels']) < $nb_tel_max) {
-    $adresses[$adrid]['tels'][] = 
+    $adresses[$adrid]['tels'][] =
       array('tel' => '', 'tel_pub' => 'private', 'tel_type' => 'Autre', 'telid' => generate_new_telid($adr), 'new_tel' => true);
   }
 }
index 318c43c..d423fa2 100644 (file)
@@ -20,7 +20,7 @@
  ***************************************************************************/
 
 $uid = S::v('uid');
+
 $res = XDB::query(
         "SELECT  text,id
            FROM  binets_ins, binets_def
index a8d064b..2f653b0 100644 (file)
@@ -40,7 +40,7 @@ function is_adr_empty($adrid){
                break;
        }
   }
-  return ( 
+  return (
     ($adr['adr1'] == '') && ($adr['adr2'] == '') && ($adr['adr3'] == '') &&
     ($adr['postcode'] == '') && ($adr['city'] == '') && ($adr['country'] == '00') &&
     ($emptytel)
@@ -114,7 +114,7 @@ $restels = XDB::iterator(
     t.adrid, telid, tel_type, t.tel_pub, t.tel
     FROM tels AS t INNER JOIN adresses AS a ON(t.uid = a.uid AND t.adrid = a.adrid)
     WHERE t.uid = {?} AND NOT FIND_IN_SET('pro',statut) ORDER BY t.adrid, tel_type DESC, telid"
-, S::v('uid', -1)   
+, S::v('uid', -1)
 );
 while ($tel = $restels->next()) {
     $adrid = $tel['adrid'];
index 011873f..f0e658c 100644 (file)
@@ -41,7 +41,7 @@ if (Post::has('grade')) {
     foreach (Post::v('grade') as $mid=>$gid) {
         XDB::execute('UPDATE profile_medals_sub SET gid={?} WHERE uid={?} AND mid={?}', $gid, S::v('uid'), $mid);
     }
-} 
+}
 
 $res    = XDB::query(
        "SELECT  m.id, m.text AS medal, m.type, m.img, s.gid
index 063231e..53d18a6 100644 (file)
@@ -40,7 +40,7 @@ if(Post::v('mentor_pays_op', '') == 'retirer') {
 }
 
 //recuperation des pays
-$res = XDB::iterRow("SELECT m.pid, p.pays 
+$res = XDB::iterRow("SELECT m.pid, p.pays
                     FROM mentor_pays AS m
                    LEFT JOIN geoloc_pays AS p ON(m.pid = p.a2) WHERE m.uid = {?} LIMIT {?}", S::v('uid', -1), $max_mentor_pays);
 $nb_mentor_pays = $res->total();
index b6b2d92..0ec632f 100644 (file)
@@ -66,11 +66,11 @@ foreach ($adresses as $adrid => $adr) {
                          $adr['cityid'], $adr['country'], $adr['region'],
                          $adr['regiontxt'], $adr['pub'], $statut,
                          S::v('uid', -1), $adrid);
-            $telsvalues = "";                   
+            $telsvalues = "";                  
             foreach ($adr['tels'] as $tel) {
                 insert_new_tel($adrid, $tel);
             }
-        } else { 
+        } else {
             //c'est une mise à jour
             XDB::execute("UPDATE adresses SET adr1 = {?}, adr2 = {?},
                          adr3 = {?}, postcode = {?}, city = {?}, cityid = {?},
index 675a759..953f2c1 100644 (file)
@@ -56,7 +56,7 @@ function generate_new_telid($adr){
   foreach($telid_array as $current_telid)
     if ($current_telid == $new_telid)
       $new_telid ++;
-    else 
+    else
       return $new_telid;//s'ils sont differents, il y a un trou dans la liste des telid donc new_telid convient
   //si aucun convient, on retourne le plus grand des telid actuel + 1
   return $new_telid;
@@ -71,7 +71,7 @@ function replace_ifset_adr($varname, $i){
 function replace_ifset_tel($varname, $i, $t){
   $tab = Env::v($varname.$t, Array());
   if (isset($tab[$i]))
-       $GLOBALS['adresses'][$i]['tels'][$t][$varname] = $tab[$i];  
+       $GLOBALS['adresses'][$i]['tels'][$t][$varname] = $tab[$i];
 }
 
 function get_adr_arg($varname, $i) {
@@ -102,7 +102,7 @@ function replace_address($i){
     $adresses[$i]['nouvelle'] = 'ajout';
     $adresses[$i]['adrid'] = $i;
   }
-  
+
   replace_ifset_adr('secondaire', $i);
   set_flag_adr('courrier', $i);
   replace_ifset_adr('temporaire', $i);
@@ -119,14 +119,14 @@ function replace_address($i){
   replace_ifset_adr('country', $i);
   replace_ifset_adr('region', $i);
   replace_ifset_adr('pub', $i);
-  
+
   for ($telid = 0; $telid <= $nb_tel_max; $telid++) {
     $tab = Env::v('telid'.$telid, Array());
     if(isset($tab[$i])){ //ce telid etait donc present dans le formulaire
       replace_tel($i, $telid);
     }
   }
+
   if (!get_adr_arg('parsevalid', $i)) replace_ifset_adr('txt', $i);
   $tab = Env::v('numero_formulaire', Array());
   if($tab[$i])
@@ -144,7 +144,7 @@ function geoloc_adresse($i) {
        $adresses[$i] = array_merge($adresses[$i], empty_address());
        // localize new address
        $new = get_address_infos($adresses[$i]['txt']);
-       if (compare_addresses_text($adresses[$i]['txt'], $geotxt = get_address_text($new)) || get_adr_arg('parsevalid', $i)) 
+       if (compare_addresses_text($adresses[$i]['txt'], $geotxt = get_address_text($new)) || get_adr_arg('parsevalid', $i))
                $adresses[$i] = array_merge($adresses[$i], $new);
        else {
                $adresses[$i] = array_merge($adresses[$i], cut_address($adresses[$i]['txt']));
index 19b1b25..c3e4a7b 100644 (file)
@@ -48,7 +48,7 @@ class RegisterModule extends PLModule
             $sub_state['backs'][] = $state;
             if (count($sub_state['backs']) == 3) {
                 $alert .= "Tentative d'inscription tres hesitante - ";
-            }   
+            }
         }
 
         // Compatibility with old sources, keep it atm
@@ -69,7 +69,7 @@ class RegisterModule extends PLModule
                 $sub_state['nom']    = $nom;
                 $sub_state['prenom'] = $prenom;
                 $sub_state['ourmat'] = $ourmat;
-                $sub_state['watch']  = $watch; 
+                $sub_state['watch']  = $watch;
                 $sub_state['naissance_ini'] = $naiss;
 
                 XDB::execute(
@@ -362,7 +362,7 @@ class RegisterModule extends PLModule
                  . " - ip        : {$logger->ip} ({$logger->host})\n"
                  . ($logger->proxy_ip ? " - proxy     : {$logger->proxy_ip} ({$logger->proxy_host})\n" : "");
             $mymail->setTxtBody($msg);
-            $mymail->send(); 
+            $mymail->send();
         }
 
         Marketing::clear($uid);
index f96cce7..bd7dd83 100644 (file)
@@ -31,7 +31,7 @@ function user_cmp($prenom, $nom, $_prenom, $_nom)
     $prenom  = strtoupper(replace_accent($prenom));
 
     $is_ok   = strtoupper($_prenom) == strtoupper($prenom);
-    
+
     $tokens  = preg_split("/[ \-']/", $nom, -1, PREG_SPLIT_NO_EMPTY);
     $maxlen  = 0;
 
@@ -161,7 +161,7 @@ function create_aliases (&$sub)
             "envoie un mail à <a href=\"mailto:support@{$globals->mail->domain}</a>\">" .
             "support@{$globals->mail->domain}</a> en expliquant ta situation.";
     }
-    
+
     $res      = XDB::query('SELECT id, type, expire FROM aliases WHERE alias={?}', $mailorg);
 
     if ( $res->numRows() ) {
@@ -182,25 +182,25 @@ function create_aliases (&$sub)
             $mailer->addCc('"Support Polytechnique.org" <support@' . $globals->mail->domain . '>');
             $msg =
                 "Bonjour,\n\n".
-                
+
                 "Un homonyme vient de s'inscrire. La politique de Polytechnique.org est de fournir des\n".
                 "adresses mail devinables, nous ne pouvons donc pas conserver ton alias '$mailorg' qui\n".
                 "correspond maintenant à deux personnes.\n\n".
-                
+
                 "Tu gardes tout de même l'usage de cet alias pour un mois encore à compter de ce jour.\n\n".
-                
+
                 "Lorsque cet alias sera désactivé, l'adresse $mailorg@polytechnique.org renverra vers un \n".
                 "robot qui indiquera qu'il y a plusieurs personnes portant le même nom ;\n".
                 "cela évite que l'un des homonymes reçoive des courriels destinés à l'autre.\n\n".
-                
+
                 "Pour te connecter au site, tu pourras utiliser comme identifiant n'importe lequel de tes\n".
                 "autres alias :\n".
                 "    ".join(', ', $als)."\n";
                 "Commence dès aujourd'hui à communiquer à tes correspondants la nouvelle adresse que tu comptes utiliser !\n\n".
-                
+
                 "En nous excusant pour le désagrément occasionné,\n".
                 "Cordialement,\n\n".
-                
+
                 "-- \n".
                 "L'équipe de Polytechnique.org\n".
                 "\"Le portail des élèves & anciens élèves de l'X\"";
@@ -232,7 +232,7 @@ function finish_ins($sub_state)
     $pass     = rand_pass();
     $pass_encrypted = hash_encrypt($pass_clair);
     $hash     = rand_url_id(12);
-  
+
     XDB::execute('UPDATE auth_user_md5 SET last_known_email={?} WHERE matricule = {?}', $email, $mat);
 
     XDB::execute(
index b4c4cca..a4cd481 100644 (file)
@@ -145,7 +145,7 @@ class SearchModule extends PLModule
         }
 
         require_once dirname(__FILE__) . '/search/search.inc.php';
-        $page->changeTpl('search/index.tpl');            
+        $page->changeTpl('search/index.tpl');
         $page->assign('xorg_title','Polytechnique.org - Annuaire');
     }
 
@@ -165,7 +165,7 @@ class SearchModule extends PLModule
             $view->addMod('trombi', 'Trombinoscope', false, array('with_promo' => true));
             $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'search/adv'));
             $view->apply('search/adv', $page, $action, $subaction);
-            
+
             if ($subaction) {
                 return;
             }
@@ -199,7 +199,7 @@ class SearchModule extends PLModule
                            $_REQUEST['q']);
         if (!$q) exit();
 
-        // try to look in cached results        
+        // try to look in cached results
         $cache = XDB::query('SELECT  `result`
                                FROM  `search_autocomplete`
                               WHERE  `name` = {?} AND
@@ -210,7 +210,7 @@ class SearchModule extends PLModule
             echo $res;
             die();
         }
-        
+
         // default search
         $q = preg_quote($q);
         $unique = '`user_id`';
@@ -219,7 +219,7 @@ class SearchModule extends PLModule
         $beginwith = true;
         $field2 = false;
         $qsearch = $q;
-        
+
         switch ($type) {
           case 'binetTxt':
             $db = '`binets_def` INNER JOIN
@@ -314,7 +314,7 @@ class SearchModule extends PLModule
             $beginwith = false;
             break;
           case 'sectionTxt':
-            $db = '`sections` INNER JOIN 
+            $db = '`sections` INNER JOIN
                    `auth_user_md5` ON(`auth_user_md5`.`section` = `sections`.`id`)';
             $field = '`sections`.`text`';
             $realid = '`sections`.`id`';
@@ -362,7 +362,7 @@ class SearchModule extends PLModule
         echo $res;
         exit();
     }
-    
+
     function handler_list(&$page, $type = null, $idVal = null)
     {
         // Give the list of all values possible of type and builds a select input for it
@@ -393,7 +393,7 @@ class SearchModule extends PLModule
             $db = '`groupesx_def`';
             break;
           case 'nationalite':
-            $db = '`geoloc_pays` INNER JOIN 
+            $db = '`geoloc_pays` INNER JOIN
                    `auth_user_md5` ON (`geoloc_pays`.`a2` = `auth_user_md5`.`nationalite`)';
             $field = 'IF(`nat`=\'\', `pays`, `nat`)';
             $id = '`a2`';
@@ -401,7 +401,7 @@ class SearchModule extends PLModule
           case 'region':
             $db = '`geoloc_region`';
             $field = '`name`';
-            $id = '`region`'; 
+            $id = '`region`';
             if (isset($_REQUEST['country'])) {
                 $where .= ' WHERE `a2` = "'.$_REQUEST['country'].'"';
             }
index 29d7163..edebc8c 100644 (file)
@@ -38,7 +38,7 @@ require_once("xorg.misc.inc.php");
     IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166,
     COUNT(em.email) > 0 AS actif,';
 // hide private information if not logged
-if (S::logged()) 
+if (S::logged())
     $globals->search->result_fields .='
         q.profile_web AS web,
         q.profile_mobile AS mobile,
@@ -138,7 +138,7 @@ class SField
     // }}}
     // {{{ function get_request()
 
-    /** récupérer la requête de l'utilisateur 
+    /** récupérer la requête de l'utilisateur
      * on met une chaîne vide si le champ n'a pas été complété */
     function get_request()
     {
@@ -149,7 +149,7 @@ class SField
     // {{{ function get_where_statement()
 
     /** récupérer la clause correspondant au champ dans la clause WHERE de la requête
-     * on parcourt l'ensemble des champs de la bdd de $fieldDbName et on associe 
+     * on parcourt l'ensemble des champs de la bdd de $fieldDbName et on associe
      * à chacun d'entre eux une clause spécifique
      * la clause totale et la disjonction de ces clauses spécifiques */
     function get_where_statement()
@@ -490,7 +490,7 @@ class MapSField extends RefSField
         $this->value =  $this->mapId;
         $this->RefSField($_fieldFormName, $_fieldDbName, $_refTable, $_refAlias, $_refCondition, true, false);
     }
-    
+
     function get_select_statement()
     {
         if ($this->mapId === '') return false;
@@ -651,7 +651,7 @@ class PromoSField extends SField
     // }}}
     // {{{ constructor
 
-    /** constructeur 
+    /** constructeur
      * compareField est un champ de formulaire très simple qui ne sert qu'à la construction de la
      * clause WHERE de la promo */
     function PromoSField($_fieldFormName, $_compareFieldFormName, $_fieldDbName, $_fieldResultName)
index 8334c36..dab3017 100644 (file)
@@ -35,7 +35,7 @@ function advancedSearchFromInput()
         $firstnameField = new StringSField('firstname',array('u.prenom'),'');
     }
     $nicknameField   = new StringSField('nickname',array('q.profile_nick'),'');
-    
+
     $promo1Field     = new PromoSField('promo1','egal1',array('u.promo'),'');
     $promo2Field     = new PromoSField('promo2','egal2',array('u.promo'),'');
     $womanField      = new RefSField('woman',array('FIND_IN_SET(\'femme\',u.flags)+1'),'','','');
@@ -53,17 +53,17 @@ function advancedSearchFromInput()
     $fonctionField   = new RefSField('fonction',array('en.fonction'),'entreprises','en','u.user_id=en.uid');
     $secteurField    = new RefSField('secteur',array('fm.secteur'),'entreprises','fm','u.user_id=fm.uid');
     $cvField         = new RefSField('cv',array('u.cv'),'','','',false);
-   
+
     $natField        = new RefSField('nationalite',array('u.nationalite'),'','','');
     $binetField      = new RefSField('binet',array('b.binet_id'),'binets_ins','b','u.user_id=b.user_id');
     $groupexField    = new RefSField('groupex',array('g.gid'),'groupesx_ins','g','u.user_id=g.guid');
     $sectionField    = new RefSField('section',array('u.section'),'','','');
     $schoolField     = new RefSField('school',array('as.aid'),'applis_ins','`as`','u.user_id=as.uid');
     $diplomaField    = new RefSField('diploma',array('ad.type'),'applis_ins','ad','u.user_id=ad.uid');
-  
+
     $freeField       = new RefSField('free',array('q.profile_freetext'),'','','',false);
-  
-    return array( 
+
+    return array(
                 $nameField, $firstnameField, $nicknameField, $promo1Field,
                 $promo2Field, $womanField, $subscriberField, $aliveField,
                 $townField, $countryField, $regionField, $mapField, $entrepriseField,
index 4887934..58ee7d1 100644 (file)
@@ -68,7 +68,7 @@ class StatsModule extends PLModule
                              TO_DAYS(date_ins)-TO_DAYS(NOW()),
                             ".(-($jours+1)).") AS jour,
                          COUNT(user_id) AS nb
-                   FROM  auth_user_md5 
+                   FROM  auth_user_md5
                   WHERE  perms IN ('admin','user')
                GROUP BY  jour");
 
@@ -188,7 +188,7 @@ EOF2;
                                  TO_DAYS(date_ins)-TO_DAYS(NOW()),
                                 ".(-($jours+1)).") AS jour,
                              COUNT(user_id) AS nb
-                       FROM  auth_user_md5 
+                       FROM  auth_user_md5
                       WHERE  promo = {?} AND perms IN ('admin','user')
                    GROUP BY  jour", $promo);
 
index 6ee4676..65ed987 100644 (file)
@@ -359,7 +359,7 @@ class SurveyModule extends PLModule
         } // }}}
     }
     // }}}
+
     // {{{ function handler_ajax() : some ajax in editing a new question (for now, there may be a little more later)
     function handler_ajax(&$page, $type)
     {
@@ -442,7 +442,7 @@ class SurveyModule extends PLModule
         }
     }
     // }}}
-    
+
     // {{{ function show_confirm() : calls the template to display a confirm form
     function show_confirm(&$page, $message, $formaction, $formhidden = null)
     {
index 4fceb21..d57101a 100644 (file)
@@ -56,7 +56,7 @@ class XnetModule extends PLModule
         }
         exit;
     }
-    
+
     function handler_index(&$page)
     {
         $page->nomenu = true;
@@ -197,7 +197,7 @@ class XnetModule extends PLModule
 
         $page->setType($cat);
     }
-    
+
     function handler_autologin(&$page)
     {
         $allkeys = func_get_args();
index 1fbd64a..73af616 100644 (file)
@@ -40,7 +40,7 @@ function get_event_detail($eid, $item_id = false)
       LEFT JOIN        groupex.evenements_participants AS ep ON(e.eid = ep.eid AND ei.item_id = ep.item_id)
       LEFT JOIN virtual AS al ON(al.type = 'evt' AND al.alias = CONCAT(short_name, {?}))
       LEFT JOIN virtual AS pl ON(pl.type = 'evt' AND pl.alias = CONCAT(short_name, {?}))
-          WHERE        (e.eid = {?} OR e.short_name = {?}) AND ei.item_id = {?} AND e.asso_id = {?} 
+          WHERE        (e.eid = {?} OR e.short_name = {?}) AND ei.item_id = {?} AND e.asso_id = {?}
        GROUP BY ei.item_id",
        '-absents@'.$globals->xnet->evts_domain,
        '-participants@'.$globals->xnet->evts_domain,
@@ -126,7 +126,7 @@ function get_event_participants($evt, $item_id, $tri, $limit = '') {
                    IF(m.origine != 'X',m.sexe,FIND_IN_SET('femme', u.flags)) AS femme,
                    m.perms='admin' AS admin,
                    (m.origine = 'X') AS x,
-                  ep.uid, SUM(ep.paid) AS paid, SUM(nb) AS nb 
+                  ep.uid, SUM(ep.paid) AS paid, SUM(nb) AS nb
              FROM  groupex.evenements_participants AS ep
        INNER JOIN  groupex.evenements AS e ON (ep.eid = e.eid)
        LEFT JOIN  groupex.membres AS m ON ( ep.uid = m.uid AND e.asso_id = m.asso_id)
index 918101e..0c29632 100644 (file)
@@ -46,7 +46,7 @@ function get_infos($email)
                                 WHERE user_id = {?}", $user['uid']);
             $user = array_merge($user, $res->fetchOneAssoc());
         }
-        return $user;                        
+        return $user;
     } elseif ($dom == 'polytechnique.org' || $dom == 'm4x.org') {
         $res = XDB::query(
                 "SELECT  user_id AS uid, u.promo,
@@ -122,7 +122,7 @@ class XnetGrpModule extends PLModule
                 XDB::query('DELETE r.*
                               FROM groupex.announces_read AS r
                         INNER JOIN groupex.announces AS a ON a.id = r.announce_id
-                             WHERE peremption < CURRENT_DATE()');       
+                             WHERE peremption < CURRENT_DATE()');
                 XDB::query('INSERT INTO groupex.announces_read
                                  VALUES ({?}, {?})',
                             Env::i('read'), S::i('uid'));
@@ -170,7 +170,7 @@ class XnetGrpModule extends PLModule
             $page->setRssLink("Polytechnique.net :: {$globals->asso("nom")} :: News",
                               'rss/'.S::v('forlife') .'/'.S::v('core_rss_hash').'/rss.xml');
         }
-        
+
         $page->register_modifier('wiki_to_html', array('MiniWiki','WikiToHTML'));
         $page->assign('articles', $arts);
 
@@ -430,7 +430,7 @@ class XnetGrpModule extends PLModule
                 LEFT JOIN  emails          AS e ON ( e.flags = 'active' AND e.uid = m.uid)
                     WHERE  m.asso_id = {?} $ini
                            AND (m.origine != 'X' OR u.perms != 'pending' OR m.email IS NOT NULL)
-                 GROUP BY  m.uid          
+                 GROUP BY  m.uid
                  ORDER BY  $tri
                     LIMIT  {?},{?}", $globals->asso('id'), $ofs*NB_PER_PAGE, NB_PER_PAGE);
         $page->assign('ann', $ann);
@@ -446,7 +446,7 @@ class XnetGrpModule extends PLModule
     {
         pl_redirect('annuaire/geoloc');
     }
-    
+
     function handler_vcard(&$page, $photos = null)
     {
         global $globals;
@@ -582,7 +582,7 @@ class XnetGrpModule extends PLModule
     {
         if (Env::has('right') && (may_update() || S::has('suid'))) {
             switch (Env::v('right')) {
-              case 'admin':              
+              case 'admin':
                 XnetSession::killSuid();
                 break;
               case 'anim':
@@ -591,7 +591,7 @@ class XnetGrpModule extends PLModule
                 is_member(true);
                 break;
               case 'member':
-                XnetSession::doSelfSuid();  
+                XnetSession::doSelfSuid();
                 may_update(false, true);
                 is_member(true);
                 break;
@@ -698,7 +698,7 @@ class XnetGrpModule extends PLModule
                                 $market = new Marketing($uid, $email, 'group', $globals->asso('nom'),
                                                         Env::v('market_from'), S::v('uid'));
                                 $market->add();
-                            }            
+                            }
                         }
                         XDB::execute('INSERT INTO groupex.membres (uid, asso_id, origine, email)
                                            VALUES ({?}, {?}, "X", {?})',
@@ -1017,9 +1017,9 @@ class XnetGrpModule extends PLModule
             $promo_min = ($art['public'] ? 0 : $art['promo_min']);
             $promo_max = ($art['public'] ? 0 : $art['promo_max']);
             if (is_null($aid)) {
-                $fulltext = $art['texte']; 
-                if (!empty($art['contact_html'])) { 
-                    $fulltext .= "\n\n'''Contacts :'''\\\\\n" . $art['contact_html']; 
+                $fulltext = $art['texte'];
+                if (!empty($art['contact_html'])) {
+                    $fulltext .= "\n\n'''Contacts :'''\\\\\n" . $art['contact_html'];
                 }
                 $post = null;
                 if ($globals->asso('forum')) {
@@ -1062,7 +1062,7 @@ class XnetGrpModule extends PLModule
         }
         if (Post::v('valid') == 'Enregistrer' || Post::v('valid') == 'Annuler') {
             pl_redirect("");
-        } 
+        }
 
         if (empty($art) && !is_null($aid)) {
             $res = XDB::query("SELECT a.*, u.nom, u.prenom, u.promo, l.alias AS forlife,
@@ -1088,7 +1088,7 @@ class XnetGrpModule extends PLModule
             if ($events->total()) {
                 $page->assign('events', $events);
             }
-        } 
+        }
 
         $art['contact_html'] = @MiniWiki::WikiToHTML($art['contact_html']);
         $page->assign('art', $art);
index a56719f..d20ec27 100644 (file)
@@ -24,9 +24,9 @@
 function get_all_redirects($membres, $mls, &$client)
 {
     global $globals;
-    
+
     $tos = array();
-    
+
     if (!empty($membres)) {
         $membres = array_map(create_function('$str', 'return "\"$str\"";'), $membres);
         $membres = join(',', $membres);
@@ -82,7 +82,7 @@ function _send_xnet_mail($user, $body, $wiki, $mailer, $replyto = null)
     $nom  = isset($user['nom']) ? $user['nom'] : "";
     $pnom = isset($user['prenom']) ? $user['prenom'] : preg_replace('!@.*!u', '', $user['email']);
     $to   = isset($user['prenom']) ? "\"{$user['prenom']} {$user['nom']}\" <{$user['email']}>" : $user['email'];
-    
+
     $text = $body;
     $text = preg_replace('!<cher>!i',   $cher, $text);
     $text = preg_replace('!<nom>!i',    $nom,  $text);
index 20aeb0d..ffa414c 100644 (file)
@@ -41,7 +41,7 @@ $tidy_config = array(
  * File:     block.min_perms.php
  * Type:     block
  * Name:     min_perms
- * Purpose:  
+ * Purpose:
  * -------------------------------------------------------------
  */
 function smarty_block_tidy($params, $content, &$smarty)
index c498d90..25c991e 100644 (file)
@@ -30,8 +30,8 @@ function display_address_isIdentity($idt, $value, $test_reverse = true)
         return true;
     }
 
-    if ($test_reverse) { 
-        return display_address_isIdentity($idt, implode(' ', array_reverse(explode(' ', $value))), false); 
+    if ($test_reverse) {
+        return display_address_isIdentity($idt, implode(' ', array_reverse(explode(' ', $value))), false);
     }
     return false;
 }
@@ -82,7 +82,7 @@ function smarty_function_display_address($param, &$smarty)
     if ($param['adr']['mobile'])
         $txthtml .= "<div>\n<em>Tél : </em>\n<strong>".$param['adr']['mobile']."</strong>\n</div>\n";
     if ($param['adr']['tels'] && count($param['adr']['tels'])) {
-        foreach ($param['adr']['tels'] as $tel) 
+        foreach ($param['adr']['tels'] as $tel)
             $txthtml .= "<div>\n<em>".$tel['tel_type']."&nbsp;: </em>\n<strong>".$tel['tel']."</strong>\n</div>\n";
     }
     if (!$param['nodiv']) {
index 7c598e8..edea562 100644 (file)
@@ -28,8 +28,8 @@ function select_options($table,$valeur,$champ="text",$pad=false,
     $order = $champ;
     if ($group) {
         $fields .= ',' . $group;
-        $order = $group . ',' . $order; 
-    } 
+        $order = $group . ',' . $order;
+    }
     $sql = "SELECT $fields FROM $table AS t $join $where ORDER BY $order";
     $res = XDB::iterRow($sql);
     $sel = ' selected="selected"';
@@ -48,7 +48,7 @@ function select_options($table,$valeur,$champ="text",$pad=false,
             $html .= '<optgroup label="' . pl_entities($my_grp, ENT_QUOTES) . '">';
             $optgrp = $my_grp;
         }
-        $html .= sprintf("<option value=\"%s\" %s>%s</option>\n", 
+        $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",
                          $my_id, ($valeur==$my_id?$sel:""), $my_text);
     }
     if (!is_null($optgrp)) {
index bd7e7f5..f19ff89 100644 (file)
 
 /*
  * Smarty plugin
- * ------------------------------------------------------------- 
+ * -------------------------------------------------------------
  * File:     insert.getNbIns.php
  * Type:     insert
  * Name:     getNbIns
- * Purpose:  
+ * Purpose:
  * -------------------------------------------------------------
  */
 function smarty_insert_getNbIns($params, &$smarty)
index de4501f..3da1aad 100644 (file)
@@ -19,7 +19,7 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
+
 function smarty_insert_getNbNotifs($params, &$smarty)
 {
     if(S::logged()) {
index ca14209..cacb67a 100644 (file)
@@ -40,7 +40,7 @@ function smarty_insert_getUsername()
                  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, {?}) 
+                 WHERE redirect = CONCAT(a.alias, {?})
                       OR redirect = CONCAT(a.alias, {?})",
                $id, "@".$globals->mail->domain, "@".$globals->mail->domain2);
        $alias = $res->fetchOneCell();
index 9acdb4b..0133eee 100644 (file)
 
 /*
  * Smarty plugin
- * ------------------------------------------------------------- 
+ * -------------------------------------------------------------
  * File:     insert.mkStats.php
  * Type:     insert
  * Name:     mkStats
- * Purpose:  
+ * Purpose:
  * -------------------------------------------------------------
  */
 function smarty_insert_mkStats($params, &$smarty)
index 983d4ca..ae500fc 100755 (executable)
@@ -5,4 +5,4 @@ list_members polytechnique.org-newsletter | \
     sed -e 's!^\(.*\)@polytechnique.org!INSERT INTO newsletter_ins SELECT id FROM aliases WHERE alias="\1";!' | \
     mysql x4dat
 
-echo "DELETE FROM aliases WHERE alias LIKE 'newsletter%';" | mysql x4dat 
+echo "DELETE FROM aliases WHERE alias LIKE 'newsletter%';" | mysql x4dat
index d16f2d9..6ceacf3 100755 (executable)
@@ -201,9 +201,9 @@ def create_list(vhost,listname,desc,advertise,modlevel,inslevel,owners,members):
         mlist.default_member_moderation = int(modlevel) is 2
         mlist.generic_nonmember_action = int(modlevel) > 0
         mlist.subscribe_policy = 2 * (int(inslevel) is 1)
-        
+
         mlist.owner = owners
-        
+
         mlist.subject_prefix = '['+listname+'] '
         mlist.max_message_size = 0
 
deleted file mode 120000 (symlink)
index 442fab7cb7e2919b0a67d0e63fe5ed4f33c7be29..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../../bin/connect.db.inc.php
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..1cade25c72898226666f92f40aad3a486560cb7f
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2007 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                *
+ ***************************************************************************/
+
+ini_set('include_path',dirname(__FILE__).'/../include:' . dirname(__FILE__).'/../classes:/usr/share/php');
+
+require_once('xorg.inc.php');
+require_once('xorg.misc.inc.php');
+
+require_once 'xdb.php';
+
+$globals->baseurl = "https://www.polytechnique.org";
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
index a7f3788..394affa 100755 (executable)
@@ -30,6 +30,6 @@ echo "To make statistics work :
       evolution-inscrits-mails, plot-graphs, mailParselog
   - add symlinks :
       in htdocs/stats : ln -s /home/web/stats/graph-* .
-      in templates/stats : ln -s /home/web/stats/lastParselog* . 
+      in templates/stats : ln -s /home/web/stats/lastParselog* .
 
 "
index 02158f4..be6f0d5 100755 (executable)
@@ -26,6 +26,6 @@ echo "BE CAREFUL :
 * carva redirects are still in scripts/ but their path and name have changed.
   --> the error page is scripts/webredirect_error.php
   --> the redirect page is scripts/webredirect.php
-  
+
 * mailman : update the conf to use the mhonarc archiver
 "
index 807a287..010efc5 100755 (executable)
@@ -25,7 +25,7 @@ You now have to :
 
 (*) apt-get install php4-gd2
     add extension=gd.so in /etc/php/apache(2?)/php.ini
-    
+
 (*) apt-get install php-banana (may not be on public servers)
     and add a rewrite rule on www.polytechnique.org (http and https) :
     ^/banana/([^/]*/.*)$    /usr/share/banana/\$1