$GLOBALS['pagestats']['time_start'] = $now['sec'] * 1000000 + $now['usec']; $GLOBALS['pagestats']['number_of_queries'] = 0; # load all required files require_once dirname(__FILE__) . '/init.php'; require_once dirname(__FILE__) . '/' . $GLOBALS['database_module']; include_once dirname(__FILE__) . '/../texts/english.inc'; include_once dirname(__FILE__) . '/../texts/' . $GLOBALS['language_module']; include_once dirname(__FILE__) . '/languages.php'; require_once dirname(__FILE__) . '/defaultconfig.php'; require_once dirname(__FILE__) . '/connect.php'; include_once dirname(__FILE__) . '/lib.php'; require_once dirname(__FILE__) . '/inc/netlib.php'; require_once dirname(__FILE__) . '/inc/interfacelib.php'; $systemTimer = new timer(); // do a loose check, if the token is there, it needs to be valid. verifyCsrfGetToken(false); if (!empty($_SESSION['hasconf']) || Sql_Table_exists($tables['config'], 1)) { $_SESSION['hasconf'] = true; ### Activate all plugins /* already done in pluginlib */ //foreach ($GLOBALS['plugins'] as $plugin) { //$plugin->activate(); //} } if (!empty($_GET['page']) && $_GET['page'] == 'logout' && empty($_GET['err'])) { foreach ($GLOBALS['plugins'] as $pluginname => $plugin) { $plugin->logout(); } $_SESSION['adminloggedin'] = ''; $_SESSION['logindetails'] = ''; session_destroy();
#0012081: Add new 'Mark as sent' button if (isset($_GET['markSent'])) { verifyCsrfGetToken(); $markSent = sprintf('%d', $_GET['markSent']); $action_result .= $GLOBALS['I18N']->get('Marking as sent ') . " {$markSent} .."; $result = Sql_query(sprintf('update %s set status = "sent", repeatinterval = 0,requeueinterval = 0 where id = %d and (status = "suspended") %s', $tables['message'], $markSent, $ownerselect_and)); $suc6 = Sql_Affected_Rows(); if ($suc6) { $action_result .= '... ' . $GLOBALS['I18N']->get('Done'); } else { $action_result .= '... ' . $GLOBALS['I18N']->get('Failed'); } $action_result .= '<br /><hr /><br />'; } if (isset($_GET['action'])) { verifyCsrfGetToken(); switch ($_GET['action']) { case 'suspall': $action_result .= $GLOBALS['I18N']->get('Suspending all') . ' ..'; $result = Sql_query(sprintf('update %s set status = "suspended" where (status = "inprocess" or status = "submitted") %s', $tables['message'], $ownerselect_and)); $suc6 = Sql_Affected_Rows(); if ($suc6) { $action_result .= "... {$suc6} " . $GLOBALS['I18N']->get('Done'); } else { $action_result .= '... ' . $GLOBALS['I18N']->get('Failed'); } $action_result .= '<br /><hr /><br />'; break; case 'markallsent': $action_result .= $GLOBALS['I18N']->get('Marking all as sent ') . ' ..'; $result = Sql_query(sprintf('update %s set status = "sent", repeatinterval = 0,requeueinterval = 0 where (status = "suspended") %s', $tables['message'], $markSent, $ownerselect_and));
return 0; } } print '<br />'; giveAlternative($table, $delete, $attributeid); } return 1; } if (isset($_GET['delete'])) { if (!verifyCsrfGetToken(true)) { print Error(s('No Access')); return; } deleteItem($table, $id, sprintf('%d', $_GET['delete'])); } elseif (isset($_GET['deleteall'])) { if (!verifyCsrfGetToken(true)) { print Error(s('No Access')); return; } $count = 0; $errcount = 0; $res = Sql_Query("select id from {$table}"); while ($row = Sql_Fetch_Row($res)) { if (deleteItem($table, $id, $row[0])) { ++$count; } else { ++$errcount; if ($errcount > 10) { print $GLOBALS['I18N']->get('* Too many errors, quitting') . "<br /><br /><br />\n"; break; }