* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: lists.php,v 1.2 2004-10-08 21:53:58 x2000habouzit Exp $
+ $Id: lists.php,v 1.3 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
require("auto.prepend.inc.php");
list($pass) = mysql_fetch_row($res);
mysql_free_result($res);
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:$pass@localhost:4949");
-$listes = $client->get_all_lists('polytechnique.org');
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:$pass@localhost:4949/polytechnique.org");
+$listes = $client->get_all_lists();
$page->assign_by_ref('listes',$listes);
$page->run();
?>
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: export-econfiance.php,v 1.7 2004-11-08 10:27:27 x2000habouzit Exp $
+ $Id: export-econfiance.php,v 1.8 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
mysql_free_result($res);
- $client = new xmlrpc_client("http://10154:$pass@localhost:4949");
- $members = $client->get_members('polytechnique.org', 'x-econfiance');
+ $client = new xmlrpc_client("http://10154:$pass@localhost:4949/polytechnique.org");
+ $members = $client->get_members('x-econfiance');
if(is_array($members)) {
$membres = Array();
foreach($members[1] as $member) {
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: admin.php,v 1.10 2004-11-02 09:03:42 x2000habouzit Exp $
+ $Id: admin.php,v 1.11 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
$err = Array();
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949");
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
if(isset($_REQUEST['add_member'])) {
- $arr = $client->mass_subscribe('polytechnique.org', $liste, Array($_REQUEST['add_member']));
+ $arr = $client->mass_subscribe($liste, Array($_REQUEST['add_member']));
if(is_array($arr)) {
foreach($arr as $addr) $err[] = "{$addr[0]} inscrit.";
}
}
if(isset($_REQUEST['del_member'])) {
- $client->mass_unsubscribe('polytechnique.org', $liste, Array($_REQUEST['del_member']));
+ $client->mass_unsubscribe($liste, Array($_REQUEST['del_member']));
header("Location: ?liste=$liste");
}
if(isset($_REQUEST['add_owner'])) {
- if($client->add_owner('polytechnique.org', $liste, $_REQUEST['add_owner']))
+ if($client->add_owner($liste, $_REQUEST['add_owner']))
$err = $_REQUEST['add_owner']." ajouté aux modérateurs.";
}
if(isset($_REQUEST['del_owner'])) {
- $client->del_owner('polytechnique.org', $liste, $_REQUEST['del_owner']);
+ $client->del_owner($liste, $_REQUEST['del_owner']);
header("Location: ?liste=$liste");
}
-if(list($det,$mem,$own) = $client->get_members('polytechnique.org', $liste)) {
+if(list($det,$mem,$own) = $client->get_members($liste)) {
$membres = Array();
foreach($mem as $member) {
if(preg_match('/^([^.]*\.([^.]*)\.\d\d\d\d)@polytechnique.org$/', $member[1], $matches)) {
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: check.php,v 1.4 2004-10-31 14:42:36 x2000habouzit Exp $
+ $Id: check.php,v 1.5 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
new_admin_page('listes/check.tpl', true);
include('xml-rpc-client.inc.php');
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949");
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
-if(isset($_POST['correct'])) { $client->check_options('polytechnique.org', $liste, true); }
+if(isset($_POST['correct'])) { $client->check_options($liste, true); }
-if(list($details,$options) = $client->check_options('polytechnique.org', $liste)) {
+if(list($details,$options) = $client->check_options($liste)) {
$page->assign_by_ref('details', $details);
$page->assign_by_ref('options', $options);
} else
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: index.php,v 1.10 2004-10-30 15:45:40 x2000habouzit Exp $
+ $Id: index.php,v 1.11 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
require("auto.prepend.inc.php");
include('xml-rpc-client.inc.php');
include('newsletter.inc.php');
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949");
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
if(isset($_GET['del'])) {
- $client->unsubscribe('polytechnique.org',$_GET['del']);
+ $client->unsubscribe($_GET['del']);
header('Location: index.php');
}
if(isset($_GET['add'])) {
- $client->subscribe('polytechnique.org',$_GET['add']);
+ $client->subscribe($_GET['add']);
header('Location: index.php');
}
if(isset($_POST['promo_add'])) {
$promo = intval($_POST['promo_add']);
if($promo>=1900 and $promo<2100) {
- $client->subscribe('polytechnique.org',"promo$promo");
+ $client->subscribe("promo$promo");
}
}
if(!empty($_GET['nl_unsub'])) unsubscribe_nl();
if(!empty($_GET['nl_sub'])) subscribe_nl($_GET['nl_sub']=='html');
-$listes = $client->get_lists('polytechnique.org');
+$listes = $client->get_lists();
$page->assign_by_ref('listes',$listes);
$page->assign('nl',get_nl_state());
$page->run();
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: members.php,v 1.9 2004-11-02 09:08:56 x2000habouzit Exp $
+ $Id: members.php,v 1.10 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
new_skinned_page('listes/members.tpl', AUTH_COOKIE, true);
include('xml-rpc-client.inc.php');
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949");
-$members = $client->get_members('polytechnique.org', $liste);
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
+$members = $client->get_members($liste);
$tri_promo = empty($_REQUEST['alpha']);
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: moderate.php,v 1.17 2004-11-09 21:02:23 x2000habouzit Exp $
+ $Id: moderate.php,v 1.18 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
new_skinned_page('listes/moderate.tpl', AUTH_MDP, true);
include('xml-rpc-client.inc.php');
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949");
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
if(isset($_REQUEST['sadd'])) {
- $client->handle_request('polytechnique.org', $liste,$_REQUEST['sadd'],4,'');
+ $client->handle_request($liste,$_REQUEST['sadd'],4,'');
/** 4 is the magic for SUBSCRIBE see Defaults.py **/
header("Location: moderate.php?liste=$liste");
}
if(isset($_POST['sdel'])) {
- $client->handle_request('polytechnique.org', $liste,$_POST['sdel'],2,stripslashes($_POST['reason']));
+ $client->handle_request($liste,$_POST['sdel'],2,stripslashes($_POST['reason']));
/** 2 is the magic for REJECT see Defaults.py **/
}
$mid = $_REQUEST['mid'];
if(isset($_REQUEST['mok'])) {
unset($_GET['mid']);
- if($client->handle_request('polytechnique.org', $liste,$mid,1,'')) { /** 1 = APPROVE **/
+ if($client->handle_request($liste,$mid,1,'')) { /** 1 = APPROVE **/
include_once('diogenes.mailer.inc.php');
$mailer = new DiogenesMailer("$liste-bounces@polytechnique.org",
"$liste-owner@polytechnique.org", "Message accepté");
}
} elseif(isset($_POST['mno'])) {
$reason = stripslashes($_POST['reason']);
- $mail = $client->get_pending_mail('polytechnique.org', $liste, $mid);
- if($client->handle_request('polytechnique.org', $liste,$mid,2,$reason)) { /** 2 = REJECT **/
+ $mail = $client->get_pending_mail($liste, $mid);
+ if($client->handle_request($liste,$mid,2,$reason)) { /** 2 = REJECT **/
include_once('diogenes.mailer.inc.php');
$mailer = new DiogenesMailer("$liste-bounces@polytechnique.org",
"$liste-owner@polytechnique.org", "Message refusé");
}
} elseif(isset($_REQUEST['mdel'])) {
unset($_GET['mid']);
- $mail = $client->get_pending_mail('polytechnique.org', $liste, $mid);
- if($client->handle_request('polytechnique.org', $liste,$mid,3,'')) { /** 3 = DISCARD **/
+ $mail = $client->get_pending_mail($liste, $mid);
+ if($client->handle_request($liste,$mid,3,'')) { /** 3 = DISCARD **/
include_once('diogenes.mailer.inc.php');
$mailer = new DiogenesMailer("$liste-bounces@polytechnique.org",
"$liste-owner@polytechnique.org", "Message supprimé");
if(isset($_REQUEST['sid'])) {
$sid = $_REQUEST['sid'];
- if(list($subs,$mails) = $client->get_pending_ops('polytechnique.org', $liste)) {
+ if(list($subs,$mails) = $client->get_pending_ops($liste)) {
foreach($subs as $user) {
if($user['id'] == $sid) $u = $user;
}
} elseif(isset($_GET['mid'])) {
$mid = $_REQUEST['mid'];
- $mail = $client->get_pending_mail('polytechnique.org', $liste,$mid);
+ $mail = $client->get_pending_mail($liste,$mid);
if(is_array($mail)) {
$fname = '/etc/mailman/fr/refuse.txt';
$h = fopen($fname,'r');
$page->changeTpl('listes/moderate_mail.tpl');
$page->assign_by_ref('mail', $mail);
} else {
- if(list($subs,$mails) = $client->get_pending_ops('polytechnique.org', $liste)) {
+ if(list($subs,$mails) = $client->get_pending_ops($liste)) {
$page->assign_by_ref('subs', $subs);
$page->assign_by_ref('mails', $mails);
} else
$page->assign('no_list', true);
}
-} elseif(list($subs,$mails) = $client->get_pending_ops('polytechnique.org', $liste)) {
+} elseif(list($subs,$mails) = $client->get_pending_ops($liste)) {
$page->assign_by_ref('subs', $subs);
$page->assign_by_ref('mails', $mails);
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: options.php,v 1.6 2004-10-31 14:42:36 x2000habouzit Exp $
+ $Id: options.php,v 1.7 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
new_skinned_page('listes/options.tpl', AUTH_MDP, true);
include('xml-rpc-client.inc.php');
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949");
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
if(isset($_POST['submit'])) {
$values =array_map('stripslashes',$_POST);
- $client->set_bogo_level('polytechnique.org', $liste, intval($values['bogo_level']));
+ $client->set_bogo_level($liste, intval($values['bogo_level']));
unset($values['submit']);
unset($values['bogo_level']);
$values['send_goodbye_msg'] = empty($values['send_goodbye_msg']) ? false : true;
if(isset($values['subject_prefix'])) {
$values['subject_prefix'] = trim($values['subject_prefix']).' ';
}
- $client->set_owner_options('polytechnique.org', $liste, $values);
+ $client->set_owner_options($liste, $values);
} elseif(isset($_POST['atn_add']) && isvalid_email($_POST['atn_add'])) {
- $client->add_to_wl('polytechnique.org', $liste, $_POST['atn_add']);
+ $client->add_to_wl($liste, $_POST['atn_add']);
} elseif(isset($_GET['atn_del'])) {
- $client->del_from_wl('polytechnique.org', $liste, $_GET['atn_del']);
+ $client->del_from_wl($liste, $_GET['atn_del']);
header("Location: ?liste=$liste");
}
-if(list($details,$options) = $client->get_owner_options('polytechnique.org', $liste)) {
+if(list($details,$options) = $client->get_owner_options($liste)) {
$page->assign_by_ref('details', $details);
$page->assign_by_ref('options', $options);
- $page->assign('bogo_level', $client->get_bogo_level('polytechnique.org', $liste));
+ $page->assign('bogo_level', $client->get_bogo_level($liste));
} else
$page->assign('no_list', true);
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: soptions.php,v 1.5 2004-10-31 14:42:36 x2000habouzit Exp $
+ $Id: soptions.php,v 1.6 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
new_admin_page('listes/soptions.tpl', true);
include('xml-rpc-client.inc.php');
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949");
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
if(isset($_POST['submit'])) {
$values = array_map('stripslashes', $_POST);
unset($values['moderate']);
$values['advertised'] = empty($values['advertised']) ? false : true;
$values['archive'] = empty($values['archive']) ? false : true;
- $client->set_admin_options('polytechnique.org', $liste, $values);
+ $client->set_admin_options($liste, $values);
}
-if(list($details,$options) = $client->get_admin_options('polytechnique.org', $liste)) {
+if(list($details,$options) = $client->get_admin_options($liste)) {
$page->assign_by_ref('details', $details);
$page->assign_by_ref('options', $options);
} else
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: trombi.php,v 1.12 2004-11-02 07:48:40 x2000habouzit Exp $
+ $Id: trombi.php,v 1.13 2004-11-10 10:59:09 x2000habouzit Exp $
***************************************************************************/
if(empty($_REQUEST['liste'])) header('Location: index.php');
include('xml-rpc-client.inc.php');
require("trombi.inc.php");
-$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949");
+$client = new xmlrpc_client("http://{$_SESSION['uid']}:{$_SESSION['password']}@localhost:4949/polytechnique.org");
function getList($offset,$limit) {
global $client, $globals;
$liste = $_REQUEST['liste'];
- list($total,$members) = $client->get_members_limit('polytechnique.org',$liste,$offset,$limit);
+ list($total,$members) = $client->get_members_limit($liste,$offset,$limit);
$membres = Array();
foreach($members as $member) {
return Array($total,$membres);
}
-$owners = $client->get_owners('polytechnique.org',$liste);
+$owners = $client->get_owners($liste);
if(is_array($owners)) {
$moderos = Array();
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: inscription_listes_base.inc.php,v 1.4 2004-10-14 22:16:01 x2000habouzit Exp $
+ $Id: inscription_listes_base.inc.php,v 1.5 2004-11-10 10:59:10 x2000habouzit Exp $
***************************************************************************/
include('xml-rpc-client.inc.php');
function inscription_listes_base($uid,$pass,$promo) {
global $globals;
// récupération de l'id de la liste promo
- $client = new xmlrpc_client("http://$uid:$pass@localhost:4949");
- $client->subscribe('polytechnique.org',"promo$promo");
+ $client = new xmlrpc_client("http://$uid:$pass@localhost:4949/polytechnique.org");
+ $client->subscribe("promo$promo");
subscribe_nl();
}
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: valid_listes.inc.php,v 1.3 2004-10-31 14:42:37 x2000habouzit Exp $
+ $Id: valid_listes.inc.php,v 1.4 2004-11-10 10:59:10 x2000habouzit Exp $
***************************************************************************/
class ListeReq extends Validate {
list($pass) = mysql_fetch_row($res);
mysql_free_result($res);
- $client = new xmlrpc_client("http://{$_SESSION['uid']}:$pass@localhost:4949");
- $ret = $client->create_list('polytechnique.org', $this->liste, $this->desc,
+ $client = new xmlrpc_client("http://{$_SESSION['uid']}:$pass@localhost:4949/polytechnique.org");
+ $ret = $client->create_list($this->liste, $this->desc,
$this->advertise, $this->modlevel, $this->inslevel,
$this->owners, $this->members);
$liste = strtolower($this->liste);
#* Foundation, Inc., *
#* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
#***************************************************************************
-# $Id: mailman-rpc.py,v 1.73 2004-11-10 09:36:28 x2000habouzit Exp $
+# $Id: mailman-rpc.py,v 1.74 2004-11-10 10:59:10 x2000habouzit Exp $
#***************************************************************************
import base64, MySQLdb, os, getopt, sys, MySQLdb.converters, sha, signal
def _dispatch(self,method,params):
# TODO: subclass in SimpleXMLRPCDispatcher and not here.
new_params = list(params)
- new_params.insert(0,self.data)
+ new_params.insert(0,self.data[2])
+ new_params.insert(0,self.data[0:2])
return self.server._dispatch(method,new_params)
def do_POST(self):
try:
_, auth = self.headers["authorization"].split()
uid, md5 = base64.decodestring(auth).strip().split(':')
- self.data = self.getUser(uid,md5)
+ try:
+ vhost = self.path.split('/')[1].lower()
+ except:
+ vhost = 'polytechnique.org'
+ self.data = self.getUser(uid,md5,vhost)
if self.data is None:
raise AuthFailed
# Call super.do_POST() to do the actual work
self.send_response(401)
self.end_headers()
- def getUser(self, uid, md5):
+ def getUser(self, uid, md5, vhost):
mysql.execute ("""SELECT CONCAT(u.prenom, ' ',u.nom),a.alias,u.perms
FROM auth_user_md5 AS u
INNER JOIN aliases AS a ON ( a.id=u.user_id AND a.type='a_vie' )
LIMIT 1""" %( uid, md5 ) )
if int(mysql.rowcount) is 1:
name,forlife,perms = mysql.fetchone()
+ if vhost != 'polytechnique.org':
+ mysql.execute ("""SELECT uid
+ FROM groupex.membres AS m
+ INNER JOIN groupex.asso AS a ON (m.asso_id = a.id)
+ WHERE perms='admin' AND uid='%s' AND mail_domain='%s'""" %( uid , vhost ) )
+ if int(mysql.rowcount) is 1: perms= 'admin'
userdesc = UserDesc(forlife+'@polytechnique.org', name, None, 0)
- return (userdesc,perms)
+ return (userdesc,perms,vhost)
else:
return None