Issues (381)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

admin/bmh.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * ****************************************************************************
4
 *  - A Project by Developers TEAM For Xoops - ( https://xoops.org )
5
 * ****************************************************************************
6
 *  XNEWSLETTER - MODULE FOR XOOPS
7
 *  Copyright (c) 2007 - 2012
8
 *  Goffy ( wedega.com )
9
 *
10
 *  You may not change or alter any portion of this comment or credits
11
 *  of supporting developers from this source code or any supporting
12
 *  source code which is considered copyrighted (c) material of the
13
 *  original comment or credit authors.
14
 *
15
 *  This program is distributed in the hope that it will be useful,
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *  GNU General Public License for more details.
19
 *  ---------------------------------------------------------------------------
20
 * @copyright  Goffy ( wedega.com )
21
 * @license    GNU General Public License 2.0
22
 * @package    xnewsletter
23
 * @author     Goffy ( [email protected] )
24
 *
25
 * ****************************************************************************
26
 */
27
28
use Xmf\Request;
29
30
$currentFile = basename(__FILE__);
31
require_once __DIR__ . '/admin_header.php';
32
xoops_cp_header();
33
34
// set template
35
$templateMain = 'xnewsletter_admin_bmh.tpl';
36
37
// We recovered the value of the argument op in the URL$
38
$op          = Request::getString('op', 'list');
39
$bmh_id      = Request::getInt('bmh_id', 0);
40
$bmh_measure = Request::getInt('bmh_measure', 0);
41
$filter      = Request::getInt('bmh_measure_filter', _XNEWSLETTER_BMH_MEASURE_VAL_ALL);
42
43
$GLOBALS['xoopsTpl']->assign('xnewsletter_url', XNEWSLETTER_URL);
44
$GLOBALS['xoopsTpl']->assign('xnewsletter_icons_url', XNEWSLETTER_ICONS_URL);
45
46
switch ($op) {
47
    case 'bmh_delsubscr':
48
        if (true === Request::getBool('ok', false, 'POST')) {
49
            $count_err = 0;
50
51
            $bmhObj    = $helper->getHandler('Bmh')->get($bmh_id);
52
            $bmh_email = $bmhObj->getVar('bmh_email');
53
54
            $sql = "SELECT subscr_id FROM {$xoopsDB->prefix('xnewsletter_subscr')}";
55
            $sql .= " WHERE (subscr_email='{$bmh_email}')";
56
            $sql .= ' LIMIT 1;';
57
            $user = $xoopsDB->query($sql);
58
            if ($user) {
59
                $row_user  = $xoopsDB->fetchRow($user);
60
                $subscr_id = (int)$row_user[0];
61
            }
62
            if (0 == $subscr_id) {
63
                //set bmh_measure for all entries in bmh with this email
64
                $sql_upd_measure = "UPDATE {$xoopsDB->prefix('xnewsletter_bmh')} SET `bmh_measure` = '" . _XNEWSLETTER_BMH_MEASURE_VAL_NOTHING . "'";
65
                $sql_upd_measure .= " WHERE ((`{$xoopsDB->prefix('xnewsletter_bmh')}`.`bmh_email` ='{$bmh_email}') AND (`{$xoopsDB->prefix('xnewsletter_bmh')}`.`bmh_measure` ='0'))";
66
                $xoopsDB->query($sql_upd_measure);
67
                redirect_header('?op=list', 3, _AM_XNEWSLETTER_BMH_ERROR_NO_SUBSCRID);
68
            }
69
            $subscrObj = $helper->getHandler('Subscr')->get($subscr_id);
70
71
            // delete subscriber
72
            if (!$helper->getHandler('Subscr')->delete($subscrObj, true)) {
73
                $actionprot_err = $subscrObj->getHtmlErrors() . '<br><br><br>';
74
                ++$count_err;
75
            }
76
77
            //delete subscription
78
            $catsubscrCriteria = new \CriteriaCompo();
79
            $catsubscrCriteria->add(new \Criteria('catsubscr_subscrid', $subscr_id));
80
            $catsubscrsCount = $helper->getHandler('Catsubscr')->getCount($catsubscrCriteria);
81
            if ($catsubscrsCount > 0) {
82
                $catsubscrObjs = $helper->getHandler('Catsubscr')->getAll($catsubscrCriteria);
83
                foreach ($catsubscrObjs as $catsubscr_id => $catsubscrObj) {
84
                    $catsubscrObj    = $helper->getHandler('Catsubscr')->get($catsubscrObj->getVar('catsubscr_id'));
85
                    $catObj          = $helper->getHandler('Cat')->get($catsubscrObj->getVar('catsubscr_catid'));
86
                    $cat_mailinglist = $catObj->getVar('cat_mailinglist');
87
88 View Code Duplication
                    if ($helper->getHandler('Catsubscr')->delete($catsubscrObj, true)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
89
                        //handle mailinglists
90
                        if ($cat_mailinglist > 0) {
91
                            require_once XOOPS_ROOT_PATH . '/modules/xnewsletter/include/mailinglist.php';
92
                            subscribingMLHandler(_XNEWSLETTER_MAILINGLIST_UNSUBSCRIBE, $subscr_id, $cat_mailinglist);
93
                        }
94
                    } else {
95
                        $actionprot_err .= $catsubscrObj->getHtmlErrors();
96
                        ++$count_err;
97
                    }
98
                }
99
            }
100
101
            if (0 == $count_err) {
102
                redirect_header("?op=handle_bmh&bmh_id={$bmh_id}&bmh_measure=" . _XNEWSLETTER_BMH_MEASURE_VAL_DELETE . "&filter={$filter}", 3, _AM_XNEWSLETTER_FORMDELOK);
103
            } else {
104
                $GLOBALS['xoopsTpl']->assign('error', $actionprot_err);
105
            }
106
        } else {
107
            xoops_confirm(['ok' => true, 'bmh_id' => $bmh_id, 'op' => 'bmh_delsubscr', 'filter' => $filter], $currentFile, sprintf(_AM_XNEWSLETTER_BMH_MEASURE_DELETE_SURE));
108
        }
109
        break;
110
    case 'handle_bmh':
111
        if (0 == $bmh_id) {
112
            redirect_header($currentFile, 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
113
        }
114
        if (0 == $bmh_measure) {
115
            redirect_header($currentFile, 3, _AM_XNEWSLETTER_ERROR_NO_VALID_ID);
116
        }
117
118
        $bmhObj = $helper->getHandler('Bmh')->get($bmh_id);
119
120
        if (_XNEWSLETTER_BMH_MEASURE_VAL_DELETE == $bmhObj->getVar('bmh_measure')) {
121
            redirect_header("?op=list&filter={$filter}'", 3, _AM_XNEWSLETTER_BMH_MEASURE_ALREADY_DELETED);
122
        }
123
124
        $bmh_email = $bmhObj->getVar('bmh_email');
125
126
        if (_XNEWSLETTER_BMH_MEASURE_VAL_QUIT == $bmh_measure) {
127
            $sql = "UPDATE `{$xoopsDB->prefix('xnewsletter_subscr')}` INNER JOIN `{$xoopsDB->prefix('xnewsletter_catsubscr')}` ON `subscr_id` = `catsubscr_subscrid`";
128
            $sql .= ' SET `catsubscr_quited` = ' . time();
129
            $sql .= " WHERE (((`subscr_email`)='{$bmh_email}'))";
130
            if (!$result = $xoopsDB->queryF($sql)) {
131
                die('MySQL-Error: ' . $GLOBALS['xoopsDB']->error());
132
            }
133
        }
134
        //set bmh_measure for all entries in bmh with this email
135
        $sql_upd = "UPDATE {$xoopsDB->prefix('xnewsletter_bmh')}";
136
        $sql_upd .= " SET `bmh_measure` = '{$bmh_measure}', `bmh_submitter` = '{$xoopsUser->uid()}', `bmh_created` = '" . time() . "'";
137
        $sql_upd .= " WHERE ((`{$xoopsDB->prefix('xnewsletter_bmh')}`.`bmh_email` ='{$bmh_email}') AND (`{$xoopsDB->prefix('xnewsletter_bmh')}`.`bmh_measure` ='0'))";
138
        if (!$result = $xoopsDB->queryF($sql_upd)) {
139
            die('MySQL-Error: ' . $GLOBALS['xoopsDB']->error());
140
        }
141
142
        redirect_header("?op=list&filter={$filter}", 3, _AM_XNEWSLETTER_FORMOK);
143
        break;
144
    case 'run_bmh':
145
        require_once __DIR__ . '/bmh_callback_database.php';
146
        require_once XOOPS_ROOT_PATH . '/modules/xnewsletter/include/phpmailer_bmh/class.phpmailer-bmh.php';
147
148
        $accountCriteria = new \CriteriaCompo();
149
        $accountCriteria->add(new \Criteria('accounts_use_bmh', '1'));
150
        $accountsCount = $helper->getHandler('Accounts')->getCount($accountCriteria);
151
152
        if ($accountsCount > 0) {
153
            $accountObjs = $helper->getHandler('Accounts')->getAll($accountCriteria);
154
            $result_bmh  = _AM_XNEWSLETTER_BMH_SUCCESSFUL . '<br>';
155
156
            foreach ($accountObjs as $account_id => $accountObj) {
157
                $bmh          = new BounceMailHandler();
158
                $bmh->verbose = VERBOSE_SIMPLE; //VERBOSE_REPORT; //VERBOSE_DEBUG; //VERBOSE_QUIET; // default is VERBOSE_SIMPLE
159
                //$bmh->use_fetchstructure = true; // true is default, no need to speficy
160
                //$bmh->testmode           = true; // false is default, no need to specify
161
                //$bmh->debug_body_rule    = false; // false is default, no need to specify
162
                //$bmh->debug_dsn_rule     = false; // false is default, no need to specify
163
                //$bmh->purge_unprocessed  = false; // false is default, no need to specify
164
                $bmh->disable_delete = true; // detected mails will be not deleted, default is false
165
166
                // for local mailbox (to process .EML files)
167
                //$bmh->openLocalDirectory('/home/email/temp/mailbox');
168
                //$bmh->processMailbox();
169
170
                // for remote mailbox
171
                $bmh->mailhost         = $accountObj->getVar('accounts_server_in'); // your mail server
172
                $bmh->mailbox_username = $accountObj->getVar('accounts_username'); // your mailbox username
173
                $bmh->mailbox_password = $accountObj->getVar('accounts_password'); // your mailbox password
174
                $bmh->port             = $accountObj->getVar('accounts_port_in'); // the port to access your mailbox, default is 143
175
                if (_XNEWSLETTER_ACCOUNTS_TYPE_VAL_POP3 == $accountObj->getVar('accounts_type')) {
176
                    $bmh->service = 'pop3'; // the service to use (imap or pop3), default is 'imap'
177
                } else {
178
                    $bmh->service = 'imap'; // the service to use (imap or pop3), default is 'imap'
179
                }
180
                $bmh->service_option = $accountObj->getVar('accounts_securetype_in'); // the service options (none, tls, notls, ssl, etc.), default is 'notls'
181
                $bmh->boxname        = $accountObj->getVar('accounts_inbox'); // the mailbox to access, default is 'INBOX'
182
                $verif_movehard      = '1' == $accountObj->getVar('accounts_movehard') ? true : false;
183
                $bmh->moveHard       = $verif_movehard; // default is false
184
                $bmh->hardMailbox    = $accountObj->getVar('accounts_hardbox'); // default is 'INBOX.hard' - NOTE: must start with 'INBOX.'
185
                $verif_movesoft      = '1' == $accountObj->getVar('accounts_movesoft') ? true : false;
186
                $bmh->moveSoft       = $verif_movesoft; // default is false
187
                $bmh->softMailbox    = $accountObj->getVar('accounts_softbox'); // default is 'INBOX.soft' - NOTE: must start with 'INBOX.'
188
                //$bmh->deleteMsgDate      = '2009-01-05'; // format must be as 'yyyy-mm-dd'
189
190
                // rest used regardless what type of connection it is
191
                $bmh->openMailbox();
192
                $bmh->processMailbox();
193
194
                $result_bmh .= str_replace('%b', $accountObj->getVar('accounts_yourmail'), _AM_XNEWSLETTER_BMH_RSLT);
195
                $result_bmh = str_replace('%r', $bmh->result_total, $result_bmh);
196
                $result_bmh = str_replace('%a', $bmh->result_processed, $result_bmh);
197
                $result_bmh = str_replace('%n', $bmh->result_unprocessed, $result_bmh);
198
                $result_bmh = str_replace('%m', $bmh->result_moved, $result_bmh);
199
                $result_bmh = str_replace('%d', $bmh->result_deleted, $result_bmh);
200
            }
201
            redirect_header($currentFile, 3, $result_bmh);
202
        } else {
203
            redirect_header($currentFile, 3, _AM_XNEWSLETTER_BMH_ERROR_NO_ACTIVE);
204
        }
205
        break;
206
    case 'list':
207
    default:
208
        $GLOBALS['xoopsTpl']->assign('filter', $filter);
209
210
        $adminObject->displayNavigation(basename(__FILE__));
211
        $adminObject->addItemButton(_AM_XNEWSLETTER_RUNBMH, '?op=run_bmh', 'add');
212
        $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->renderButton('left'));
213
214
        $arr_measure_type = [
215
            _XNEWSLETTER_BMH_MEASURE_VAL_ALL     => _AM_XNEWSLETTER_BMH_MEASURE_ALL,
216
            _XNEWSLETTER_BMH_MEASURE_VAL_PENDING => _AM_XNEWSLETTER_BMH_MEASURE_PENDING,
217
            _XNEWSLETTER_BMH_MEASURE_VAL_NOTHING => _AM_XNEWSLETTER_BMH_MEASURE_NOTHING,
218
            _XNEWSLETTER_BMH_MEASURE_VAL_QUIT    => _AM_XNEWSLETTER_BMH_MEASURE_QUITED,
219
            _XNEWSLETTER_BMH_MEASURE_VAL_DELETE  => _AM_XNEWSLETTER_BMH_MEASURE_DELETED,
220
        ];
221
222
        $limit       = $helper->getConfig('adminperpage');
223
        $bhmCriteria = new \CriteriaCompo();
224
        if ($filter > -1) {
225
            $bhmCriteria->add(new \Criteria('bmh_measure', $filter));
226
        }
227
        $bhmCriteria->setSort('bmh_id');
228
        $bhmCriteria->setOrder('DESC');
229
        $bhmCount = $helper->getHandler('Bmh')->getCount($bhmCriteria);
230
        $start    = Request::getInt('start', 0);
231
        $bhmCriteria->setStart($start);
232
        $bhmCriteria->setLimit($limit);
233
        $bhmObjs = $helper->getHandler('Bmh')->getAll($bhmCriteria);
234 View Code Duplication
        if ($bhmCount > $limit) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
235
            require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
236
            $pagenav = new \XoopsPageNav($bhmCount, $limit, $start, 'start', 'op=list');
237
            $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
238
        }
239
240
        //form to filter result
241
        $form_filter = "<form id='form_filter' enctype='multipart/form-data' method='post' action='{$currentFile}' name='form_filter'>";
242
243
        $checked = (-1 == $filter) ? 'checked' : '';
244
        $form_filter .= "<input id='bmh_measure_all' type='radio' {$checked} value='-1' title='" . _AM_XNEWSLETTER_BMH_MEASURE . "' name='bmh_measure_filter' onclick='submit()'>
245
            <label for='bmh_measure_all' name='bmh_measure_all'>" . _AM_XNEWSLETTER_BMH_MEASURE_ALL . '</label>';
246
247
        $checked = (_XNEWSLETTER_BMH_MEASURE_VAL_PENDING == $filter) ? 'checked' : '';
248
        $form_filter .= "<input id='bmh_measure0' type='radio' {$checked} value='" . _XNEWSLETTER_BMH_MEASURE_VAL_PENDING . "' title='" . _AM_XNEWSLETTER_BMH_MEASURE . "' name='bmh_measure_filter' onclick='submit()'>
249
            <label for='bmh_measure0' name='bmh_measure0'>" . _AM_XNEWSLETTER_BMH_MEASURE_PENDING . '</label>';
250
251
        $checked = (_XNEWSLETTER_BMH_MEASURE_VAL_NOTHING == $filter) ? 'checked' : '';
252
        $form_filter .= "<input id='bmh_measure1' type='radio' {$checked} value='" . _XNEWSLETTER_BMH_MEASURE_VAL_NOTHING . "' title='" . _AM_XNEWSLETTER_BMH_MEASURE . "' name='bmh_measure_filter' onclick='submit()'>
253
            <label for='bmh_measure1' name='bmh_measure1'>" . _AM_XNEWSLETTER_BMH_MEASURE_NOTHING . '</label>';
254
255
        $checked = (_XNEWSLETTER_BMH_MEASURE_VAL_QUIT == $filter) ? 'checked' : '';
256
        $form_filter .= "<input id='bmh_measure2' type='radio' {$checked} value='" . _XNEWSLETTER_BMH_MEASURE_VAL_QUIT . "' title='" . _AM_XNEWSLETTER_BMH_MEASURE . "' name='bmh_measure_filter' onclick='submit()'>
257
            <label for='bmh_measure2' name='bmh_measure2'>" . _AM_XNEWSLETTER_BMH_MEASURE_QUITED . '</label>';
258
259
        $checked = (_XNEWSLETTER_BMH_MEASURE_VAL_DELETE == $filter) ? 'checked' : '';
260
        $form_filter .= "<input id='bmh_measure3' type='radio' {$checked} value='" . _XNEWSLETTER_BMH_MEASURE_VAL_DELETE . "' title='" . _AM_XNEWSLETTER_BMH_MEASURE . "' name='bmh_measure_filter' onclick='submit()'>
261
            <label for='bmh_measure3' name='bmh_measure3'>" . _AM_XNEWSLETTER_BMH_MEASURE_DELETED . '</label>';
262
        $form_filter .= '</form>';
263
        $GLOBALS['xoopsTpl']->assign('form_filter', $form_filter);
264
265
        if ($bhmCount > 0) {
266
            $GLOBALS['xoopsTpl']->assign('bhmCount', $bhmCount);
267
268
            $class = 'odd';
269
            foreach ($bhmObjs as $bhm_id => $bhmObj) {
270
                $bmh_item = $bhmObj->getValuesBmh();
271
                $GLOBALS['xoopsTpl']->append('bmh_list', $bmh_item);
272
                unset($bmh_item);
273
            }
274
        } else {
275
            $GLOBALS['xoopsTpl']->assign('show_none', sprintf(_AM_XNEWSLETTER_BMH_MEASURE_SHOW_NONE, $arr_measure_type[$filter]));
276
        }
277
        break;
278
    case 'save_bmh':
279
        if (!$GLOBALS['xoopsSecurity']->check()) {
280
            redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
281
        }
282
283
        $bmhObj = $helper->getHandler('Bmh')->get($bmh_id);
284
        $bmhObj->setVar('bmh_rule_no',    Request::getString('bmh_rule_no', ''));
285
        $bmhObj->setVar('bmh_rule_cat',   Request::getString('bmh_rule_cat', ''));
286
        $bmhObj->setVar('bmh_bouncetype', Request::getString('bmh_bouncetype', ''));
287
        $bmhObj->setVar('bmh_remove',     Request::getString('bmh_remove', ''));
288
        $bmh_email = Request::getString('bmh_email', '');
289
        $bmh_email = filter_var($bmh_email, FILTER_SANITIZE_EMAIL);
290
        $bmh_email = xnewsletter_checkEmail($bmh_email);
291
        $bmhObj->setVar('bmh_email', $bmh_email);
292
        $bmhObj->setVar('bmh_subject',    Request::getString('bmh_subject', ''));
293
        $bmhObj->setVar('bmh_measure',    Request::getInt('bmh_measure', 0));
294
        $bmhObj->setVar('bmh_submitter',  Request::getInt('bmh_submitter', 0));
295
        $bmhObj->setVar('bmh_created',    Request::getInt('bmh_created', 0));
296
297
        if ($helper->getHandler('Bmh')->insert($bmhObj)) {
298
            redirect_header('?op=list', 3, _AM_XNEWSLETTER_FORMOK);
299
        }
300
301
        $GLOBALS['xoopsTpl']->assign('error', $bmhObj->getHtmlErrors());
302
        $form = $bmhObj->getForm();
303
        $GLOBALS['xoopsTpl']->assign('form', $form->render());
304
        break;
305
    case 'edit_bmh':
306
        $adminObject->displayNavigation(basename(__FILE__));
307
        $adminObject->addItemButton(_AM_XNEWSLETTER_BMHLIST, '?op=list', 'list');
308
        $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->renderButton('left'));
309
310
        $bmhObj = $helper->getHandler('Bmh')->get($bmh_id);
311
        $form   = $bmhObj->getForm();
312
        $GLOBALS['xoopsTpl']->assign('form', $form->render());
313
        break;
314 View Code Duplication
    case 'delete_bmh':
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
315
        $bmhObj = $helper->getHandler('Bmh')->get($bmh_id);
316
        if (true === Request::getBool('ok', false, 'POST')) {
317
            if (!$GLOBALS['xoopsSecurity']->check()) {
318
                redirect_header($currentFile, 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors()));
319
            }
320
            if ($helper->getHandler('Bmh')->delete($bmhObj)) {
321
                redirect_header($currentFile, 3, _AM_XNEWSLETTER_FORMDELOK);
322
            } else {
323
                $GLOBALS['xoopsTpl']->assign('error', $bmhObj->getHtmlErrors());
324
            }
325
        } else {
326
            xoops_confirm(['ok' => true, 'bmh_id' => $bmh_id, 'op' => 'delete_bmh'], $_SERVER['REQUEST_URI'], sprintf(_AM_XNEWSLETTER_FORMSUREDEL, $bmhObj->getVar('bmh_email')));
327
        }
328
        break;
329
}
330
require_once __DIR__ . '/admin_footer.php';
331
332
/**
333
 * @return float
334
 */
335
function microtime_float()
336
{
337
    list($usec, $sec) = explode(' ', microtime());
338
339
    return ((float)$usec + (float)$sec);
340
}
341