+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-if (!Env::has('liste')) redirect('listes.php');
-$liste = strtolower(Env::get('liste'));
-$domain = $globals->asso('mail_domain');
-
-new_group_page('listes/admin.tpl');
-$page->assign('force_list_super', may_update());
-
-require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
-require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/admin.php');
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-if (!Env::has('liste')) redirect('listes.php');
-$liste = strtolower(Env::get('liste'));
-$domain = $globals->asso('mail_domain');
-
-new_group_page('listes/archives.tpl');
-$page->assign('force_list_super', may_update());
-
-require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
-require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/archives.php');
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-if (!Env::has('liste')) redirect('index.php');
-$liste = strtolower(Env::get('liste'));
-
-new_groupadmin_page('listes/check.tpl');
-$page->assign('force_list_super', may_update());
-
-require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
-require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/check.php');
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-if (!Env::has('liste')) redirect('listes.php');
-$liste = strtolower(Env::get('liste'));
-
-new_group_page('listes/delete.tpl');
-$page->assign('force_list_super', may_update());
-
-require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
-require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/delete.php');
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-if (!Env::has('liste')) redirect('listes.php');
-$liste = strtolower(Env::get('liste'));
-
-new_group_page('listes/members.tpl');
-$page->assign('force_list_super', may_update());
-
-require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
-require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/members.php');
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-if (!Env::has('liste')) redirect('listes.php');
-$liste = strtolower(Env::get('liste'));
-$domain = $globals->asso('mail_domain');
-
-if (preg_match("!(?:[a-z0-9]+\\.)?{".$globals->asso('mail_domain')."}_(.*)!", $liste, $matches)) {
- redirect("{$_SERVER['PHP_SELF']}?liste={$matches[1]}");
-}
-
-new_group_page('listes/moderate.tpl');
-$page->assign('force_list_super', may_update());
-
-require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
-require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/moderate.php');
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-if (!Env::has('liste')) redirect('listes.php');
-$liste = strtolower(Env::get('liste'));
-
-new_group_page('listes/options.tpl');
-$page->assign('force_list_super', may_update());
-
-require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
-require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/options.php');
-
-?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 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 *
- ***************************************************************************/
-
-require_once 'xnet.inc.php';
-if (!Env::has('liste')) redirect('listes.php');
-$liste = strtolower(Env::get('liste'));
-
-new_groupadmin_page('listes/soptions.tpl');
-$page->assign('force_list_super', may_update());
-
-require_once('lists.inc.php');
-$client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $globals->asso('mail_domain'));
-require(dirname(dirname(dirname(__FILE__))).'/htdocs/listes/soptions.php');
-
-?>
require_once dirname(__FILE__).'/../classes/Xnet.php';
require_once dirname(__FILE__).'/../classes/PLModule.php';
-$platal = new Xnet('xnet', 'xnetgrp');
+$platal = new Xnet('xnet', 'xnetgrp', 'xnetlists');
$platal->run();
?>
);
}
- function prepare_client()
+ function prepare_client(&$page)
{
require_once 'lists.inc.php';
{
global $globals;
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/index.tpl');
$page->assign('xorg_title','Polytechnique.org - Listes de diffusion');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/members.tpl');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/trombi.tpl');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/archives.tpl');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/moderate.tpl');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/admin.tpl');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/options.tpl');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/delete.tpl');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/soptions.tpl');
return PL_NOT_FOUND;
}
- $this->prepare_client();
+ $this->prepare_client($page);
$page->changeTpl('listes/check.tpl');
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2006 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 *
+ ***************************************************************************/
+
+require_once dirname(__FILE__).'/lists.php';
+
+class XnetListsModule extends ListsModule
+{
+ var $client;
+
+ function handlers()
+ {
+ return array(
+ 'grp/lists' => $this->make_hook('lists', AUTH_MDP),
+ 'grp/lists/create' => $this->make_hook('create', AUTH_MDP),
+
+ 'grp/lists/members' => $this->make_hook('members', AUTH_COOKIE),
+ 'grp/lists/trombi' => $this->make_hook('trombi', AUTH_COOKIE),
+ 'grp/lists/archives' => $this->make_hook('archives', AUTH_COOKIE),
+
+ 'grp/lists/moderate' => $this->make_hook('moderate', AUTH_MDP),
+ 'grp/lists/admin' => $this->make_hook('admin', AUTH_MDP),
+ 'grp/lists/options' => $this->make_hook('options', AUTH_MDP),
+ 'grp/lists/delete' => $this->make_hook('delete', AUTH_MDP),
+
+ 'grp/lists/soptions' => $this->make_hook('soptions', AUTH_MDP),
+ 'grp/lists/check' => $this->make_hook('check', AUTH_MDP),
+
+ /* hack: lists uses that */
+ 'profile' => $this->make_hook('profile', AUTH_PUBLIC),
+ );
+ }
+
+ function prepare_client(&$page)
+ {
+ global $globals;
+
+ require_once 'lists.inc.php';
+
+ $this->client =& lists_xmlrpc(Session::getInt('uid'),
+ Session::get('password'),
+ $globals->asso('mail_domain'));
+
+ $page->useMenu();
+ $page->assign('asso', $globals->asso());
+ $page->setType($globals->asso('cat'));
+ }
+
+ function handler_profile(&$page, $user = null)
+ {
+ redirect('https://www.polytechnique.org/profile/'.$user);
+ }
+}
+
+?>