22 parent::edit_form($form, $form_state);
23 $form[
'basic'][
'settings'][
'admin_url'] = array(
24 '#type' =>
'textfield',
25 '#title' => t(
'Mailman URL Base'),
26 '#default_value' => $this->
get_setting(
'admin_url'),
28 '#description' => t(
'Base URL of admin page (typically something like http://example.com/mailman )'),
31 $form[
'basic'][
'settings'][
'listname'] = array(
32 '#type' =>
'textfield',
33 '#title' => t(
'List Name'),
36 '#description' => t(
'Name of list as appears in URLs for the list'),
39 $form[
'basic'][
'settings'][
'admin_password'] = array(
40 '#type' =>
'textfield',
41 '#title' => t(
'Admin Password'),
44 '#description' => t(
'Password to access List Interface'),
52 dpm($form_state,
'Mailman21List::edit_form_submit');
71 return parent::checkMessage($msg);
81 return parent::processMessage($msg);
96 $url = $this->
get_setting(
'admin_url') .
'/options/' . $this->
get_setting(
'listname') .
'/' . str_replace(
'@',
'--at--', $email);
98 dpm($data,
'Get Info: ' . $email);
99 $body = $data[
'body'];
100 $pos = strpos($body,
'Your ' . $listname .
' Subscription Options');
101 if ($pos === FALSE) {
105 $info = array(
'Email' => $email);
106 $pos1 = strpos($body,
'name="fullname"');
107 $pos1 = strpos($body,
'value=', $pos1)+7;
108 $end = strpos($body,
'"', $pos1);
109 $name = substr($body, $pos1, $end-$pos1);
110 $info[
'Name'] = $name;
112 $pos = strpos($body,
'name="disablemail"', $pos);
113 $pos = strpos($body,
'CHECKED', $pos);
114 $no_mail = substr($body, $pos-3, 1);
117 $pos = strpos($body,
'name="digest"', $pos);
118 $pos = strpos($body,
'CHECKED', $pos);
119 $digest = substr($body, $pos-3, 1);
122 $pos = strpos($body,
'name="mime"', $pos);
123 $pos = strpos($body,
'CHECKED', $pos);
124 $plain = substr($body, $pos-3, 1);
145 $form[
'notice'] = array(
146 '#markup' =>
'<b>** Notice: Not Fully Implemented</b>',
149 $form[
'email'] = array(
150 '#type' =>
'textfield',
151 '#title' => t(
'EMail Address'),
152 '#default_value' =>
'somebody@example.com',
154 '#description' => t(
'This is the Email address which email from the list will be sent'),
158 dpm($form,
'Subscribe Form');
165 $form[
'notice'] = array(
166 '#markup' =>
'<b>** Notice: Not Fully Implemented</b>',
169 $form[
'email'] = array(
170 '#type' =>
'textfield',
171 '#title' => t(
'EMail Address'),
172 '#default_value' =>
'somebody@example.com',
174 '#description' => t(
'This is the Email address which email from the list will be sent'),
178 dpm($form,
'Unsubscribe Form');
185 $form[
'notice'] = array(
186 '#markup' =>
'<b>** Notice: Not Fully Implemented</b>',
189 $form[
'email'] = array(
190 '#type' =>
'textfield',
191 '#title' => t(
'EMail Address'),
192 '#default_value' =>
'somebody@example.com',
194 '#description' => t(
'This is the Email address which email from the list will be sent'),
198 dpm($form,
'Options Form');
227 $pagecode =
'?letter=' . $page[0] .
'&chunk=' . $page[1];
229 $url = $this->
get_setting(
'admin_url') .
'/admin/' . $this->
get_setting(
'listname') .
'/members' . $pagecode;
231 dpm($data,
'Page Data');
232 $body = $data[
'body'];
233 $pos = strpos($body,
'Membership List');
238 $pos = strpos($body,
'letter=', $pos)+7;
239 $page[0] = substr($body, $pos, 1);
244 $next[1] = $next[1]+1;
245 if (FALSE === strpos($body,
'chunk=' . $next[1], $pos)) {
249 $this->
log(
'Bad Pos1 ' . $pos .
'\n' . html_specialchars($body), SELF::LOG_ERROR);
250 return array(
'next' => $next,
'page' => $page,
'members' => array());
252 $pos = strpos($body,
'letter=' . $next[0] .
'"', $pos-7);
254 $this->
log(
'Bad Pos2 ' . $pos .
'\n' . html_specialchars($body), SELF::LOG_ERROR);
255 return array(
'next' => $next,
'page' => $page,
'members' => array());
257 $pos = strpos($body,
'letter=', $pos+7) + 7;
258 $letter = substr($body, $pos, 1);
259 if ($pos > 7 && $letter != $next[0]) {
268 $pos = strpos($body,
'member address', $pos);
269 $endpos = strpos($body,
'</table>', $pos);
270 $pos = strpos($body,
'<tr>', $pos);
271 while ($pos < $endpos) {
272 $pos1 = strpos($body,
'</tr>', $pos);
273 $record = substr($body, $pos, $pos1-$pos+5);
274 $record = explode(
'<td>', $record);
278 $start = strpos($record[2],
'>');
279 $end = strpos($record[2],
'</a>');
280 $email = substr($record[2], $start+1, $end - $start-1);
281 $info[
'Email'] = $email;
282 $start = strpos($record[2],
'value=', $end) + 7;
283 $end = strpos($record[2],
'"', $start);
284 $name = substr($record[2], $start, $end - $start);
285 $info[
'Name'] = $name;
287 $start = strpos($record[3],
'value=') + 7;
288 $end = strpos($record[3],
'"', $start);
289 $mod = substr($record[3], $start, $end - $start);
290 $info[
'Moderated'] = $mod ==
"on";
292 $start = strpos($record[4],
'value=') + 7;
293 $end = strpos($record[4],
'"', $start);
294 $hide = substr($record[4], $start, $end - $start);
295 $info[
'Hide'] = $hide ==
"on";
297 $start = strpos($record[5],
'value=') + 7;
298 $end = strpos($record[5],
'"', $start);
299 $no_mail = substr($record[5], $start, $end - $start);
300 if ($no_mail ==
'on') {
301 $start = strpos($record[5],
'[', $end)+1;
302 $info[
'NoMail'] = substr($record[5], $start, 1);
305 $info[
'NoMail'] = FALSE;
308 $start = strpos($record[6],
'value=') + 7;
309 $end = strpos($record[6],
'"', $start);
310 $ack = substr($record[6], $start, $end - $start);
311 $info[
'Ack'] = $ack ==
"on";
313 $start = strpos($record[7],
'value=') + 7;
314 $end = strpos($record[7],
'"', $start);
315 $metoo = substr($record[7], $start, $end - $start);
316 $info[
'MeToo'] = $metoo ==
'on';
318 $start = strpos($record[8],
'value=') + 7;
319 $end = strpos($record[8],
'"', $start);
320 $no_dups = substr($record[8], $start, $end - $start);
321 $info[
'NoDups'] = $no_dups ==
'on';
323 $start = strpos($record[9],
'value=') + 7;
324 $end = strpos($record[9],
'"', $start);
325 $digest = substr($record[9], $start, $end - $start);
327 $start = strpos($record[10],
'value=') + 7;
328 $end = strpos($record[10],
'"', $start);
329 $plain = substr($record[10], $start, $end - $start);
335 $end = strpos($record[11],
'Selected') - 2;
336 $string = substr($record[11], 0, $end);
337 $start = strrpos($string,
'"') + 1;
338 $lang = substr($record[11], $start, $end - $start);
339 $info[
'Language'] = $lang;
341 $members[$email] = $info;
343 $pos = strpos($body,
'<tr>', $pos1);
345 return array(
'next' => $next,
'page' => $page,
'members' => $members);
358 $page = parent::getWebPage($url, $post);
359 if (strpos($page[
'body'],
'name="admlogin"') ) {
361 $page = parent::getWebPage( $url, $login_post);
Interface MailinglistMessageInterface.
getMemberInfo($email)
getMemberInfo()
_mailinglist_encode_password($pass)
_mailinglist_encode_password
const MAILINGLIST_SUB_MIME_DIGEST
get_setting($name, $def=NULL)
get_settings()
SubscribeForm(&$form, &$form_state)
Operation Forms.
Mailman 2.1.x List Personality Plugin.
log($str, $level=self::LOG_NOTICE, $parms=array())
log()
processMessage(MailinglistMessageInterface $msg)
processMessage()
OptionsForm($form, $form_state)
const MAILINGLIST_SUB_NOMAIL
const MAILINGLIST_SUB_DIGEST
edit_form_submit(&$form, &$form_state)
_mailinglist_decode_password($code)
_mailinglist_decode_password
getWebPage($url, $post="")
getWebPage
UnsubscribeForm(&$form, &$form_state)
getMemberPage($page)
getMemberPage
Retrieve messages from a Mailhandler Mailbox.
edit_form(&$form, &$form_state)
Implements ctools_export_ui::edit_form().
checkMessage(MailinglistMessageInterface $msg)
checkMessage()
const MAILINGLIST_SUB_NORMAL