A lot has been rewritten, ext-teams added, ext-forced continued:
[mailer.git] / inc / modules / admin / what-lock_sponsor.php
index a59eaf4e04c55caee2b78525ffad89ecd030e24f..dff0cb7793e00706148f1393a3e841a49422fda8 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -43,12 +41,12 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 } // END - if
 
 // Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
 $message = '';
 
 if (isGetRequestParameterSet('id')) {
        // Check for selected sponsor
-       $result_sponsor = SQL_QUERY_ESC("SELECT `gender`, `surname`, `family`, `email`, `status` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`='%s' LIMIT 1",
+       $result_sponsor = SQL_QUERY_ESC("SELECT `gender`,`surname`,`family`,`email`,`status` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`=%s LIMIT 1",
                array(bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result_sponsor) == 1) {
                // Get sponsor's current status and let only confirmed and locked status pass
@@ -57,19 +55,19 @@ if (isGetRequestParameterSet('id')) {
                if (($content['status'] == 'CONFIRMED') || ($content['status'] == 'LOCKED')) {
                        // Transfer data to constants
                        $content['id']     = bigintval(getRequestParameter('id'));
-                       $content['reason'] = secureString(postRequestParameter('reason'));
+                       $content['reason'] = postRequestParameter('reason');
 
                        if (isFormSent()) {
                                // Create messages
                                if ($content['status'] == 'CONFIRMED') {
                                        // Message when sponsor's account got lock
                                        $content['message'] = '{--SPONSOR_ACCOUNT_LOCKED--}';
-                                       $subject = '{--SPONSOR_SUBJECT_LOCKED--}';
+                                       $subject = '{--SPONSOR_LOCKED_SUBJECT--}';
                                        $content['status'] = 'LOCKED';
                                } else {
                                        // Message when sponsor's account got unlock
                                        $content['message'] = '{--SPONSOR_ACCOUNT_UNLOCKED--}';
-                                       $subject = '{--SPONSOR_SUBJECT_UNLOCKED--}';
+                                       $subject = '{--SPONSOR_UNLOCKED_SUBJECT--}';
                                        $content['status'] = 'CONFIRMED';
                                }
 
@@ -80,7 +78,7 @@ if (isGetRequestParameterSet('id')) {
                                sendEmail($content['email'], $subject, $message);
 
                                // Update sponsor's account
-                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `status`='%s' WHERE `id`='%s' LIMIT 1",
+                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `status`='%s' WHERE `id`=%s LIMIT 1",
                                        array($content['status'], bigintval(getRequestParameter('id'))), __FILE__, __LINE__);
                        } elseif (isPostRequestParameterSet('no')) {
                                // No don't lock / unlock now!
@@ -105,11 +103,11 @@ if (isGetRequestParameterSet('id')) {
                        }
                } else {
                        // Cannot change status on unconfirmed or pending accounts!
-                       $message = '{--ADMIN_SPONSPOR_CANNOT_LOCK_PENDING_UNCINFIRMED_ACCOUNTS--}';
+                       $message = '{--ADMIN_SPONSOR_CANNOT_LOCK_PENDING_UNCINFIRMED_ACCOUNTS--}';
                }
        } else {
-               // Sponsor not found!
-               $message = getMaskedMessage('ADMIN_SPONSOR_404', bigintval(getRequestParameter('id')));
+               // Sponsor not found
+               $message = '{%message,ADMIN_SPONSOR_404=' . bigintval(getRequestParameter('id')) . '%}';
        }
 
        // Free result
@@ -121,7 +119,7 @@ if (isGetRequestParameterSet('id')) {
 
 if (!empty($message)) {
        // Output message
-       loadTemplate('admin_settings_saved', false, $message);
+       displayMessage($message);
 } // END - if
 
 // [EOF]