3 * FusionForge Mailing Lists Facility
5 * Portions Copyright 1999-2001 (c) VA Linux Systems
6 * The rest Copyright 2003 (c) Guillaume Smet
7 * Portions Copyright 2010 (c) Mélanie Le Bail
14 require_once 'mailman/include/MailmanList.class.php';
15 require_once 'mailman/include/MailmanListFactory.class.php';
17 $current_user=UserManager::instance()->getCurrentUser();
20 function sendCreationMail($userEmail,&$list) {
21 $message = sprintf(_('A mailing list will be created on %1$s in few minutes
22 and you are the list administrator.
24 This list is: %3$s@%2$s .
26 Your mailing list info is at:
29 List administration can be found at:
32 Your list password is: %6$s .
33 You are encouraged to change this password as soon as possible.
35 Thank you for registering your project with %1$s.
38 '), $GLOBALS['sys_name'], $GLOBALS['sys_lists_host'], $list->getName(), $list->getExternalInfoUrl(), 'http://'.$GLOBALS['sys_lists_host'].'/mailman/admin/'.$this->getName(), $list->getPassword());
39 $mailSubject = sprintf(_('%1$s New Mailing List'), $GLOBALS['sys_name']);
44 $hdrs = "From: ".$GLOBALS['sys_email_admin'].$GLOBALS['sys_lf'];
45 $hdrs .='Content-type: text/plain; charset=utf-8'.$GLOBALS['sys_lf'];
47 mail ($userEmail,$mailSubject,$message,$hdrs);
51 function table_begin()
54 echo "<table WIDTH=\"100%\" border=0>\n"."<TR><TD VALIGN=\"TOP\">\n";
58 echo '</TD></TR></TABLE>';
61 function personalized_message()
64 echo _('<p>Mailing lists provided via a GForge version of <a href="http://www.list.org/">GNU Mailman</a>. Thanks to the Mailman and <a href="http://www.python.org/">Python</a> crews for excellent software.</p>');
66 function display_list($currentList)
68 $request =& HTTPRequest::instance();
69 $current_user=UserManager::instance()->getCurrentUser();
71 if($currentList->isPublic()!='9'){
72 if ($currentList->isError()) {
73 echo $currentList->getErrorMessage();
76 echo ' <b>'.$currentList->getName().'</b> [';
77 if($currentList->getStatus() == '3') {
78 echo _('Not activated yet');
80 echo ' <A HREF="index.php?group_id='.$request->get('group_id').'&action=pipermail&id='.$currentList->getID().'">'._('Archives').'</A>';
83 if ($currentList->isMonitoring()) {
84 echo ' | <a href="index.php?group_id='.$request->get('group_id').'&action=unsubscribe&id='.$currentList->getID().'">'._('Unsubscribe').' </a>';
85 echo ' | <a href="index.php?group_id='.$request->get('group_id').'&action=options&id='.$currentList->getID().'">'._('Preferences').'</a>';
87 echo ' | <a href="index.php?group_id='.$request->get('group_id').'&action=subscribe&id='.$currentList->getID().'">'._('Subscribe').'</a>';
89 if ($currentList->getListAdminID() == $current_user->getID()){
90 echo ' | <A HREF="index.php?group_id='. $request->get('group_id').'&action=admin&id='. $currentList->getID() .'">'._('Administrate').'</A> ';
95 echo htmlspecialchars($currentList->getDescription()).'<p>';
101 function display_list_admin($currentList)
103 $request =& HTTPRequest::instance();
104 $current_user=UserManager::instance()->getCurrentUser();
105 if($currentList->isPublic()!='9'){
106 if ($currentList->isError() ) {
107 echo $currentList->getErrorMessage();
111 echo ' <b>'.$currentList->getName().'</b> [';
113 if($currentList->getStatus() == '3') {
114 echo _('Not activated yet');
117 echo ' <A HREF="index.php?group_id='.$request->get('group_id').'&change_status=1&group_list_id='.$currentList->getID().'">'._('Update').'</A>';
118 echo ' | <a href="deletelist.php?group_id='.$currentList->Group->getID().'&id='.$currentList->getID().'">'. _('Delete').'</a>';
120 if ($currentList->getListAdminID() == $current_user->getID()){
121 echo ' | <A HREF="../index.php?group_id='. $request->get('group_id').'&action=admin&id='. $currentList->getID() .'">'._('Administrate from Mailman').'</A> ';
125 echo ' ] <br> ';
126 echo htmlspecialchars($currentList->getDescription()).'<p>';
131 function mailman_header($params) {
133 $current_user=UserManager::instance()->getCurrentUser();
134 $request =& HTTPRequest::instance();
136 //required for site_project_header
137 $params['group'] = $request->get('group_id');
138 $params['toptab'] = 'mailman';
140 site_project_header($params);
142 // admin link is only displayed if the user is a project administrator
143 if ($current_user->isMember($request->get('group_id'),'A')) {
144 if (isset($params['admin'])){
145 echo '<A HREF="index.php?group_id='.$request->get('group_id').'">'._('Administration').'</A>';
148 echo '<A HREF="admin/index.php?group_id='.$request->get('group_id').'">'._('Administration').'</A>';
152 if ($params['help']) {
153 helpButton($params['help']);
158 function mail_footer($params) {
159 site_project_footer($params);
165 // c-file-style: "bsd"