Merge branch 'platal-0.9.17'
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 19 Jul 2008 14:02:32 +0000 (16:02 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 19 Jul 2008 14:02:32 +0000 (16:02 +0200)
Conflicts:

classes/plset.php
include/user.func.inc.php

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
12 files changed:
1  2 
include/userset.inc.php
include/validations.inc.php
modules/admin.php
modules/axletter.php
modules/carnet.php
modules/email.php
modules/lists.php
modules/marketing.php
modules/platal.php
modules/register/register.inc.php
modules/search.php
modules/xnetgrp.php

diff --combined include/userset.inc.php
@@@ -19,6 -19,7 +19,6 @@@
   *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
   ***************************************************************************/
  
 -require_once('xorg.misc.inc.php');
  require_once('user.func.inc.php');
  
  global $globals;
@@@ -209,6 -210,23 +209,23 @@@ class MinificheView extends MultipageVi
                   : "");
      }
  
+     public function bounds()
+     {
+         $order = Env::v('order', $this->defaultkey);
+         $show_bounds = 0;
+         if (($order == "name") || ($order == "-name")) {
+             $this->bound_field = "nom";
+             $show_bounds = 1;
+         } elseif (($order == "promo") || ($order == "-promo")) {
+             $this->bound_field = "promo";
+             $show_bounds = -1;
+         }
+         if ($order{0} == '-') {
+             $show_bounds = -$show_bounds;
+         }
+         return $show_bounds;
+     }
      public function templateName()
      {
          return 'include/plview.minifiche.tpl';
@@@ -234,6 -252,23 +251,23 @@@ class MentorView extends MultipageVie
                  ms.secteur, ms.ss_secteur";
      }
  
+     public function bounds()
+     {
+         $order = Env::v('order', $this->defaultkey);
+         $show_bounds = 0;
+         if (($order == "name") || ($order == "-name")) {
+             $this->bound_field = "nom";
+             $show_bounds = 1;
+         } elseif (($order == "promo") || ($order == "-promo")) {
+             $this->bound_field = "promo";
+             $show_bounds = -1;
+         }
+         if ($order{0} == '-') {
+             $show_bounds = -$show_bounds;
+         }
+         return $show_bounds;
+     }
      public function templateName()
      {
          return 'include/plview.referent.tpl';
@@@ -264,12 -299,29 +298,29 @@@ class TrombiView extends MultipageVie
          return "INNER JOIN  photo AS p ON (p.uid = u.user_id) ";
      }
  
+     public function bounds()
+     {
+         $order = Env::v('order', $this->defaultkey);
+         $show_bounds = 0;
+         if (($order == "name") || ($order == "-name")) {
+             $this->bound_field = "nom";
+             $show_bounds = 1;
+         } elseif (($order == "promo") || ($order == "-promo")) {
+             $this->bound_field = "promo";
+             $show_bounds = -1;
+         }
+         if ($order{0} == '-') {
+             $show_bounds = -$show_bounds;
+         }
+         return $show_bounds;
+     }
      public function templateName()
      {
          return 'include/plview.trombi.tpl';
      }
  
 -    public function apply(PlatalPage &$page)
 +    public function apply(PlPage &$page)
      {
          if (!empty($GLOBALS['IS_XNET_SITE'])) {
              global $globals;
@@@ -306,7 -358,7 +357,7 @@@ class GeolocView implements PlVie
          return $args;
      }
  
 -    public function apply(PlatalPage &$page)
 +    public function apply(PlPage &$page)
      {
          require_once 'geoloc.inc.php';
          require_once '../modules/search/search.inc.php';
@@@ -404,7 -456,7 +455,7 @@@ class GadgetView implements PlVie
                   : "");
      }
  
 -    public function apply(PlatalPage &$page)
 +    public function apply(PlPage &$page)
      {
          $page->assign_by_ref('set',
            $this->set->get($this->fields(), $this->joins(), null, null, null, 5, 0));
@@@ -21,8 -21,7 +21,8 @@@
  
  define('SIZE_MAX', 32768);
  
 -require_once dirname(__FILE__) . '/../classes/xdb.php';
 +global $globals;
 +require_once $globals->spoolroot . '/core/classes/xdb.php';
  
  /**
   * Iterator class, that lists objects through the database
@@@ -117,7 -116,7 +117,7 @@@ abstract class Validat
                  $this->uid, $this->type, $this, $this->stamp);
  
          global $globals;
 -        update_NbValid();
 +        $globals->updateNbValid();
          return true;
      }
  
              $success =  XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}',
                                        $this->uid, $this->type, $this->stamp);
          }
 -        update_NbValid();
 +        $globals->updateNbValid();
          return $success;
      }
  
              if ($this->commit()) {
                  $this->sendmail(true);
                  $this->clean();
-                 $this->trigSuccess('Mail de validation envoyé');
+                 $this->trigSuccess('Email de validation envoyé');
                  return true;
              } else {
                  $this->trigError('Erreur lors de la validation');
              if (Env::v('comm')) {
                  $this->sendmail(false);
                  $this->clean();
-                 $this->trigSuccess('Mail de refus envoyé');
+                 $this->trigSuccess('Email de refus envoyé');
                  return true;
              } else {
                  $this->trigError('pas de motivation pour le refus !!!');
  
      protected function trigError($msg)
      {
 -        global $page;
 -        $page->trigError($msg);
 +        Platal::page()->trigError($msg);
      }
  
      protected function trigWarning($msg)
      {
 -        global $page;
 -        $page->trigWarning($msg);
 +        Platal::page()->trigWarning($msg);
      }
  
      protected function trigSuccess($msg)
      {
 -        global $page;
 -        $page->trigSuccess($msg);
 +        Platal::page()->trigSuccess($msg);
      }
  
      // }}}
diff --combined modules/admin.php
@@@ -59,18 -59,18 +59,18 @@@ class AdminModule extends PLModul
      function handler_default(&$page)
      {
          $page->changeTpl('admin/index.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration');
 +        $page->setTitle('Polytechnique.org - Administration');
      }
  
      function handler_postfix_delayed(&$page)
      {
          $page->changeTpl('admin/postfix_delayed.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Postfix : Retardés');
 +        $page->setTitle('Polytechnique.org - Administration - Postfix : Retardés');
  
          if (Env::has('del')) {
              $crc = Env::v('crc');
              XDB::execute("UPDATE postfix_mailseen SET release = 'del' WHERE crc = {?}", $crc);
-             $page->trigSuccess($crc." verra tous ses mails supprimés !");
+             $page->trigSuccess($crc." verra tous ses emails supprimés !");
          } elseif (Env::has('ok')) {
              $crc = Env::v('crc');
              XDB::execute("UPDATE postfix_mailseen SET release = 'ok' WHERE crc = {?}", $crc);
@@@ -90,7 -90,7 +90,7 @@@
  
      function handler_postfix_regexpsbounces(&$page, $new = null) {
          $page->changeTpl('admin/emails_bounces_re.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Postfix : Regexps Bounces');
 +        $page->setTitle('Polytechnique.org - Administration - Postfix : Regexps Bounces');
          $page->assign('new', $new);
  
          if (Post::has('submit')) {
  
          $page->changeTpl('admin/logger-view.tpl');
  
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Logs des sessions');
 +        $page->setTitle('Polytechnique.org - Administration - Logs des sessions');
      }
  
      function handler_user(&$page, $login = false)
      {
          global $globals;
          $page->changeTpl('admin/utilisateurs.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Edit/Su/Log');
 +        $page->setTitle('Polytechnique.org - Administration - Edit/Su/Log');
          require_once("emails.inc.php");
          require_once("user.func.inc.php");
  
          }
  
          if(Env::has('suid_button') && $login) {
 -            $_SESSION['log']->log("suid_start", "login by ".S::v('forlife'));
 -            $_SESSION['suid'] = $_SESSION;
 -            $r = XDB::query("SELECT id FROM aliases WHERE alias={?}", $login);
 +            S::logger()->log("suid_start", "login by ".S::v('forlife'));
 +            $r = XDB::query("SELECT  id
 +                               FROM  aliases
 +                              WHERE  alias={?}", $login);
              if($uid = $r->fetchOneCell()) {
 -                start_connexion($uid, true);
 -                pl_redirect("");
 +                if (!Platal::session()->startSUID($uid)) {
 +                    $page->trigError('Impossible d\'effectuer un SUID sur ' . $uid);
 +                } else {
 +                    $page->kill("coucou");
 +                    pl_redirect("");
 +                }
              }
          }
  
                              $mailer->send();
  
                              // update number of subscribers (perms or deceased may have changed)
 -                            update_NbIns();
 +                            $globals->updateNbIns();
  
                              $page->trigSuccess("updaté correctement.");
                          }
                          if (Env::v('nomusageN') != $mr['nom_usage']) {
 -                            require_once "xorg.misc.inc.php";
                              set_new_usage($mr['user_id'], Env::v('nomusageN'), make_username(Env::v('prenomN'), Env::v('nomusageN')));
                          }
                          if (Env::v('decesN') != $mr['deces']) {
                      case "u_kill":
                          user_clear_all_subs($mr['user_id']);
                          // update number of subscribers (perms or deceased may have changed)
 -                        update_NbIns();
 +                        $globals->updateNbIns();
                          $page->trigSuccess("'{$mr['user_id']}' a été désinscrit !");
                          $mailer = new PlMailer("admin/useredit.mail.tpl");
                          $mailer->assign("admin", S::v('forlife'));
  
      function handler_homonyms(&$page, $op = 'list', $target = null) {
          $page->changeTpl('admin/homonymes.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Homonymes');
 +        $page->setTitle('Polytechnique.org - Administration - Homonymes');
          require_once("homonymes.inc.php");
  
          if ($target) {
  
      function handler_ax_xorg(&$page) {
          $page->changeTpl('admin/ax-xorg.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - AX/X.org');
 +        $page->setTitle('Polytechnique.org - Administration - AX/X.org');
  
          // liste des différences
          $res = XDB::query(
  
      function handler_deaths(&$page, $promo = 0, $validate = false) {
          $page->changeTpl('admin/deces_promo.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Deces');
 +        $page->setTitle('Polytechnique.org - Administration - Deces');
  
          if (!$promo)
              $promo = Env::i('promo');
  
      function handler_dead_but_active(&$page) {
          $page->changeTpl('admin/dead_but_active.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Décédés');
 +        $page->setTitle('Polytechnique.org - Administration - Décédés');
  
          $res = XDB::iterator(
                  "SELECT  u.promo, u.nom, u.prenom, u.deces, u.matricule_ax, a.alias, DATE(MAX(s.start)) AS last
  
      function handler_synchro_ax(&$page, $user = null, $action = null) {
          $page->changeTpl('admin/synchro_ax.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Synchro AX');
 +        $page->setTitle('Polytechnique.org - Administration - Synchro AX');
  
          require_once('synchro_ax.inc.php');
  
      function handler_validate(&$page, $action = 'list', $id = null)
      {
          $page->changeTpl('admin/valider.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Valider une demande');
 +        $page->setTitle('Polytechnique.org - Administration - Valider une demande');
                  $page->addCssLink('nl.css');
          $page->addJsLink('ajax.js');
          require_once("validations.inc.php");
  
          // Update the count of item to validate here... useful in development configuration
          // where several copies of the site use the same DB, but not the same "dynamic configuration"
 -        update_NbValid();
 +        global $globals;
 +        $globals->updateNbValid();
          $page->assign('vit', new ValidateIterator());
      }
  
      function handler_validate_answers(&$page, $action = 'list', $id = null) {
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Réponses automatiques de validation');
 +        $page->setTitle('Polytechnique.org - Administration - Réponses automatiques de validation');
          $page->assign('title', 'Gestion des réponses automatiques');
          $table_editor = new PLTableEditor('admin/validate/answers','requests_answers','id');
          $table_editor->describe('category','catégorie',true);
          $table_editor->apply($page, $action, $id);
      }
      function handler_skins(&$page, $action = 'list', $id = null) {
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Skins');
 +        $page->setTitle('Polytechnique.org - Administration - Skins');
          $page->assign('title', 'Gestion des skins');
          $table_editor = new PLTableEditor('admin/skins','skins','id');
          $table_editor->describe('name','nom',true);
      }
  
      function handler_postfix_blacklist(&$page, $action = 'list', $id = null) {
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Postfix : Blacklist');
 +        $page->setTitle('Polytechnique.org - Administration - Postfix : Blacklist');
          $page->assign('title', 'Blacklist de postfix');
          $table_editor = new PLTableEditor('admin/postfix/blacklist','postfix_blacklist','email', true);
          $table_editor->describe('reject_text','Texte de rejet',true);
          $table_editor->apply($page, $action, $id);
      }
      function handler_postfix_whitelist(&$page, $action = 'list', $id = null) {
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Postfix : Whitelist');
 +        $page->setTitle('Polytechnique.org - Administration - Postfix : Whitelist');
          $page->assign('title', 'Whitelist de postfix');
          $table_editor = new PLTableEditor('admin/postfix/whitelist','postfix_whitelist','email', true);
          $table_editor->describe('email','email',true);
          $table_editor->apply($page, $action, $id);
      }
      function handler_mx_broken(&$page, $action = 'list', $id = null) {
 -        $page->assign('xorg_title', 'Polytechnique.org - Administration - MX Défaillants');
 +        $page->setTitle('Polytechnique.org - Administration - MX Défaillants');
          $page->assign('title', 'MX Défaillant');
          $table_editor = new PLTableEditor('admin/mx/broken', 'mx_watch', 'host', true);
          $table_editor->describe('host', 'Masque', true);
          $table_editor->apply($page, $action, $id);
      }
      function handler_logger_actions(&$page, $action = 'list', $id = null) {
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Actions');
 +        $page->setTitle('Polytechnique.org - Administration - Actions');
          $page->assign('title', 'Gestion des actions de logger');
          $table_editor = new PLTableEditor('admin/logger/actions','logger.actions','id');
          $table_editor->describe('text','intitulé',true);
          $table_editor->apply($page, $action, $id);
      }
      function handler_downtime(&$page, $action = 'list', $id = null) {
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Coupures');
 +        $page->setTitle('Polytechnique.org - Administration - Coupures');
          $page->assign('title', 'Gestion des coupures');
          $table_editor = new PLTableEditor('admin/downtime','coupures','id');
          $table_editor->describe('debut','date',true);
diff --combined modules/axletter.php
@@@ -53,7 -53,7 +53,7 @@@ class AXLetterModule extends PLModul
          require_once dirname(__FILE__) . '/axletter/axletter.inc.php';
  
          $page->changeTpl('axletter/index.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Envois de l\'AX');
 +        $page->setTitle('Polytechnique.org - Envois de l\'AX');
  
          switch ($action) {
            case 'in':  AXLetter::subscribe(); break;
                      global $globals;
                      $mailer = new PlMailer();
                      $mailer->setFrom("support@" . $globals->mail->domain);
-                     $mailer->setSubject("Un nouveau projet dmail de l'AX vient d'être proposé");
-                     $mailer->setTxtBody("Un nouveau mail vient d'être rédigé en prévision d'un envoi prochain. Vous pouvez "
+                     $mailer->setSubject("Un nouveau projet d'email de l'AX vient d'être proposé");
+                     $mailer->setTxtBody("Un nouvel email vient d'être rédigé en prévision d'un envoi prochain. Vous pouvez "
                                        . "le modifier jusqu'à ce qu'il soit verrouillé pour l'envoi\n\n"
-                                       . "Le sujet dmail : $subject\n"
+                                       . "Le sujet de l'email : $subject\n"
                                        . "L'échéance d'envoi est fixée à $echeance.\n"
-                                       . "Lmail pourra néanmoins partir avant cette échéance si un administrateur de "
+                                       . "L'email pourra néanmoins partir avant cette échéance si un administrateur de "
                                        . "Polytechnique.org le valide.\n\n"
-                                       . "Pour modifier, valider ou annuler lmail :\n"
+                                       . "Pour modifier, valider ou annuler l'email :\n"
                                        . "https://www.polytechnique.org/ax/edit\n"
                                        . "-- \n"
                                        . "Association Polytechnique.org\n");
diff --combined modules/carnet.php
@@@ -56,7 -56,7 +56,7 @@@ class CarnetModule extends PLModul
      function handler_index(&$page)
      {
          $page->changeTpl('carnet/index.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Mon carnet');
 +        $page->setTitle('Polytechnique.org - Mon carnet');
          $this->_add_rss_link($page);
      }
  
@@@ -65,8 -65,8 +65,8 @@@
          $page->changeTpl('carnet/panel.tpl');
  
          if (Get::has('read')) {
 -            $_SESSION['watch_last'] = Get::v('read');
 -            update_NbNotifs();
 +            S::set('watch_last', Get::v('read'));
 +            Platal::session()->updateNbNotifs();
              pl_redirect('carnet/panel');
          }
  
      }
  
      function searchErrorHandler($explain) {
 -        global $page;
 +        $page =& Platal::page();
          $page->trigError($explain);
          $this->handler_contacts($page);
      }
  
      function handler_contacts(&$page, $action = null, $subaction = null, $ssaction = null)
      {
 -        $page->assign('xorg_title','Polytechnique.org - Mes contacts');
 +        $page->setTitle('Polytechnique.org - Mes contacts');
          $this->_add_rss_link($page);
  
          $uid  = S::v('uid');
              $base = 'carnet/contacts';
              $view = new UserSet("INNER JOIN contacts AS c2 ON (u.user_id = c2.contact)", " c2.uid = $uid ");
          }
-         $view->addMod('minifiche', 'Mini-Fiches', true);
+         $view->addMod('minifiche', 'Mini-fiches', true);
          $view->addMod('trombi', 'Trombinoscope', false, array('with_admin' => false, 'with_promo' => true));
          $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'carnet/contacts/search'));
          $view->apply($base, $page, $action, $subaction);
          require_once dirname(__FILE__).'/carnet/contacts.pdf.inc.php';
          require_once 'user.func.inc.php';
  
 -        session_write_close();
 +        Platal::session()->close();
  
          $sql = "SELECT  a.alias
                    FROM  aliases       AS a
              if (!$uid) {
                  $uid = S::i('uid');
              } else if ($uid != S::i('uid')) {
 -                require_once 'xorg.misc.inc.php';
                  send_warning_email("Récupération d\'un autre utilisateur ($uid)");
              }
          } else if (!$uid) {
diff --combined modules/email.php
@@@ -47,7 -47,7 +47,7 @@@ class EmailModule extends PLModul
          require_once 'emails.inc.php';
  
          $page->changeTpl('emails/index.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Mes emails');
 +        $page->setTitle('Polytechnique.org - Mes emails');
  
          $uid = S::v('uid');
  
@@@ -98,7 -98,7 +98,7 @@@
          global $globals;
  
          $page->changeTpl('emails/alias.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Alias melix.net');
 +        $page->setTitle('Polytechnique.org - Alias melix.net');
  
          $uid     = S::v('uid');
          $forlife = S::v('forlife');
              $mime = $upload->contentType();
              if ($mime != 'text/x-mail' && $mime != 'message/rfc822') {
                  $upload->clear();
-                 $page->trigError('Le fichier ne contient pas un mail complet');
+                 $page->trigError('Le fichier ne contient pas un email complet');
                  return;
              }
              global $globals;
          $page->changeTpl('emails/send.tpl');
          $page->addJsLink('ajax.js');
  
 -        $page->assign('xorg_title','Polytechnique.org - Envoyer un email');
 +        $page->setTitle('Polytechnique.org - Envoyer un email');
  
          // action si on recoit un formulaire
          if (Post::has('save')) {
                          $mymail->setWikiBody($txt);
                      }
                      if ($mymail->send()) {
-                         $page->trigSuccess("Ton mail a bien été envoyé.");
+                         $page->trigSuccess("Ton email a bien été envoyé.");
                          $_REQUEST = array('bcc' => S::v('bestalias').'@'.$globals->mail->domain);
                          PlUpload::clear(S::v('forlife'), 'emails.send');
                      } else {
                  // envoi du mail
                  $message = "Bonjour !
  
- Ce mail a été généré automatiquement par le service de patte cassée de
+ Cet email a été généré automatiquement par le service de patte cassée de
  Polytechnique.org car un autre utilisateur, ".S::v('prenom').' '.S::v('nom').",
- nous a signalé qu'en t'envoyant un mail, il avait reçu un message d'erreur
+ nous a signalé qu'en t'envoyant un email, il avait reçu un message d'erreur
  indiquant que ton adresse de redirection $email
  ne fonctionnait plus !
  
@@@ -545,7 -545,7 +545,7 @@@ L'équipe d'administration <support@" 
                  $mail->setSubject("Une de tes adresse de redirection Polytechnique.org ne marche plus !!");
                  $mail->setTxtBody($message);
                  $mail->send();
-                 $page->trigSuccess("Mail envoyé !");
+                 $page->trigSuccess("Email envoyé !");
              }
          } elseif (Post::has('email')) {
              S::assert_xsrf_token();
diff --combined modules/lists.php
@@@ -94,7 -94,7 +94,7 @@@ class ListsModule extends PLModul
  
          $page->changeTpl('lists/index.tpl');
          $page->addJsLink('ajax.js');
 -        $page->assign('xorg_title','Polytechnique.org - Listes de diffusion');
 +        $page->setTitle('Polytechnique.org - Listes de diffusion');
  
  
          if (Get::has('del')) {
  
          $page->changeTpl('lists/create.tpl');
  
+         $user_promo  = S::i('promo');
+         $year        = date('Y');
+         $month       = date('m');
+         $young_promo = $very_young_promo = 0;
+         if ((($year > $user_promo) && ($month > 3)) && ($year < $user_promo + 5)) {
+             $young_promo = 1;
+         }
+         if ((($year > $user_promo) && ($month > 7)) && (($year < $user_promo + 1) && ($month < 8))) {
+             $very_young_promo = 1;
+         }
+         $page->assign('young_promo', $young_promo);
+         $page->assign('very_young_promo', $very_young_promo);
          $owners  = preg_split("/[\s]+/", Post::v('owners'), -1, PREG_SPLIT_NO_EMPTY);
          $members = preg_split("/[\s]+/", Post::v('members'), -1, PREG_SPLIT_NO_EMPTY);
  
          $view = new ArraySet($users);
          $view->addMod('trombi', 'Trombinoscope', true, array('with_promo' => true));
          if (empty($GLOBALS['IS_XNET_SITE'])) {
-             $view->addMod('minifiche', 'Minifiches', false);
+             $view->addMod('minifiche', 'Mini-fiches', false);
          }
          $view->addMod('geoloc', 'Planisphère');
          $view->apply("lists/annu/$liste", $page, $action, $subaction);
  
      function handler_admin_all(&$page) {
          $page->changeTpl('lists/admin_all.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Administration - Mailing lists');
 +        $page->setTitle('Polytechnique.org - Administration - Mailing lists');
  
          $client = new MMList(S::v('uid'), S::v('password'));
          $listes = $client->get_all_lists();
diff --combined modules/marketing.php
@@@ -40,7 -40,7 +40,7 @@@ class MarketingModule extends PLModul
      {
          $page->changeTpl('marketing/index.tpl');
  
 -        $page->assign('xorg_title','Polytechnique.org - Marketing');
 +        $page->setTitle('Polytechnique.org - Marketing');
  
          // Quelques statistiques
  
                  $market = new Marketing($uid, Post::v('to'), 'default', null, 'staff');
              }
              $market->send(Post::v('title'), Post::v('message'));
-             $page->trigSuccess("Mail envoyé");
+             $page->trigSuccess("Email envoyé");
          }
  
          if ($action == 'insrel') {
  
              if (Post::has('valide')) {
                  S::assert_xstf_token();
 -
 -                require_once('xorg.misc.inc.php');
                  $email = trim(Post::v('mail'));
  
                  if (!isvalid_email_redirection($email)) {
diff --combined modules/platal.php
@@@ -122,7 -122,7 +122,7 @@@ class PlatalModule extends PLModul
      function handler_prefs(&$page)
      {
          $page->changeTpl('platal/preferences.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Mes préférences');
 +        $page->setTitle('Polytechnique.org - Mes préférences');
  
          if (Post::has('mail_fmt')) {
              $fmt = Post::v('mail_fmt');
      {
          $page->changeTpl('platal/webredirect.tpl');
  
 -        $page->assign('xorg_title','Polytechnique.org - Redirection de page WEB');
 +        $page->setTitle('Polytechnique.org - Redirection de page WEB');
  
          $log =& S::v('log');
          $url = Env::v('url');
              XDB::execute('UPDATE auth_user_quick
                                         SET redirecturl = {?} WHERE user_id = {?}',
                                     $url, S::v('uid'));
 -            $log->log('carva_add', 'http://'.Env::v('url'));
 +            S::logger()->log('carva_add', 'http://'.Env::v('url'));
              $page->trigSuccess("Redirection activée vers <a href='http://$url'>$url</a>");
          } elseif (Env::v('submit') == "Supprimer") {
              XDB::execute("UPDATE auth_user_quick
                                         SET redirecturl = ''
                                       WHERE user_id = {?}",
                                     S::v('uid'));
 -            $log->log("carva_del", $url);
 +            S::logger()->log("carva_del", $url);
              Post::kill('url');
              $page->trigSuccess('Redirection supprimée');
          }
              }
  
              $log =& S::v('log');
 -            $log->log('passwd', '');
 +            S::logger()->log('passwd', '');
  
              if (Cookie::v('ORGaccess')) {
                  setcookie('ORGaccess', hash_encrypt($password), (time()+25920000), '/', '' ,0);
  
          $page->changeTpl('platal/motdepasse.tpl');
          $page->addJsLink('motdepasse.js');
 -        $page->assign('xorg_title','Polytechnique.org - Mon mot de passe');
 +        $page->setTitle('Polytechnique.org - Mon mot de passe');
      }
  
      function handler_smtppass(&$page)
      {
          $page->changeTpl('platal/acces_smtp.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Acces SMTP/NNTP');
 +        $page->setTitle('Polytechnique.org - Acces SMTP/NNTP');
  
          require_once 'wiki.inc.php';
          wiki_require_page('Xorg.SMTPSécurisé');
              XDB::execute('UPDATE auth_user_md5 SET smtppass = {?}
                                       WHERE user_id = {?}', $pass, $uid);
              $page->trigSuccess('Mot de passe enregistré');
 -            $log->log("passwd_ssl");
 +            S::logger()->log("passwd_ssl");
          } elseif (Env::v('op') == "Supprimer") {
              XDB::execute('UPDATE auth_user_md5 SET smtppass = ""
                                       WHERE user_id = {?}', $uid);
              $page->trigSuccess('Compte SMTP et NNTP supprimé');
 -            $log->log("passwd_del");
 +            S::logger()->log("passwd_del");
          }
  
          $res = XDB::query("SELECT IF(smtppass != '', 'actif', '')
@@@ -329,13 -329,13 +329,13 @@@ Si en cliquant dessus tu n'y arrives pa
  Polytechnique.org
  \"Le portail des élèves & anciens élèves de l'Ecole polytechnique\"
  
Mail envoyé à ".Env::v('login') . (Post::has('email') ? "
Email envoyé à ".Env::v('login') . (Post::has('email') ? "
  Adresse de secours : " . Post::v('email') : ""));
              $mymail->send();
  
              // on cree un objet logger et on log l'evenement
 -            $logger = $_SESSION['log'] = new CoreLogger($uid);
 -            $logger->log('recovery', $mails);
 +            $logger = $_SESSION['log'] = new PlLogger($uid);
 +            S::logger()->log('recovery', $mails);
          } else {
              $page->trigError('Les informations que tu as rentrées ne permettent pas de récupérer ton mot de passe.<br />'.
                          'Si tu as un homonyme, utilise prenom.nom.promo comme login');
                  }
              }
  
 -            $logger = new CoreLogger($uid);
 -            $logger->log("passwd","");
 +            $logger = new PlLogger($uid);
 +            S::logger()->log("passwd","");
              $page->changeTpl('platal/tmpPWD.success.tpl');
          } else {
              $page->changeTpl('platal/motdepasse.tpl');
          global $globals;
  
          $page->changeTpl('platal/skins.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Skins');
 +        $page->setTitle('Polytechnique.org - Skins');
  
          if (Env::has('newskin'))  {  // formulaire soumis, traitons les données envoyées
              XDB::execute('UPDATE auth_user_quick
                               SET skin={?} WHERE user_id={?}',
                           Env::i('newskin'), S::v('uid'));
              S::kill('skin');
 -            set_skin();
 +            Platal::session()->setSkin();
          }
  
          $res = XDB::query('SELECT id FROM skins WHERE skin_tpl={?}', S::v('skin'));
              $a4l  = S::v('forlife');
              $suid = S::v('suid');
              $log  = S::v('log');
 -            $log->log("suid_stop", S::v('forlife') . " by " . $suid['forlife']);
 -            $_SESSION = $suid;
 -            S::kill('suid');
 +            S::logger()->log("suid_stop", S::v('forlife') . " by " . $suid['forlife']);
 +            Platal::session()->stopSUID();
              pl_redirect('admin/user/' . $a4l);
          }
  
              setcookie('ORGaccess', '', time() - 3600, '/', '', 0);
              Cookie::kill('ORGaccess');
              if (isset($_SESSION['log']))
 -                $_SESSION['log']->log("cookie_off");
 +                S::logger()->log("cookie_off");
          }
  
          if ($level == 'forgetuid' || $level == 'forgetall') {
  
          if (isset($_SESSION['log'])) {
              $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
 -            $_SESSION['log']->log('deconnexion',$ref);
 +            S::logger()->log('deconnexion',$ref);
          }
 -
 -        XorgSession::destroy();
 +        Platal::session()->destroy();
  
          if (Get::has('redirect')) {
              http_redirect(rawurldecode(Get::v('redirect')));
@@@ -19,6 -19,8 +19,6 @@@
   *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
   ***************************************************************************/
  
 -require_once 'xorg.misc.inc.php';
 -
  // {{{ function user_cmp
  
  function user_cmp($prenom, $nom, $_prenom, $_nom)
@@@ -149,6 -151,7 +149,6 @@@ function create_aliases (&$sub
      global $globals;
      extract ($sub);
  
 -    require_once "xorg.misc.inc.php";
      $mailorg  = make_username($prenom, $nom);
      $mailorg2 = $mailorg.sprintf(".%02u", ($promo%100));
      $forlife  = make_forlife($prenom, $nom, $promo);
                  "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".
+                 "adresses email 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".
diff --combined modules/search.php
@@@ -47,7 -47,9 +47,7 @@@ class SearchModule extends PLModul
  
      function form_prepare()
      {
 -        global $page;
 -
 -        $page->assign('formulaire',1);
 +        Platal::page()->assign('formulaire',1);
      }
  
      function get_diplomas($school = null)
@@@ -70,7 -72,8 +70,7 @@@
              $types = explode('(',$row[1]);
              $types = str_replace("'","",substr($types[1],0,-1));
          }
 -        global $page;
 -        $page->assign('choix_diplomas', explode(',',$types));
 +        Platal::page()->assign('choix_diplomas', explode(',',$types));
      }
  
      function handler_quick(&$page, $action = null, $subaction = null)
@@@ -87,7 -90,7 +87,7 @@@
          if (Env::has('quick') || $action == 'geoloc') {
              $quick = trim(Env::v('quick'));
              if (S::logged() && !Env::has('page')) {
 -                $_SESSION['log']->log('search', 'quick=' . $quick);
 +                S::logger()->log('search', 'quick=' . $quick);
              }
              $list = 'profile|prf|fiche|fic|referent|ref|mentor';
              if (S::has_perms()) {
  
              require_once 'userset.inc.php';
              $view = new SearchSet(true, $action == 'geoloc' && substr($subaction, -3) == 'swf');
-             $view->addMod('minifiche', 'Minifiches', true, array('with_score' => true));
+             $view->addMod('minifiche', 'Mini-fiches', true, array('with_score' => true));
              if (S::logged() && !Env::i('nonins')) {
                  $view->addMod('trombi', 'Trombinoscope', false, array('with_promo' => true, 'with_score' => true));
                  $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'search/adv'));
  
          require_once dirname(__FILE__) . '/search/search.inc.php';
          $page->changeTpl('search/index.tpl');
 -        $page->assign('xorg_title','Polytechnique.org - Annuaire');
 +        $page->setTitle('Polytechnique.org - Annuaire');
      }
  
      function handler_advanced(&$page, $action = null, $subaction = null)
                  'city' => array('table' => 'geoloc_city', 'text' => 'name', 'exact' => false)
              );
              if (!Env::has('page')) {
 -                $_SESSION['log']->log('search', 'adv=' . var_export($_GET, true));
 +                S::logger()->log('search', 'adv=' . var_export($_GET, true));
              }
              foreach ($textFields as $field=>&$query) {
                  if (!Env::v($field) && Env::v($field . 'Txt')) {
  
              require_once 'userset.inc.php';
              $view = new SearchSet(false, $action == 'geoloc' && substr($subaction, -3) == 'swf');
-             $view->addMod('minifiche', 'Minifiches', true);
+             $view->addMod('minifiche', 'Mini-fiches', true);
              $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);
diff --combined modules/xnetgrp.php
@@@ -233,7 -233,7 +233,7 @@@ class XnetGrpModule extends PLModul
          if (Post::has('submit')) {
              S::assert_xsrf_token();
  
 -            $flags = new FlagSet('wiki_desc');
 +            $flags = new PlFlagSet('wiki_desc');
              if (Post::has('notif_unsub') && Post::i('notif_unsub') == 1) {
                  $flags->addFlag('notif_unsub');
              }
              if ($upload) {
                  $upload->rm();
              }
-             $page->kill("Mail envoyé !");
+             $page->kill("Email envoyé !");
              $page->assign('sent', true);
          }
      }
          if (Env::has('right') && (may_update() || S::has('suid'))) {
              switch (Env::v('right')) {
                case 'admin':
 -                XnetSession::killSuid();
 +                Platal::session()->stopSUID();
                  break;
                case 'anim':
 -                XnetSession::doSelfSuid();
 +                Platal::session()->doSelfSuid();
                  may_update(true);
                  is_member(true);
                  break;
                case 'member':
 -                XnetSession::doSelfSuid();
 +                Platal::session()->doSelfSuid();
                  may_update(false, true);
                  is_member(true);
                  break;
                case 'logged':
 -                XnetSession::doSelfSuid();
 +                Platal::session()->doSelfSuid();
                  may_update(false, true);
                  is_member(false, true);
                  break;
              }
          }
 +//        var_dump($_SESSION);
          http_redirect($_SERVER['HTTP_REFERER']);
      }
  
                  $page->trigError($email." n'est pas un alias polytechnique.org valide.");
              }
          } else {
 -            require_once 'xorg.misc.inc.php';
              if (isvalid_email($email)) {
                  if (Env::v('x') && Env::has('userid') && Env::i('userid')) {
                      $uid = Env::i('userid');
                      pl_redirect("member/$email");
                  }
              } else {
-                 $page->trigError("« <strong>$email</strong> » n'est pas une adresse mail valide.");
+                 $page->trigError("« <strong>$email</strong> » n'est pas une adresse email valide.");
              }
          }
      }
  
      function unsubscribe(&$user)
      {
 -        global $globals, $page;
 +        global $globals;
          XDB::execute(
                  "DELETE FROM  groupex.membres WHERE uid={?} AND asso_id={?}",
                  $user['uid'], $globals->asso('id'));
                      $mmlist->unsubscribe($liste['list']);
                  }
              } elseif ($liste['sub']) {
 -                $page->trigWarning("{$user['prenom']} {$user['nom']} a une"
 -                                  ." demande d'inscription en cours sur la"
 -                                  ." liste {$liste['list']}@ !");
 +                Platal::page()->trigWarning("{$user['prenom']} {$user['nom']} a une"
 +                                           ." demande d'inscription en cours sur la"
 +                                           ." liste {$liste['list']}@ !");
                  $warning = true;
              }
          }
          if ($this->unsubscribe($user)) {
              $page->trigSuccess('Vous avez été désinscrit du groupe avec succès.');
          } else {
-             $page->trigWarning('Vous avez été désinscrit du groupe, mais des erreurs se sont produites lors des désinscriptions des alias et des mailing-lists.');
+             $page->trigWarning('Vous avez été désinscrit du groupe, mais des erreurs se sont produites lors des désinscriptions des alias et des listes de diffusion.');
          }
          $page->assign('is_member', is_member(true));
      }
          }
      }
  
 -    private function changeLogin(PlatalPage &$page, array &$user, MMList &$mmlist, $login)
 +    private function changeLogin(PlPage &$page, array &$user, MMList &$mmlist, $login)
      {
          require_once 'user.func.inc.php';
          // Search the uid of the user...
          $page->assign('rss', $rss);
      }
  
 -    private function upload_image(PlatalPage &$page, PlUpload &$upload)
 +    private function upload_image(PlPage &$page, PlUpload &$upload)
      {
          if (@!$_FILES['image']['tmp_name'] && !Env::v('image_url')) {
              return true;
          if (Post::v('valid') == 'Enregistrer') {
              $promo_min = ($art['public'] ? 0 : $art['promo_min']);
              $promo_max = ($art['public'] ? 0 : $art['promo_max']);
 -            $flags = new FlagSet();
 +            $flags = new PlFlagSet();
              if ($art['public']) {
                  $flags->addFlag('public');
              }