]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/admins_functions.php
Unknown module in non-HTML mode, debug comments removed :(
[mailer.git] / inc / libs / admins_functions.php
index 076213c0aea5ae2ba63b682c6d521b55a8245fbd..a750428dedf22ae9f5e949c23f90302e4f5a6a75 100644 (file)
@@ -156,7 +156,7 @@ LIMIT 1",
 // Change a lot admin account
 function adminsChangeAdminAccount ($postData) {
        // Begin the update
-       $cache_update = 0;
+       $cache_update = '0';
        foreach ($postData['login'] as $id => $login) {
                // Secure id number
                $id = bigintval($id);
@@ -170,7 +170,7 @@ function adminsChangeAdminAccount ($postData) {
                        $hash = generateHash($postData['pass1'][$id]);
 
                        // Save password when set
-                       if (!empty($postData['pass1'][$id])) $add = sprintf(", password='%s'", SQL_ESCAPE($hash));
+                       if (!empty($postData['pass1'][$id])) $add = sprintf(", `password`='%s'", SQL_ESCAPE($hash));
 
                        // Get admin's id
                        $adminId = getCurrentAdminId();
@@ -339,7 +339,7 @@ function adminsDeleteAdminAccount ($postData) {
 // Remove the given accounts
 function adminsRemoveAdminAccount ($postData) {
        // Begin removal
-       $cache_update = 0;
+       $cache_update = '0';
        foreach ($postData['sel'] as $id => $del) {
                // Secure id number
                $id = bigintval($id);
@@ -409,7 +409,7 @@ function sendAdminsEmails ($subj, $template, $content, $UID) {
        // Check which admin shall receive this mail
        $result = SQL_QUERY_ESC("SELECT `admin_id` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `admin_id` ASC",
                array($template), __FUNCTION__, __LINE__);
-       if (SQL_NUMROWS($result) == 0) {
+       if (SQL_NUMROWS($result) == '0') {
                // Create new entry (to all admins)
                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins_mails` (`admin_id`, `mail_template`) VALUES (0, '%s')",
                        array($template), __FUNCTION__, __LINE__);
@@ -441,7 +441,7 @@ function sendAdminsEmails ($subj, $template, $content, $UID) {
                                        $UID
                                ));
                        }
-               } elseif ($adminId == 0) {
+               } elseif ($adminId == '0') {
                        // Select all email adresses
                        $result = SQL_QUERY("SELECT `email` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC",
                                __FUNCTION__, __LINE__);