Skip to content

Commit 1c2aec6

Browse files
committed
I'm just gonna make changes to the latest, original release available at the time i started this project.
I renamed it cpommo so you can just download that if you want it use cpoMMo
1 parent 3e113dc commit 1c2aec6

File tree

580 files changed

+125955
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

580 files changed

+125955
-1
lines changed

aardvark-development/inc/helpers/groups.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class PommoGroup {
4747
// ============ NON STATIC METHODS ===================
4848
function PommoGroup($groupID = NULL, $status = 1, $filter = FALSE) {
4949
$this->_status = $status;
50+
//$ids = explode( ',',
5051
if (!is_numeric($groupID)) { // exception if no group ID was passed -- group assumes "all subscribers".
5152
$GLOBALS['pommo']->requireOnce($GLOBALS['pommo']->_baseDir. 'inc/helpers/subscribers.php');
5253

@@ -332,4 +333,4 @@ function nameChange($id, $name) {
332333
return ($dbo->affected($query) > 0) ? TRUE : FALSE;
333334
}
334335
}
335-
?>
336+
?>

cpommo/.cache/.dataModel

624 KB
Binary file not shown.

cpommo/admin/admin.php

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <[email protected]>
4+
*
5+
* This file is part of poMMo (http://www.pommo.org)
6+
*
7+
* poMMo is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published
9+
* by the Free Software Foundation; either version 2, or any later version.
10+
*
11+
* poMMo is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty
13+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
14+
* the GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with program; see the file docs/LICENSE. If not, write to the
18+
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*/
20+
21+
/**********************************
22+
INITIALIZATION METHODS
23+
*********************************/
24+
$lang = false;
25+
if (isset($_POST['lang'])) {
26+
define('_poMMo_lang', $_POST['lang']);
27+
$lang = true;
28+
}
29+
30+
require('../bootstrap.php');
31+
$pommo->init();
32+
$logger = & $pommo->_logger;
33+
$dbo = & $pommo->_dbo;
34+
35+
/**********************************
36+
SETUP TEMPLATE, PAGE
37+
*********************************/
38+
Pommo::requireOnce($pommo->_baseDir.'inc/classes/template.php');
39+
$smarty = new PommoTemplate();
40+
41+
$smarty->assign('header',array(
42+
'main' => 'poMMo '.$pommo->_config['version'],
43+
'sub' => sprintf(Pommo::_T('Powerful mailing list software for %s'),$pommo->_config['list_name'])
44+
));
45+
46+
if($lang)
47+
$logger->addErr(Pommo::_T('You have changed the language for this session. To make this the default language, you must update your config.php file.'));
48+
49+
$smarty->assign('lang',($pommo->_slanguage) ? $pommo->_slanguage : $pommo->_language);
50+
$smarty->display('admin/admin.tpl');
51+
Pommo::kill();
52+

cpommo/admin/index.php

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <[email protected]>
4+
*
5+
* This file is part of poMMo (http://www.pommo.org)
6+
*
7+
* poMMo is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published
9+
* by the Free Software Foundation; either version 2, or any later version.
10+
*
11+
* poMMo is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty
13+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
14+
* the GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with program; see the file docs/LICENSE. If not, write to the
18+
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*/
20+
21+
require('../bootstrap.php');
22+
Pommo::redirect('/admin/admin.php');
23+
?>
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <[email protected]>
4+
*
5+
* This file is part of poMMo (http://www.pommo.org)
6+
*
7+
* poMMo is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published
9+
* by the Free Software Foundation; either version 2, or any later version.
10+
*
11+
* poMMo is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty
13+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
14+
* the GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with program; see the file docs/LICENSE. If not, write to the
18+
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*/
20+
21+
/**********************************
22+
INITIALIZATION METHODS
23+
*********************************/
24+
require('../../bootstrap.php');
25+
Pommo::requireOnce($pommo->_baseDir.'inc/helpers/mailings.php');
26+
27+
$pommo->init();
28+
$logger = & $pommo->_logger;
29+
$dbo = & $pommo->_dbo;
30+
31+
/**********************************
32+
SETUP TEMPLATE, PAGE
33+
*********************************/
34+
Pommo::requireOnce($pommo->_baseDir.'inc/classes/template.php');
35+
$smarty = new PommoTemplate();
36+
37+
if (PommoMailing::isCurrent())
38+
Pommo::kill(sprintf(Pommo::_T('A Mailing is currently processing. Visit the %sStatus%s page to check its progress.'),'<a href="mailing_status.php">','</a>'));
39+
40+
$smarty->display('admin/mailings/admin_mailings.tpl');
41+
Pommo::kill();
42+
?>
+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<?php
2+
/**
3+
* Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <[email protected]>
4+
*
5+
* This file is part of poMMo (http://www.pommo.org)
6+
*
7+
* poMMo is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published
9+
* by the Free Software Foundation; either version 2, or any later version.
10+
*
11+
* poMMo is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty
13+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
14+
* the GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with program; see the file docs/LICENSE. If not, write to the
18+
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*/
20+
21+
/**********************************
22+
INITIALIZATION METHODS
23+
*********************************/
24+
require ('../../../bootstrap.php');
25+
Pommo::requireOnce($pommo->_baseDir.'inc/helpers/mailings.php');
26+
27+
$pommo->init();
28+
$logger = & $pommo->_logger;
29+
$dbo = & $pommo->_dbo;
30+
31+
// Remember the Page State
32+
$state =& PommoAPI::stateInit('mailings_history');
33+
34+
/**********************************
35+
JSON OUTPUT INITIALIZATION
36+
*********************************/
37+
Pommo::requireOnce($pommo->_baseDir.'inc/classes/json.php');
38+
$json = new PommoJSON();
39+
40+
/**********************************
41+
PAGINATION AND ORDERING
42+
*********************************/
43+
44+
// Get and Remember the requested number of rows
45+
if(!empty($_REQUEST['page']) && (
46+
is_numeric($_REQUEST['rows']) && (
47+
$_REQUEST['rows'] > 0 &&
48+
$_REQUEST['rows'] <= 1000
49+
)
50+
))
51+
$state['limit'] = $_REQUEST['rows'];
52+
53+
// Get and Remember the requested page
54+
if(!empty($_REQUEST['page']) && (
55+
is_numeric($_REQUEST['page']) &&
56+
$_REQUEST['page'] <= $state['pages']
57+
))
58+
$state['page'] = $_REQUEST['page'];
59+
60+
// Get and Remember the sort column
61+
if(!empty($_REQUEST['sidx']) && (
62+
$_REQUEST['sidx'] == 'start' ||
63+
$_REQUEST['sidx'] == 'end' ||
64+
$_REQUEST['sidx'] == 'subject' ||
65+
$_REQUEST['sidx'] == 'sent' ||
66+
$_REQUEST['sidx'] == 'status' ||
67+
$_REQUEST['sidx'] == 'group'
68+
))
69+
$state['sort'] = $_REQUEST['sidx'];
70+
71+
72+
// Get and Remember the sort order
73+
if(!empty($_REQUEST['sord']) && (
74+
$_REQUEST['sord'] == 'asc' ||
75+
$_REQUEST['sord'] == 'desc'
76+
))
77+
$state['order'] = $_REQUEST['sord'];
78+
79+
80+
// Calculate the offset
81+
$start = $state['limit']*$state['page']-$state['limit'];
82+
if($start < 0)
83+
$start = 0;
84+
85+
86+
/**********************************
87+
RECORD RETREVIAL
88+
*********************************/
89+
90+
// normalize sort to database column
91+
if($state['sort'] == 'group') $state['sort'] = 'mailgroup';
92+
elseif($state['sort'] == 'start') $state['sort'] = 'started';
93+
elseif($state['sort'] == 'end') $state['sort'] = 'finished';
94+
95+
// Fetch Mailings for this Page
96+
$mailings = PommoMailing::get(array(
97+
'noBody' => TRUE,
98+
'sort' => $state['sort'],
99+
'order' => $state['order'],
100+
'limit' => $state['limit'],
101+
'offset' => $start));
102+
103+
104+
/**********************************
105+
OUTPUT FORMATTING
106+
*********************************/
107+
108+
$records = array();
109+
foreach($mailings as $o) {
110+
$row = array(
111+
'id' => $o['id'],
112+
'subject' => $o['subject'],
113+
'group' => $o['group'].' ('.$o['tally'].')',
114+
'sent' => $o['sent'],
115+
'start' => $o['start'],
116+
'end' => $o['end']
117+
);
118+
119+
if($o['status'] == 0)
120+
$o['status'] = Pommo::_T('Complete');
121+
elseif($o['status'] == 1)
122+
$o['status'] = Pommo::_T('Processing');
123+
else
124+
$o['status'] = Pommo::_T('Cancelled');
125+
$row['status'] = $o['status'];
126+
127+
// calculate mails per hour
128+
if(!empty($o['end']) && !empty($o['sent'])) {
129+
$runtime = strtotime($o['end'])-strtotime($o['start']);
130+
$mph = ($runtime == 0)? $o['sent']*3600 : round(($o['sent'] / ($runtime)) * 3600);
131+
}
132+
else
133+
$mph = 0;
134+
135+
$row['end'] .= '<br />'.$mph.' '.Pommo::_T('Mails/Hour');
136+
137+
array_push($records,$row);
138+
}
139+
140+
// format for JSON output to jqGrid
141+
$json->add(array(
142+
'page' => $state['page'],
143+
'total' => $state['pages'],
144+
'records' => PommoMailing::tally(),
145+
'rows' => $records
146+
)
147+
);
148+
$json->serve();
149+
?>
+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?php
2+
/**
3+
* Copyright (C) 2005, 2006, 2007, 2008 Brice Burgess <[email protected]>
4+
*
5+
* This file is part of poMMo (http://www.pommo.org)
6+
*
7+
* poMMo is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published
9+
* by the Free Software Foundation; either version 2, or any later version.
10+
*
11+
* poMMo is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty
13+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
14+
* the GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with program; see the file docs/LICENSE. If not, write to the
18+
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19+
*/
20+
21+
/**********************************
22+
INITIALIZATION METHODS
23+
*********************************/
24+
require ('../../../bootstrap.php');
25+
Pommo::requireOnce($pommo->_baseDir.'inc/helpers/mailings.php');
26+
27+
$pommo->init();
28+
$logger = & $pommo->_logger;
29+
30+
31+
/**********************************
32+
SETUP TEMPLATE, PAGE
33+
*********************************/
34+
Pommo::requireOnce($pommo->_baseDir.'inc/classes/template.php');
35+
$smarty = new PommoTemplate();
36+
37+
// fetch the mailing IDs
38+
$mailingIDS = $_REQUEST['mailings'];
39+
if(!is_array($mailingIDS))
40+
$mailingIDS = array($mailingIDS);
41+
42+
43+
/**********************************
44+
JSON OUTPUT INITIALIZATION
45+
*********************************/
46+
Pommo::requireOnce($pommo->_baseDir.'inc/classes/json.php');
47+
$json = new PommoJSON(false); // do not toggle escaping
48+
49+
// EXAMINE CALL
50+
switch ($_REQUEST['call']) {
51+
case 'notice':
52+
foreach($mailingIDS as $id) {
53+
$logger->AddMsg('<br /><br />###'. sprintf(Pommo::_T('Displaying notices for mailing %s'),PommoMailing::getSubject($id)).' ###<br /><br />');
54+
$notices = PommoMailing::getNotices($id);
55+
$logger->AddMsg($notices);
56+
}
57+
break;
58+
59+
case 'reload' :
60+
61+
Pommo::requireOnce($pommo->_baseDir.'inc/helpers/groups.php');
62+
63+
$mailing = current(PommoMailing::get(array('id' => $_REQUEST['mailings'])));
64+
65+
// change group name to ID
66+
$groups = PommoGroup::getNames();
67+
$gid = 'all';
68+
foreach($groups as $group)
69+
if ($group['name'] == $mailing['group'])
70+
$gid = $group['id'];
71+
72+
PommoAPI::stateReset(array('mailing'));
73+
74+
// if this is a plain text mailing, switch body + altbody.
75+
if($mailing['ishtml'] == 'off') {
76+
$mailing['altbody'] = $mailing['body'];
77+
$mailing['body'] = null;
78+
}
79+
80+
// Initialize page state with default values overriden by those held in $_REQUEST
81+
$state =& PommoAPI::stateInit('mailing',array(
82+
'fromname' => $mailing['fromname'],
83+
'fromemail' => $mailing['fromemail'],
84+
'frombounce' => $mailing['frombounce'],
85+
'list_charset' => $mailing['charset'],
86+
'mailgroup' => $gid,
87+
'subject' => $mailing['subject'],
88+
'body' => $mailing['body'],
89+
'altbody' => $mailing['altbody']
90+
));
91+
92+
Pommo::redirect($pommo->_baseUrl.'admin/mailings/mailings_start.php');
93+
break;
94+
95+
case 'delete' :
96+
$deleted = PommoMailing::delete($mailingIDS);
97+
$logger->addMsg(Pommo::_T('Please Wait').'...');
98+
99+
$params = $json->encode(array('ids' => $mailingIDS));
100+
$smarty->assign('callbackFunction','deleteMailing');
101+
$smarty->assign('callbackParams',$params);
102+
break;
103+
104+
default:
105+
$logger->AddErr('invalid call');
106+
break;
107+
}
108+
109+
$smarty->display('admin/rpc.tpl');
110+
?>

0 commit comments

Comments
 (0)