X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Flists.php;h=c68657329b5f348b841b785d96fa89ddd1b50cc3;hb=a3a049fc80d3707bcc76903ab89f73974c470c0c;hp=2f74ea62a1309ef49dc1a95d7492efc0fe28e62c;hpb=7b9d64a8152f719caae96f7088d00834e918d170;p=platal.git diff --git a/modules/lists.php b/modules/lists.php index 2f74ea6..c686573 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -52,8 +52,6 @@ class ListsModule extends PLModule function handler_lists(&$page) { - global $globals; - $this->prepare_client($page); $page->changeTpl('listes/index.tpl'); @@ -82,7 +80,6 @@ class ListsModule extends PLModule function handler_create(&$page) { - global $globals; $page->changeTpl('listes/create.tpl'); $owners = preg_split("/[\s]+/", Post::get('owners'), -1, PREG_SPLIT_NO_EMPTY); @@ -133,7 +130,7 @@ class ListsModule extends PLModule $page->trig('le nom de la liste ne doit contenir que des lettres, chiffres et tirets'); } - $res = $globals->xdb->query("SELECT COUNT(*) FROM aliases WHERE alias={?}", $liste); + $res = XDB::query("SELECT COUNT(*) FROM aliases WHERE alias={?}", $liste); $n = $res->fetchOneCell(); if ($n) { @@ -165,8 +162,6 @@ class ListsModule extends PLModule function handler_members(&$page, $liste = null) { - global $globals; - if (is_null($liste)) { return PL_NOT_FOUND; } @@ -204,13 +199,13 @@ class ListsModule extends PLModule function _get_list($offset, $limit) { - global $globals, $platal; + global $platal; list($total, $members) = $this->client->get_members_limit($platal->argv[1], $offset, $limit); $membres = Array(); foreach ($members as $member) { list($m) = explode('@',$member[1]); - $res = $globals->xdb->query("SELECT prenom,if (nom_usage='', nom, nom_usage) AS nom, + $res = XDB::query("SELECT prenom,if (nom_usage='', nom, nom_usage) AS nom, promo, a.alias AS forlife FROM auth_user_md5 AS u INNER JOIN aliases AS a ON u.user_id = a.id @@ -226,8 +221,6 @@ class ListsModule extends PLModule function handler_trombi(&$page, $liste = null) { - global $globals; - if (is_null($liste)) { return PL_NOT_FOUND; } @@ -307,8 +300,6 @@ class ListsModule extends PLModule function handler_moderate(&$page, $liste = null) { - global $globals; - if (is_null($liste)) { return PL_NOT_FOUND; } @@ -488,8 +479,6 @@ class ListsModule extends PLModule function handler_options(&$page, $liste = null) { - global $globals; - if (is_null($liste)) { return PL_NOT_FOUND; } @@ -541,8 +530,6 @@ class ListsModule extends PLModule function handler_delete(&$page, $liste = null) { - global $globals; - if (is_null($liste)) { return PL_NOT_FOUND; } @@ -555,9 +542,9 @@ class ListsModule extends PLModule && $this->client->delete_list($liste, Post::getBool('del_archive'))) { foreach (array('', '-owner', '-admin', '-bounces') as $app) { - $globals->xdb->execute("DELETE FROM aliases + XDB::execute("DELETE FROM aliases WHERE type='liste' AND alias='{?}'", - $ml.$app); + $liste.$app); } $page->assign('deleted', true); } elseif (list($details,$options) = $this->client->get_owner_options($liste)) { @@ -571,8 +558,6 @@ class ListsModule extends PLModule function handler_soptions(&$page, $liste = null) { - global $globals; - if (is_null($liste)) { return PL_NOT_FOUND; } @@ -599,8 +584,6 @@ class ListsModule extends PLModule function handler_check(&$page, $liste = null) { - global $globals; - if (is_null($liste)) { return PL_NOT_FOUND; }