{
return array(
'lists' => $this->make_hook('lists', AUTH_MDP),
- 'lists/ajax' => $this->make_hook('ajax', AUTH_MDP, '', NO_AUTH),
+ 'lists/ajax' => $this->make_hook('ajax', AUTH_MDP, 'user', NO_AUTH),
'lists/create' => $this->make_hook('create', AUTH_MDP),
'lists/members' => $this->make_hook('members', AUTH_COOKIE),
'lists/trombi' => $this->make_hook('trombi', AUTH_COOKIE),
'lists/archives' => $this->make_hook('archives', AUTH_COOKIE),
+ 'lists/archives/rss' => $this->make_hook('rss', AUTH_PUBLIC),
'lists/moderate' => $this->make_hook('moderate', AUTH_MDP),
'lists/admin' => $this->make_hook('admin', AUTH_MDP),
'lists/soptions' => $this->make_hook('soptions', AUTH_MDP),
'lists/check' => $this->make_hook('check', AUTH_MDP),
- 'admin/lists' => $this->make_hook('admin_all', AUTH_MDP, 'admin'),
+ 'admin/lists' => $this->make_hook('admin_all', AUTH_MDP, 'admin'),
);
}
$page->trig('champs «addresse souhaitée» vide');
}
if (!preg_match("/^[a-zA-Z0-9\-]*$/", $liste)) {
- $page->trig('le nom de la liste ne doit contenir que des lettres, chiffres et tirets');
+ $page->trig('le nom de la liste ne doit contenir que des lettres non accentuées, chiffres et tirets');
}
$res = XDB::query("SELECT COUNT(*) FROM aliases WHERE alias={?}", $liste);
}
}
+ function compare($a, $b)
+ {
+ if ($a['promo'] == $b['promo']) {
+ if ($a['nom'] == $b['nom']) {
+ return strcmp($a['prenom'], $b['prenom']);
+ }
+ return strcmp($a['nom'], $b['nom']);
+ }
+ return $a['promo'] - $b['promo'];
+ }
+
function _get_list($offset, $limit)
{
global $platal;
promo, a.alias AS forlife
FROM auth_user_md5 AS u
INNER JOIN aliases AS a ON u.user_id = a.id
+ INNER JOIN photo AS p ON p.uid = u.user_id
WHERE a.alias = {?}", $m);
if ($tmp = $res->fetchOneAssoc()) {
$membres[$tmp['nom']] = $tmp;
} else {
- $membres[$member[0]] = array('addr' => $member[0]);
+ $total--;
}
}
+ uasort($membres, array($this, 'compare'));
return array($total, $membres);
}
if (Get::has('del')) {
$this->client->unsubscribe($liste);
- pl_redirect('lists/tromi/'.$liste);
+ pl_redirect('lists/trombi/'.$liste);
}
if (Get::has('add')) {
$this->client->subscribe($liste);
- pl_redirect('lists/tromi/'.$liste);
+ pl_redirect('lists/trombi/'.$liste);
}
$owners = $this->client->get_owners($liste);
if (Post::has('updateall')) {
$get['updateall'] = Post::v('updateall');
}
- if (!is_null($action)) {
- if ($action == 'new') {
- $get['action'] = 'new';
- } elseif (!is_null($artid)) {
- $get['artid'] = $artid;
- if ($action == 'reply') {
- $get['action'] = 'new';
- } elseif ($action == 'cancel') {
- $get['action'] = $action;
- } elseif ($action == 'from') {
- $get['first'] = $artid;
- unset($get['artid']);
- } elseif ($action == 'read') {
- $get['part'] = @$_GET['part'];
- } elseif ($action == 'source') {
- $get['part'] = 'source';
- } elseif ($action == 'xface') {
- $get['part'] = 'xface';
- } elseif ($action) {
- $get['part'] = str_replace('.', '/', $action);
- }
- if (Get::v('action') == 'showext') {
- $get['action'] = 'showext';
- }
- }
- }
- require_once('banana/ml.inc.php');
- $banana = new MLBanana($get);
- $page->assign('banana', $banana->run());
- $page->addCssInline($banana->css());
- $page->addCssLink('banana.css');
+ require_once 'banana/ml.inc.php';
+ get_banana_params($get, null, $action, $artid);
+ run_banana($page, 'MLBanana', $get);
} else {
$page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
}
}
+ function handler_rss(&$page, $liste = null, $alias = null, $hash = null)
+ {
+ require_once('rss.inc.php');
+ $uid = init_rss(null, $alias, $hash);
+ if (!$uid || !$liste) {
+ exit;
+ }
+
+ $res = XDB::query("SELECT user_id AS uid, password, alias AS forlife
+ FROM auth_user_md5 AS u
+ INNER JOIN aliases AS a ON (a.id = u.user_id AND a.type = 'a_vie')
+ WHERE u.user_id = {?}", $uid);
+ $row = $res->fetchOneAssoc();
+ $_SESSION = array_merge($row, $_SESSION);
+
+ $domain = $this->prepare_client($page);
+ if (list($det) = $this->client->get_members($liste)) {
+ if (substr($liste,0,5) != 'promo' && ($det['ins'] || $det['priv'])
+ && !$det['own'] && ($det['sub'] < 2)) {
+ exit;
+ }
+ require_once('banana/ml.inc.php');
+ $banana = new MLBanana(S::v('forlife'), Array('listname' => $liste, 'domain' => $domain, 'action' => 'rss2'));
+ $banana->run();
+ }
+ exit;
+ }
+
function moderate_mail($domain, $liste, $mid)
{
$mail = $this->client->get_pending_mail($liste, $mid);
}
} elseif (Env::has('mid')) {
if (Get::has('mid') && !Env::has('mok') && !Env::has('mdel')) {
+ $page->changeTpl('lists/moderate_mail.tpl');
require_once('banana/moderate.inc.php');
$params = array('listname' => $liste, 'domain' => $domain,
'artid' => Get::i('mid'), 'part' => Get::v('part'), 'action' => Get::v('action'));
- $banana = new ModerationBanana($params, $this->client);
- $res = $banana->run();
- $page->addCssInline($banana->css());
+ $params['client'] = $this->client;
+ run_banana($page, 'ModerationBanana', $params);
$msg = file_get_contents('/etc/mailman/fr/refuse.txt');
$msg = str_replace("%(adminaddr)s", "$liste-owner@{$domain}", $msg);
$msg = str_replace("%(reason)s", "<< TON EXPLICATION >>", $msg);
$msg = str_replace("%(listname)s", $liste, $msg);
$page->assign('msg', $msg);
-
- $page->addCssLink('banana.css');
- $this->changeTpl('lists/moderate_mail.tpl');
- $page->assign_by_ref('mail', $res);
return;
}