Some more cleanups/improvements:
[mailer.git] / inc / modules / admin / what-unlock_emails.php
index 52faf0d8a9498ad94bb1af7966f2f570c9aea5c6..63affb3672e111feae1b9b1e394dd161559f489a 100644 (file)
@@ -82,9 +82,6 @@ LIMIT 1",
                                        // Load data
                                        $content = SQL_FETCHARRAY($result);
 
-                                       // Free result
-                                       SQL_FREERESULT($result);
-
                                        // Is the surfbar installed?
                                        // @TODO Rewrite these if-blocks to a filter
                                        if ((isExtensionActive('surfbar')) && (getConfig('surfbar_migrate_order') == 'Y')) {
@@ -112,6 +109,9 @@ LIMIT 1",
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='NEW' WHERE `id`=%s AND `data_type`='ADMIN' LIMIT 1",
                                                array($id), __FILE__, __LINE__);
                                } // END - if
+
+                               // Free result
+                               SQL_FREERESULT($result);
                        } // END - foreach
 
                        // Set message
@@ -168,7 +168,7 @@ LIMIT 1",
                        // Nothing selected
                        loadTemplate('admin_settings_saved', false, '{--ADMIN_MAILS_NOTHING_CHECKED--}');
                }
-       } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (getConfig('url_blacklist') == 'Y')) {
+       } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (isUrlBlaskEnabled())) {
                // Lock URLs
                foreach (postRequestParameter('sel') as $id => $url) {
                        // Secure id number
@@ -208,7 +208,7 @@ LIMIT 1",
 
                // Load main template
                loadTemplate('admin_unlock_emails', false, $content);
-       } elseif ((isFormSent('lock')) && (getConfig('url_blacklist') != 'Y')) {
+       } elseif ((isFormSent('lock')) && (!isUrlBlaskEnabled())) {
                // URL blacklist not activated
                loadTemplate('admin_settings_saved', false, '{--ADMIN_URL_BLACKLIST_DISABLED--}');
        } else {