From: x2003bruneau Date: Tue, 28 Nov 2006 18:18:18 +0000 (+0000) Subject: Backport [1188], [1189] and [1190] X-Git-Tag: xorg/0.9.13~260 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7c5842f36aef50ec20bb16cc383027192652626d;p=platal.git Backport [1188], [1189] and [1190] git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1191 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/auth.php b/modules/auth.php index dae0153..28463d6 100644 --- a/modules/auth.php +++ b/modules/auth.php @@ -90,6 +90,7 @@ class AuthModule extends PLModule $res .= "\n\n"; + header('Content-Type: text/xml; charset="ISO-8859-1"'); echo $res; } exit; diff --git a/modules/lists.php b/modules/lists.php index caa7844..cc6a747 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -603,23 +603,36 @@ class ListsModule extends PLModule function handler_delete(&$page, $liste = null) { + global $globals; if (is_null($liste)) { return PL_NOT_FOUND; } - $this->prepare_client($page); + $domain = $this->prepare_client($page); + if ($domain == $globals->mail->domain || $domain == $globals->mail->domain2) { + $domain = ''; + $table = 'aliases'; + $type = 'liste'; + } else { + $domain = '@' . $domain; + $table = 'virtual'; + $type = 'list'; + } $page->changeTpl('listes/delete.tpl'); - - if (Post::v('valid') == 'OUI' - && $this->client->delete_list($liste, Post::b('del_archive'))) - { - foreach (array('', '-owner', '-admin', '-bounces') as $app) { - XDB::execute("DELETE FROM aliases - WHERE type='liste' AND alias='{?}'", - $liste.$app); + if (Post::v('valid') == 'OUI') { + if ($this->client->delete_list($liste, Post::b('del_archive'))) { + foreach (array('', '-owner', '-admin', '-bounces') as $app) { + XDB::execute("DELETE FROM $table + WHERE type={?} AND alias={?}", + $type, $liste.$app.$domain); + } + $page->assign('deleted', true); + } else { + $page->kill('Une erreur est survenue lors de la suppression de la liste.
' + . 'Contact les administrateurs du site pour régler le problème : ' + . 'support@polytechnique.org'); } - $page->assign('deleted', true); } elseif (list($details,$options) = $this->client->get_owner_options($liste)) { $page->assign_by_ref('details', $details); $page->assign_by_ref('options', $options);