2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 10/21/2009 *
4 * =================== Last change: 10/21/2009 *
6 * -------------------------------------------------------------------- *
7 * File : other_functions.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Special functions for other extension *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Spezielle Funktion fuer Debug-Erweiterung *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2013 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // Displays all SQL queries with num rows, affected rows and timings
44 function displayDebugSqls () {
45 // Walk through all SQLs
47 foreach ($GLOBALS['debug_sqls'] as $content) {
48 // Translate/add some data
50 $content['timing'] = translateComma($content['timing'] * 1000);
53 $OUT .= loadTemplate('admin_other_sqls_row', TRUE, $content);
60 $GLOBALS['__page_footer'] .= loadTemplate('admin_other_sqls', TRUE, $OUT);
63 //-----------------------------------------------------------------------------
64 // Wrapper functions for configuration entries
65 //-----------------------------------------------------------------------------
67 // Getter for 'reject_url' config entry
68 function getRejectUrl () {
70 if (!isset($GLOBALS[__FUNCTION__])) {
72 $GLOBALS[__FUNCTION__] = getConfig('reject_url');
76 return $GLOBALS[__FUNCTION__];
79 // "Getter" for max_send
80 function getMaxSend () {
82 if (!isset($GLOBALS[__FUNCTION__])) {
84 $GLOBALS[__FUNCTION__] = getConfig('max_send');
88 return $GLOBALS[__FUNCTION__];
91 // Getter for 'check_double_email'
92 function getCheckDoubleEmail () {
93 // Is the cache entry set?
94 if (!isset($GLOBALS[__FUNCTION__])) {
95 // No, so determine it
96 $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
99 // Return cached entry
100 return $GLOBALS[__FUNCTION__];
103 // Checks whether 'check_double_email' is 'Y'
104 function isCheckDoubleEmailEnabled () {
105 // Is the cache entry set?
106 if (!isset($GLOBALS[__FUNCTION__])) {
107 // No, so determine it
108 $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
111 // Return cached entry
112 return $GLOBALS[__FUNCTION__];
115 // "Getter" for activate_xchange
116 function getActivateXchange () {
118 if (!isset($GLOBALS[__FUNCTION__])) {
120 $GLOBALS[__FUNCTION__] = getConfig('activate_xchange');
124 return $GLOBALS[__FUNCTION__];
127 // "Getter" for admin_notify
128 function getAdminNotify () {
130 if (!isset($GLOBALS[__FUNCTION__])) {
132 $GLOBALS[__FUNCTION__] = getConfig('admin_notify');
136 return $GLOBALS[__FUNCTION__];
139 // "Getter" for display_debug_sqls
140 function getDisplayDebugSqls () {
142 if (!isset($GLOBALS[__FUNCTION__])) {
144 $GLOBALS[__FUNCTION__] = getConfig('display_debug_sqls');
148 return $GLOBALS[__FUNCTION__];
151 // "Getter" for min_age
152 function getMinAge () {
154 if (!isset($GLOBALS[__FUNCTION__])) {
156 $GLOBALS[__FUNCTION__] = getConfig('min_age');
160 return $GLOBALS[__FUNCTION__];