Try to define an exhaustive list of tables to copy.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 20 Feb 2010 21:27:13 +0000 (22:27 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 20 Feb 2010 21:27:13 +0000 (22:27 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
18 files changed:
bin/cron/checkdb.php
bin/cron/emails.check.php
bin/cron/homonymes.php
include/security.inc.php
include/validations/evts.inc.php
include/validations/homonymes.inc.php
include/validations/surveys.inc.php
modules/admin.php
modules/email.php
modules/events.php
modules/events/feed.inc.php
modules/gadgets.php
modules/platal.php
modules/register.php
modules/register/register.inc.php
modules/stats.php
modules/survey/survey.inc.php
upgrade/account/copy_tables.php

index ac039dd..ede680b 100755 (executable)
@@ -150,7 +150,7 @@ check("SELECT  a1.alias, a2.alias, e1.email, e2.flags
         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')
+        INNER JOIN  email_watch  AS w  ON(w.email = e1.email AND w.state = 'pending')
         INNER JOIN  aliases       AS a1 ON(a1.id=e1.uid AND a1.type='a_vie')
         INNER JOIN  aliases       AS a2 ON(a2.id=e2.uid AND a2.type='a_vie')
         INNER JOIN  auth_user_md5 AS u1 ON(a1.id=u1.user_id)
@@ -165,7 +165,7 @@ info("SELECT  a1.alias, a2.alias, e1.email, e2.flags, w.state
         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')
+        INNER JOIN  email_watch  AS w  ON(w.email = e1.email AND w.state != 'safe')
         INNER JOIN  aliases       AS a1 ON(a1.id=e1.uid AND a1.type='a_vie')
         INNER JOIN  aliases       AS a2 ON(a2.id=e2.uid AND a2.type='a_vie')
         INNER JOIN  auth_user_md5 AS u1 ON(a1.id=u1.user_id)
index 2f52f37..3febc77 100755 (executable)
@@ -51,7 +51,7 @@ $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
                                        AND (e1.uid < e2.uid OR NOT FIND_IN_SET('active', e2.flags)))
-     LEFT JOIN  emails_watch  AS w  ON (e1.email = w.email)
+     LEFT JOIN  email_watch  AS w  ON (e1.email = w.email)
     INNER JOIN  aliases       AS a1 ON (a1.id = e1.uid AND a1.type = 'a_vie')
     INNER JOIN  aliases       AS a2 ON (a2.id = e2.uid AND a2.type = 'a_vie')
     INNER JOIN  auth_user_md5 AS u1 ON (a1.id = u1.user_id)
@@ -74,7 +74,7 @@ if (count($conflits) > 0) {
         . "https://www.polytechnique.org/admin/emails/duplicated";
 
     echo "\n\n";
-    $sql = "INSERT IGNORE INTO  emails_watch (email, state, detection, last)
+    $sql = "INSERT IGNORE INTO  email_watch (email, state, detection, last)
                         VALUES  " . join(", ", $insert);
     XDB::execute($sql);
     if (XDB::errno() != 0) {
index 3a3b589..cbeee19 100755 (executable)
@@ -35,7 +35,7 @@ $resRobot = XDB::iterator(
 while ($old = $resRobot->next()) {
     $res = XDB::query(
             "SELECT  u.hruid
-               FROM  homonymes AS h
+               FROM  homonyms AS h
          INNER JOIN  auth_user_md5 AS u USING (user_id)
               WHERE  homonyme_id = {?}",
             $old['id']);
index c909f2d..3def558 100644 (file)
@@ -67,7 +67,7 @@ function check_ip($level)
 function check_email($email, $message)
 {
     $res = XDB::query("SELECT state, description
-        FROM emails_watch
+        FROM email_watch
         WHERE state != 'safe' AND email = {?}", $email);
     if ($res->numRows()) {
         send_warning_mail($message);
index 3a7fcb5..c269587 100644 (file)
@@ -134,14 +134,14 @@ class EvtReq extends Validate
 
     public function commit()
     {
-        if (XDB::execute("INSERT INTO  evenements
+        if (XDB::execute("INSERT INTO  announces
                          SET  user_id = {?}, creation_date=NOW(), titre={?}, texte={?},
                               peremption={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')",
                 $this->user->id(), $this->titre, $this->texte,
                 $this->peremption, $this->pmin, $this->pmax)) {
             $eid = XDB::insertId();
             if ($this->img) {
-                XDB::execute("INSERT INTO evenements_photo
+                XDB::execute("INSERT INTO announce_photos
                                       SET eid = {?}, attachmime = {?}, x = {?}, y = {?}, attach = {?}",
                              XDB::insertId(), $this->imgtype, $this->imgx, $this->imgy, $this->img);
             }
@@ -153,7 +153,7 @@ class EvtReq extends Validate
                                       $globals->banana->event_reply,
                                       $this->titre, MiniWiki::wikiToText($this->texte, false, 0, 80));
                 if ($post != -1) {
-                    XDB::execute("UPDATE  evenements
+                    XDB::execute("UPDATE  announces
                                      SET  creation_date = creation_date, post_id = {?}
                                    WHERE  id = {?}", $post, $eid);
                 }
index f483bb6..57fdbac 100644 (file)
@@ -125,7 +125,7 @@ est ambigu pour des raisons d'homonymie et signalera ton email exact.";
         switch_bestalias($this->user, $this->loginbis);
         if (!$this->warning) {
             XDB::execute("UPDATE aliases SET type = 'homonyme', expire = NOW() WHERE alias = {?}", $this->loginbis);
-            XDB::execute("REPLACE INTO homonymes (homonyme_id, user_id) VALUES({?}, {?})", $this->user->id(), $this->user->id());
+            XDB::execute("REPLACE INTO homonyms (homonyme_id, user_id) VALUES({?}, {?})", $this->user->id(), $this->user->id());
         }
 
         return true;
index a070173..bf03ad9 100644 (file)
@@ -91,7 +91,7 @@ class SurveyReq extends Validate
 
     public function commit()
     {
-        $sql = 'INSERT INTO survey_surveys
+        $sql = 'INSERT INTO surveys
                         SET questions={?},
                             title={?},
                             description={?},
index 509a15e..89a81d3 100644 (file)
@@ -843,7 +843,7 @@ class AdminModule extends PLModule
                     XDB::execute("UPDATE  aliases
                                      SET  type = 'homonyme', expire=NOW()
                                    WHERE  alias = {?}", $loginbis);
-                    XDB::execute("REPLACE INTO  homonymes (homonyme_id,user_id)
+                    XDB::execute("REPLACE INTO  homonyms (homonyme_id,user_id)
                                         VALUES  ({?}, {?})", $target, $target);
                     send_robot_homonyme($user, $loginbis);
                     $op = 'list';
@@ -859,7 +859,7 @@ class AdminModule extends PLModule
                              IF(h.homonyme_id = s.id, a.type, NULL) AS type,
                              ac.uid AS user_id
                        FROM  aliases       AS a
-                  LEFT JOIN  homonymes     AS h ON (h.homonyme_id = a.id)
+                  LEFT JOIN  homonym     AS h ON (h.homonyme_id = a.id)
                  INNER JOIN  aliases       AS s ON (s.id = h.user_id AND s.type='a_vie')
                  INNER JOIN  accounts      AS ac ON (ac.uid = a.id)
                       WHERE  a.type = 'homonyme' OR a.expire != ''
@@ -1059,7 +1059,7 @@ class AdminModule extends PLModule
     {
         $page->setTitle('Administration - Coupures');
         $page->assign('title', 'Gestion des coupures');
-        $table_editor = new PLTableEditor('admin/downtime','coupures','id');
+        $table_editor = new PLTableEditor('admin/downtime','downtimes','id');
         $table_editor->describe('debut','date',true);
         $table_editor->describe('duree','durée',false);
         $table_editor->describe('resume','résumé',true);
index 82bedd8..5347cd3 100644 (file)
@@ -87,7 +87,7 @@ class EmailModule extends PLModule
         $homonyme = XDB::query(
                 "SELECT  alias
                    FROM  aliases
-             INNER JOIN  homonymes ON (id = homonyme_id)
+             INNER JOIN  homonyms ON (id = homonyme_id)
                   WHERE  user_id = {?} AND type = 'homonyme'", $user->id());
         $page->assign('homonyme', $homonyme->fetchOneCell());
 
@@ -706,21 +706,21 @@ class EmailModule extends PLModule
         switch (Post::v('action')) {
           case 'create':
             if (trim(Post::v('emailN')) != '') {
-                Xdb::execute('INSERT IGNORE INTO emails_watch (email, state, detection, last, uid, description)
+                Xdb::execute('INSERT IGNORE INTO email_watch (email, state, detection, last, uid, description)
                                           VALUES ({?}, {?}, CURDATE(), NOW(), {?}, {?})',
                              trim(Post::v('emailN')), Post::v('stateN'), S::i('uid'), Post::v('descriptionN'));
             };
             break;
 
           case 'edit':
-            Xdb::execute('UPDATE emails_watch
+            Xdb::execute('UPDATE email_watch
                              SET state = {?}, last = NOW(), uid = {?}, description = {?}
                            WHERE email = {?}', Post::v('stateN'), S::i('uid'), Post::v('descriptionN'), Post::v('emailN'));
             break;
 
           default:
             if ($action == 'delete' && !is_null($email)) {
-                Xdb::execute('DELETE FROM emails_watch WHERE email = {?}', $email);
+                Xdb::execute('DELETE FROM email_watch WHERE email = {?}', $email);
             }
         }
         if ($action != 'create' && $action != 'edit') {
@@ -730,7 +730,7 @@ class EmailModule extends PLModule
 
         if ($action == 'list') {
             $sql = "SELECT  w.email, w.detection, w.state, a.alias AS forlife
-                      FROM  emails_watch  AS w
+                      FROM  email_watch  AS w
                  LEFT JOIN  emails        AS e USING(email)
                  LEFT JOIN  aliases       AS a ON (a.id = e.uid AND a.type = 'a_vie')
                   ORDER BY  w.state, w.email, a.alias";
@@ -758,7 +758,7 @@ class EmailModule extends PLModule
         } elseif ($action == 'edit') {
             $sql = "SELECT  w.detection, w.state, w.last, w.description,
                             a1.alias AS edit, a2.alias AS forlife
-                      FROM  emails_watch AS w
+                      FROM  email_watch AS w
                  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')
index 985499d..a9dc2d5 100644 (file)
@@ -132,17 +132,17 @@ class EventsModule extends PLModule
         // Hide the read event, and reload the page to get to the next event.
         if ($action == 'read' && $eid) {
             XDB::execute('DELETE ev.*
-                            FROM evenements_vus AS ev
-                      INNER JOIN evenements AS e ON e.id = ev.evt_id
+                            FROM announce_read AS ev
+                      INNER JOIN announces AS e ON e.id = ev.evt_id
                            WHERE peremption < NOW()');
-            XDB::execute('REPLACE INTO evenements_vus VALUES({?},{?})',
+            XDB::execute('REPLACE INTO announce_read VALUES({?},{?})',
                 $eid, S::v('uid'));
             pl_redirect('events#'.$pound);
         }
 
         // Unhide the requested event, and reload the page to display it.
         if ($action == 'unread' && $eid) {
-            XDB::execute('DELETE FROM evenements_vus
+            XDB::execute('DELETE FROM announce_read
                            WHERE evt_id = {?} AND user_id = {?}',
                                    $eid, S::v('uid'));
             pl_redirect('events#newsid'.$eid);
@@ -156,9 +156,9 @@ class EventsModule extends PLModule
                                      e.creation_date > DATE_SUB(CURDATE(), INTERVAL 2 DAY) AS news,
                                      e.peremption < DATE_ADD(CURDATE(), INTERVAL 2 DAY) AS end,
                                      ev.user_id IS NULL AS nonlu, e.promo_min, e.promo_max
-                               FROM  evenements       AS e
-                          LEFT JOIN  evenements_photo AS p  ON (e.id = p.eid)
-                          LEFT JOIN  evenements_vus   AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
+                               FROM  announces       AS e
+                          LEFT JOIN  announce_photos AS p  ON (e.id = p.eid)
+                          LEFT JOIN  announce_read   AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
                               WHERE  FIND_IN_SET('valide', e.flags) AND peremption >= NOW()
                            ORDER BY  important DESC, news DESC, end DESC, e.peremption, e.creation_date DESC",
                             S::i('uid'));
@@ -191,7 +191,7 @@ class EventsModule extends PLModule
     function handler_photo(&$page, $eid = null, $valid = null)
     {
         if ($eid && $eid != 'valid') {
-            $res = XDB::query("SELECT * FROM evenements_photo WHERE eid = {?}", $eid);
+            $res = XDB::query("SELECT * FROM announce_photos WHERE eid = {?}", $eid);
             if ($res->numRows()) {
                 $photo = $res->fetchOneAssoc();
                 pl_cached_dynamic_content_headers("image/" . $photo['attachmime']);
@@ -341,7 +341,7 @@ class EventsModule extends PLModule
         if (Post::v('action') == 'Pas d\'image' && $eid) {
             S::assert_xsrf_token();
             $upload->rm();
-            XDB::execute("DELETE FROM evenements_photo WHERE eid = {?}", $eid);
+            XDB::execute("DELETE FROM announce_photos WHERE eid = {?}", $eid);
             $action = 'edit';
         } elseif (Post::v('action') == 'Supprimer l\'image' && $eid) {
             S::assert_xsrf_token();
@@ -357,7 +357,7 @@ class EventsModule extends PLModule
                 $page->trigError("L'intervalle de promotions $promo_min -> $promo_max n'est pas valide");
                 $action = 'edit';
             } else {
-                $res = XDB::query('SELECT flags FROM evenements WHERE id = {?}', $eid);
+                $res = XDB::query('SELECT flags FROM announces WHERE id = {?}', $eid);
                 $flags = new PlFlagSet($res->fetchOneCell());
                 $flags->addFlag('wiki');
                 if (Post::v('important')) {
@@ -366,7 +366,7 @@ class EventsModule extends PLModule
                     $flags->rmFlag('important');
                 }
 
-                XDB::execute('UPDATE evenements
+                XDB::execute('UPDATE announces
                                  SET creation_date = creation_date,
                                      titre={?}, texte={?}, peremption={?}, promo_min={?}, promo_max={?},
                                      flags = {?}
@@ -375,7 +375,7 @@ class EventsModule extends PLModule
                               Post::v('promo_min'), Post::v('promo_max'),
                               $flags, $eid);
                 if ($upload->exists() && list($x, $y, $type) = $upload->imageInfo()) {
-                    XDB::execute('REPLACE INTO  evenements_photo
+                    XDB::execute('REPLACE INTO  announce_photos
                                            SET  eid = {?}, attachmime = {?}, x = {?}, y = {?}, attach = {?}',
                                  $eid, $type, $x, $y, $upload->getContents());
                     $upload->rm();
@@ -386,8 +386,8 @@ class EventsModule extends PLModule
         if ($action == 'edit') {
             $res = XDB::query('SELECT titre, texte, peremption, promo_min, promo_max, FIND_IN_SET(\'important\', flags),
                                       attach IS NOT NULL
-                                 FROM evenements       AS e
-                            LEFT JOIN evenements_photo AS p ON(e.id = p.eid)
+                                 FROM announces       AS e
+                            LEFT JOIN announce_photos AS p ON(e.id = p.eid)
                                 WHERE id={?}', $eid);
             list($titre, $texte, $peremption, $promo_min, $promo_max, $important, $img) = $res->fetchOneRow();
             $page->assign('titre',$titre);
@@ -416,20 +416,20 @@ class EventsModule extends PLModule
             switch ($action) {
                 case 'delete':
                     S::assert_xsrf_token();
-                    XDB::execute('DELETE from evenements
+                    XDB::execute('DELETE from announces
                                    WHERE id = {?}', $eid);
                     break;
 
                 case "archive":
                     S::assert_xsrf_token();
-                    XDB::execute('UPDATE evenements
+                    XDB::execute('UPDATE announces
                                      SET creation_date = creation_date, flags = CONCAT(flags,",archive")
                                    WHERE id = {?}', $eid);
                     break;
 
                 case "unarchive":
                     S::assert_xsrf_token();
-                    XDB::execute('UPDATE evenements
+                    XDB::execute('UPDATE announces
                                      SET creation_date = creation_date, flags = REPLACE(flags,"archive","")
                                    WHERE id = {?}', $eid);
                     $action = 'archives';
@@ -438,14 +438,14 @@ class EventsModule extends PLModule
 
                 case "valid":
                     S::assert_xsrf_token();
-                    XDB::execute('UPDATE evenements
+                    XDB::execute('UPDATE announces
                                      SET creation_date = creation_date, flags = CONCAT(flags,",valide")
                                    WHERE id = {?}', $eid);
                     break;
 
                 case "unvalid":
                     S::assert_xsrf_token();
-                    XDB::execute('UPDATE evenements
+                    XDB::execute('UPDATE announces
                                      SET creation_date = creation_date, flags = REPLACE(flags,"valide", "")
                                    WHERE id = {?}', $eid);
                     break;
@@ -459,7 +459,7 @@ class EventsModule extends PLModule
                             FIND_IN_SET('valide', e.flags) AS fvalide,
                             FIND_IN_SET('archive', e.flags) AS farch,
                             FIND_IN_SET('wiki', e.flags) AS wiki
-                      FROM  evenements    AS e
+                      FROM  announces    AS e
                      WHERE  ".($arch ? "" : "!")."FIND_IN_SET('archive',e.flags)
                   ORDER BY  FIND_IN_SET('valide',e.flags), e.peremption DESC";
             $page->assign('evs', XDB::iterator($sql));
index 46de904..2d9b966 100644 (file)
@@ -48,8 +48,8 @@ class EventFeed extends PlFeed
         $events = XDB::iterator('SELECT  e.id, e.titre AS title, e.texte, e.creation_date AS publication, e.post_id,
                                          p.attachmime IS NOT NULL AS photo, FIND_IN_SET(\'wiki\', e.flags) AS wiki,
                                          e.user_id, e.promo_min, e.promo_max
-                                   FROM  evenements       AS e
-                              LEFT JOIN  evenements_photo AS p ON (p.eid = e.id)
+                                   FROM  announces       AS e
+                              LEFT JOIN  announce_photos AS p ON (p.eid = e.id)
                                   WHERE  FIND_IN_SET("valide", e.flags) AND peremption >= NOW()');
         $data = array();
         while ($e = self::nextEvent($events, $user)) {
index 95a20b7..40651cd 100644 (file)
@@ -46,8 +46,8 @@ class GadgetsModule extends PLModule
                                          e.id, e.titre, UNIX_TIMESTAMP(e.creation_date) AS creation_date,
                                          IF(u.nom_usage = "", u.nom, u.nom_usage) AS nom, u.prenom, u.promo,
                                          ev.user_id IS NULL AS nonlu, e.user_id
-                                   FROM  evenements AS e
-                              LEFT JOIN  evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
+                                   FROM  announces AS e
+                              LEFT JOIN  announce_read AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
                                   WHERE  FIND_IN_SET("valide", e.flags) AND peremption >= NOW()
                                ORDER BY  e.creation_date DESC', S::i('uid'));
         $page->assign('event_count', XDB::query("SELECT FOUND_ROWS()")->fetchOneCell());
index 32258b9..2c9596d 100644 (file)
@@ -318,7 +318,7 @@ class PlatalModule extends PLModule
         $page->assign('ok', true);
 
         $url   = rand_url_id();
-        XDB::execute('INSERT INTO  perte_pass (certificat,uid,created)
+        XDB::execute('INSERT INTO  account_lost_passwords (certificat,uid,created)
                            VALUES  ({?},{?},NOW())', $url, $user->id());
         $res   = XDB::query('SELECT  email
                                FROM  emails
@@ -357,11 +357,11 @@ Adresse de secours : " . Post::v('email') : ""));
     {
         global $globals;
         // XXX: recovery requires data from the profile
-        XDB::execute('DELETE FROM  perte_pass
+        XDB::execute('DELETE FROM  account_lost_passwords
                             WHERE  DATE_SUB(NOW(), INTERVAL 380 MINUTE) > created');
 
         $res = XDB::query('SELECT  uid
-                             FROM  perte_pass WHERE certificat={?}', $certif);
+                             FROM  account_lost_passwords WHERE certificat={?}', $certif);
         $ligne = $res->fetchOneAssoc();
         if (!$ligne) {
             $page->changeTpl('platal/index.tpl');
@@ -375,7 +375,7 @@ Adresse de secours : " . Post::v('email') : ""));
                            SET  password={?}
                          WHERE  uid = {?} AND state = \'active\'',
                        $password, $uid);
-            XDB::query('DELETE FROM  perte_pass
+            XDB::query('DELETE FROM  account_lost_passwords
                               WHERE  certificat={?}', $certif);
 
             // If GoogleApps is enabled, and the user did choose to use synchronized passwords,
index 73c9fa7..1203b94 100644 (file)
@@ -173,7 +173,7 @@ class RegisterModule extends PLModule
 
                     // Check if the given email is known as dangerous.
                     $res = XDB::query("SELECT  w.state, w.description
-                                         FROM  emails_watch AS w
+                                         FROM  email_watch AS w
                                         WHERE  w.email = {?} AND w.state != 'safe'",
                                         Post::v('email'));
                     $email_banned = false;
index 5cb8bfa..0763057 100644 (file)
@@ -172,8 +172,8 @@ function create_aliases (&$sub)
         list($h_id, $h_type, $expire) = $res->fetchOneRow();
         if ($h_type != 'homonyme' and empty($expire)) {
             XDB::execute('UPDATE aliases SET expire=ADDDATE(NOW(),INTERVAL 1 MONTH) WHERE alias={?}', $mailorg);
-            XDB::execute('REPLACE INTO homonymes (homonyme_id,user_id) VALUES ({?},{?})', $h_id, $h_id);
-            XDB::execute('REPLACE INTO homonymes (homonyme_id,user_id) VALUES ({?},{?})', $h_id, $uid);
+            XDB::execute('REPLACE INTO homonyms (homonyme_id,user_id) VALUES ({?},{?})', $h_id, $h_id);
+            XDB::execute('REPLACE INTO homonyms (homonyme_id,user_id) VALUES ({?},{?})', $h_id, $uid);
             $res = XDB::query("SELECT alias FROM aliases WHERE id={?} AND expire IS NULL", $h_id);
             $als = $res->fetchColumn();
 
index 7c95ca8..12152a0 100644 (file)
@@ -281,7 +281,7 @@ EOF2;
             $res = XDB::query("SELECT  debut,
                                        TIME_FORMAT(duree,'%kh%i') AS duree,
                                        resume, description, services
-                                 FROM  coupures
+                                 FROM  downtimes
                                 WHERE  id = {?}", $cp_id);
             $cp  = $res->fetchOneAssoc();
         }
@@ -292,7 +292,7 @@ EOF2;
         } else {
             $beginning_date = date("Ymd", time() - 3600*24*21) . "000000";
             $sql = "SELECT  id, debut, resume, services
-                      FROM  coupures where debut > '$beginning_date' order by debut desc";
+                      FROM  downtimes where debut > '$beginning_date' order by debut desc";
             $page->assign('coupures', XDB::iterator($sql));
             $res = XDB::iterator("SELECT  host, text
                                     FROM  mx_watch
index 91f0505..5c6a109 100644 (file)
@@ -341,7 +341,7 @@ class Survey
             return null;
         }
         $sql = 'SELECT id, title, end, mode
-                  FROM survey_surveys
+                  FROM surveys
                  WHERE '.$where.'
               ORDER BY end DESC;';
         if ($tpl) {
@@ -356,7 +356,7 @@ class Survey
     public static function retrieveSurvey($sid)
     {
         $sql = 'SELECT questions, title, description, end, mode, promos
-                  FROM survey_surveys
+                  FROM surveys
                  WHERE id={?}';
         $res = XDB::query($sql, $sid);
         $data = $res->fetchOneAssoc();
@@ -372,7 +372,7 @@ class Survey
     public static function retrieveSurveyInfo($sid)
     {
         $sql = 'SELECT title, description, end, mode, promos
-                  FROM survey_surveys
+                  FROM surveys
                  WHERE id={?}';
         $res = XDB::query($sql, $sid);
         return $res->fetchOneAssoc();
@@ -410,7 +410,7 @@ class Survey
     public function updateSurvey()
     {
         if ($this->valid) {
-            $sql = 'UPDATE survey_surveys
+            $sql = 'UPDATE surveys
                        SET questions={?},
                            title={?},
                            description={?},
@@ -462,7 +462,7 @@ class Survey
     public static function deleteSurvey($sid)
     {
         $sql = 'DELETE s.*, v.*, a.*
-                  FROM survey_surveys AS s
+                  FROM surveys AS s
              LEFT JOIN survey_votes AS v
                     ON v.survey_id=s.id
              LEFT JOIN survey_answers AS a
index a7c57f5..143ebff 100755 (executable)
@@ -59,14 +59,75 @@ copyTable('#groupex#.membres', 'group_members');
 copyTable('#groupex#.membres_sub_requests', 'group_member_sub_requests');
 copyTable('#x4dat#.groupesx_auth'), 'group_auth');
 
+copyTable('#x4dat#.axletter', 'axletter');
+copyTable('#x4dat#.axletter_ins', 'axletter_ins');
+copyTable('#x4dat#.axletter_rights', 'axletter_rights');
+
+copyTable('#x4dat#.newsletter', 'newsletter');
+copyTable('#x4dat#.newsletter_art', 'newsletter_art');
+copyTable('#x4dat#.newsletter_cat', 'newsletter_cat');
+copyTable('#x4dat#.newsletter_ins', 'newsletter_ins');
+
+copyTable('#x4dat#.openid_trusted', 'openid_trusted');
+
+copyTable('#x4dat#.evenements', 'announces');
+copyTable('#x4dat#.evenements_photo', 'announce_photos');
+copyTable('#x4dat#.evenements_vus', 'announce_read');
+
+copyTable('#x4dat#.gapps_accounts', 'gapps_accounts');
+copyTable('#x4dat#.gapps_nicknames', 'gapps_nicknames');
+copyTable('#x4dat#.gapps_queue', 'gapps_queue');
+copyTable('#x4dat#.gapps_reporting', 'gapps_reporting');
+
+copyTable('#x4dat#.contacts', 'contacts');
+copyTable('#x4dat#.coupures', 'downtimes');
+copyTable('#x4dat#.emails_watch', 'email_watch');
+copyTable('#x4dat#.homonymes', 'homonyms');
+copyTable('#x4dat#.ip_watch', 'ip_watch');
+copyTable('#x4dat#.mx_watch', 'mx_watch');
+copyTable('#x4dat#.ml_moderate', 'ml_moderate');
+
+copyTable('#x4dat#.postfix_blacklist', 'postfix_blacklist');
+copyTable('#x4dat#.postfix_mailseen', 'postfix_mailseen');
+copyTable('#x4dat#.postfix_whitelist', 'postfix_whitelist');
+
 copyTable('#x4dat#.photo', 'profile_photos');
 
-copyTable('#x4dat#.search_autocomplete', 'search_autocomplete');
 copyTable('#x4dat#.register_marketing', 'register_marketing');
+copyTable('#x4dat#.register_pending', 'register_pending');
+copyTable('#x4dat#.register_subs', 'register_subs');
+copyTable('#x4dat#.register_mstats', 'register_mstats');
+
+copyTable('#x4dat#.reminder', 'reminder');
+copyTable('#x4dat#.reminder_type', 'reminder_type');
+
+copyTable('#x4dat#.requests', 'requests');
+copyTable('#x4dat#.requests_answers', 'requests_answers');
+copyTable('#x4dat#.requests_hidden', 'requests_hidden');
+
+copyTable('#x4dat#.search_autocomplete', 'search_autocomplete');
+copyTable('#x4dat#.search_name', 'search_name');
+
+copyTable('#x4dat#.skins', 'skins');
+copyTable('#x4dat#.tips', 'tips');
+
+copyTable('#x4dat#.survey_surveys', 'surveys');
+copyTable('#x4dat#.survey_anwsers', 'survey_anwsers');
+copyTable('#x4dat#.survey_votes', 'survey_votes');
+
 copyTable('#x4dat#.watch_profile', 'watch_profile');
+copyTable('#x4dat#.perte_pass', 'account_lost_passwords');
 
-// Should be renamed to geoloc_country
 copyTable('#x4dat#.geoloc_pays', 'geoloc_pays');
 
+copyTable('#x4dat#.aliases', 'aliases');
+copyTable('#x4dat#.virtual', 'virtual');
+copyTable('#x4dat#.virtual_domains', 'virtual_domains');
+copyTable('#x4dat#.virtual_redirect', 'virtual_redirect');
+
+copyTable('#x4dat#.watch_nonins', 'watch_nonins');
+copyTable('#x4dat#.watch_promo', 'watch_promo');
+copyTable('#x4dat#.watch_profile', 'watch_profile');
+
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>