public function Prepare($page) { parent::Prepare($page); $res = XDB::iterRow("SELECT sub, domain\n FROM register_subs\n WHERE uid = {?} AND type = 'list'\n ORDER BY domain", S::i('uid')); $lists = array(); while (list($sub, $domain) = $res->next()) { $mlist = new MailingList($sub, $domain); list($details, ) = $mlist->getMembers(); $lists["{$sub}@{$domain}"] = $details; } $page->assign_by_ref('lists', $lists); }
WHERE handler IS NULL ORDER BY ts LIMIT 1', $handler); if (XDB::affectedRows() == 0) { break; } $query = XDB::query('SELECT uid, ml, domain, mid, action, message FROM email_list_moderate WHERE handler = {?}', $handler); list($uid, $list, $domain, $mid, $action, $reason) = $query->fetchOneRow(); $user = User::get($uid); $fullname = $user->fullName(); $mlist = new MailingList($list, $domain, $user); // send the mail $mail = $mlist->getPendingMail($mid); list($det, $mem, $own) = $mlist->getMembers(); $count = 0; switch ($action) { case 'accept': $action = MailingList::REQ_ACCEPT; $subject = "Message accepté"; $append = "a été accepté par {$fullname}.\n"; $type = 'nonspam'; $count += count($mem) + count($own); break; case 'refuse': $action = MailingList::REQ_REJECT; $subject = "Message refusé"; $append = "a été refusé par {$fullname} avec la raison :\n\n" . $reason; $type = 'nonspam'; $count += count($own) + 1;