3 * FusionForge Mails Facility
5 * Copyright 2002 GForge, LLC
6 * http://fusionforge.org/
10 * This file is part of FusionForge.
12 * FusionForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * FusionForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 require_once 'MailmanList.class.php';
30 class MailsForUser extends Error {
42 * @param object The Group object to which this list associated.
44 function MailsForUser(&$user) {
54 * @return Forum[] The array of Forums
57 function getMonitoredMails() {
59 $sql="SELECT groups.group_name,groups.group_id,mail_group_list.group_list_id,mail_group_list.list_name ".
60 "FROM groups,mail_group_list,mailman_sql ".
61 "WHERE groups.group_id=mail_group_list.group_id AND groups.status ='A' ".
62 "AND mail_group_list.list_name=mailman_sql.listname ".
63 "AND mailman_sql.address=$1 ORDER BY group_name DESC";
65 $result=db_query_params($sql,array($this->User->getEmail()));
66 $rows=db_numrows($result);
71 for ($i=0; $i<$rows; $i++) {
72 $group_id = db_result($result,$i,'group_id');
73 $list_id = db_result($result,$i,'group_list_id');
74 $group = group_get_object($group_id);
75 $list = new MailmanList($group,$list_id);
76 if ($list->isError()) {
77 $this->setError($list->getErrorMessage());