]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-del_user.php
Fix for possible non-working cache update
[mailer.git] / inc / modules / admin / what-del_user.php
index 9c18169179aac2eeb39ce3fdd30a1038aa6a37e1..b463096076b6873ca9ca48d8d6044f6cf32079fa 100644 (file)
@@ -40,7 +40,7 @@
 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
-}
+} // END - if
 
 // Display only title when no form was submitted
 ADD_DESCR('admin', __FILE__);
@@ -63,7 +63,7 @@ if ((isFormSent()) || ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST(('reas
                // Account does not exists!
                LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), REQUEST_GET('uid'))."</div>");
        }
-} elseif (REQUEST_ISSET_POST(('no'))) {
+} elseif (REQUEST_ISSET_POST('no')) {
        // Do not delete him...
        redirectToUrl(ADMIN_CREATE_USERID_LINK(REQUEST_GET('uid')));
 } elseif (!REQUEST_ISSET_GET('uid')) {
@@ -71,16 +71,17 @@ if ((isFormSent()) || ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST(('reas
        ADD_MEMBER_SELECTION_BOX();
 } else {
        // Realy want to delete?
-       $result = SQL_QUERY_ESC("SELECT email, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-       array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
+       $result = SQL_QUERY_ESC("SELECT `email`, `surname`, `family` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid`=%s LIMIT 1",
+               array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
+
+       // Found a row?
        if (SQL_NUMROWS($result) == 1) {
                // Load data
                list ($email, $sname, $fname) = SQL_FETCHROW($result);
-               SQL_FREERESULT($result);
 
                // Prepare content
                $content = array(
-                       'email'   => generateMemberEmailLink($email, "user_data"),
+                       'email'   => generateEmailLink($email, 'user_data'),
                        'surname' => $sname,
                        'family'  => $fname,
                        'header'  => sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), REQUEST_GET('uid')),
@@ -89,11 +90,14 @@ if ((isFormSent()) || ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST(('reas
                );
 
                // Display form
-               LOAD_TEMPLATE("admin_del_user", false, $content);
+               LOAD_TEMPLATE('admin_del_user', false, $content);
        } else {
                // Account does not exists!
                LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), REQUEST_GET('uid'))."</div>");
        }
+
+       // Free the result
+       SQL_FREERESULT($result);
 }
 
 //