]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
debug_report_bug() should be used as a replacement for app_die() calls
[mailer.git] / inc / mysql-manager.php
index 44e848747020d5efa5fb0dd5cc999045bfc4bde4..c74bf46c3c002136db1c27d6aa9008a0e244306d 100644 (file)
@@ -79,7 +79,7 @@ function getModuleTitle ($module) {
        // Still no luck or empty title?
        if (empty($data['title'])) {
                // No name found
-               $data['title'] = sprintf("%s (%s)", getMessage('LANG_UNKNOWN_MODULE'), $module);
+               $data['title'] = getMaskedMessage('UNKNOWN_MODULE_DETECTED', $module);
                if ((is_resource($result)) && (SQL_HASZERONUMS($result))) {
                        // Add module to database
                        $dummy = checkModulePermissions($module);
@@ -631,7 +631,7 @@ function fetchUserData ($userid, $column = 'userid') {
                // Don't look for invalid userids...
                if ($userid < 1) {
                        // Invalid, so abort here
-                       debug_report_bug('User id ' . $userid . ' is invalid.');
+                       debug_report_bug(__FUNCTION__, __LINE__, 'User id ' . $userid . ' is invalid.');
                } elseif (isUserDataValid()) {
                        // Use cache, so it is fine
                        return true;
@@ -702,6 +702,11 @@ function fetchUserData ($userid, $column = 'userid') {
 
 // This patched function will reduce many SELECT queries for the specified or current admin login
 function isAdmin ($adminLogin = '') {
+       // No admin in installation phase!
+       if ((isInstallationPhase()) || (!isAdminRegistered())) {
+               return false;
+       } // END - if
+
        // Init variables
        $ret = false;
        $passCookie = '';
@@ -791,7 +796,7 @@ function addMaxReceiveList ($mode, $default = '', $return = false) {
                $OUT = loadTemplate(($mode . '_receive_table'), true, $OUT);
        } else {
                // Maybe the admin has to setup some maximum values?
-               debug_report_bug('Nothing is being done here?');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Nothing is being done here?');
        }
 
        // Free result
@@ -1557,7 +1562,7 @@ function generateOptionList ($table, $id, $name, $default='', $special='', $wher
                        } // END - foreach
                } else {
                        // Problem in request
-                       debug_report_bug('Not all are arrays: id[' . count($id) . ']=' . gettype($id) . ',name[' . count($name) . ']=' . gettype($name));
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Not all are arrays: id[' . count($id) . ']=' . gettype($id) . ',name[' . count($name) . ']=' . gettype($name));
                }
        } else {
                // Data from database
@@ -1921,7 +1926,7 @@ function generateReceiverList ($cat, $receiver, $mode = '') {
        } // END - if
 
        // Exclude users in holiday?
-       if (getExtensionVersion('holiday') >= '0.1.3') {
+       if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
                // Add something for the holiday extension
                $CAT_WHERE .= " AND d.`holiday_active`='N'";
        } // END - if