Changeset 19 for minimanager/mail.php
- Timestamp:
- Aug 13, 2007, 9:05:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/mail.php
r5 r19 23 23 <form action=\"mail.php?action=send_mail\" method=\"post\" name=\"form\"> 24 24 <fieldset style=\"width: 770px;\"> 25 <legend>{$lang_mail['mail_ options_type']}</legend>25 <legend>{$lang_mail['mail_type']}</legend> 26 26 <br /> 27 27 <table class=\"top_hidden\" style=\"width: 720px;\"> … … 94 94 } 95 95 96 $ mysql = new MySQL;97 $ mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass']);98 99 $body = $ mysql->quote_smart($_POST['body']);100 $subject = $ mysql->quote_smart($_POST['subject']);96 $sql = new SQL; 97 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 98 99 $body = $sql->quote_smart($_POST['body']); 100 $subject = $sql->quote_smart($_POST['subject']); 101 101 102 if(isset($_POST['to'])&&($_POST['to'] != '')) $to = $ mysql->quote_smart($_POST['to']);102 if(isset($_POST['to'])&&($_POST['to'] != '')) $to = $sql->quote_smart($_POST['to']); 103 103 else { 104 104 $to = 0; … … 106 106 redirect("mail.php?error=1"); 107 107 } else { 108 $group_value = $ mysql->quote_smart($_POST['group_value']);109 $group_sign = $ mysql->quote_smart($_POST['group_sign']);110 $group_send = $ mysql->quote_smart($_POST['group_send']);108 $group_value = $sql->quote_smart($_POST['group_value']); 109 $group_sign = $sql->quote_smart($_POST['group_sign']); 110 $group_send = $sql->quote_smart($_POST['group_send']); 111 111 } 112 112 } 113 113 114 114 $type = addslashes($_POST['type']); 115 $att_gold = $ mysql->quote_smart($_POST['money']);116 $att_item = $ mysql->quote_smart($_POST['att_item']);117 $att_stack = $ mysql->quote_smart($_POST['att_stack']);115 $att_gold = $sql->quote_smart($_POST['money']); 116 $att_item = $sql->quote_smart($_POST['att_item']); 117 $att_stack = $sql->quote_smart($_POST['att_stack']); 118 118 119 119 switch ($type) { 120 120 case "email": 121 121 122 require_once("scripts/ class.phpmailer.php");122 require_once("scripts/mailer/class.phpmailer.php"); 123 123 $mail = new PHPMailer(); 124 124 $mail->Mailer = $mailer_type; … … 157 157 158 158 } elseif (isset($group_value)){ //group send 159 $ mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);159 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 160 160 161 161 $email_array = array(); 162 162 switch ($group_send) { 163 163 case "gm_level": 164 $result = $ mysql->query("SELECT email FROM account WHERE gmlevel $group_sign '$group_value'");165 while($user = $ mysql->fetch_row($result)){164 $result = $sql->query("SELECT email FROM account WHERE gmlevel $group_sign '$group_value'"); 165 while($user = $sql->fetch_row($result)){ 166 166 if($user[0] != "") array_push($email_array, $user[0]); 167 167 } … … 169 169 170 170 case "locked": 171 $result = $ mysql->query("SELECT email FROM account WHERE locked $group_sign '$group_value'");172 while($user = $ mysql->fetch_row($result)){171 $result = $sql->query("SELECT email FROM account WHERE locked $group_sign '$group_value'"); 172 while($user = $sql->fetch_row($result)){ 173 173 if($user[0] != "") array_push($email_array, $user[0]); 174 174 } … … 176 176 177 177 case "banned": 178 $que = $ mysql->query("SELECT id FROM account_banned");179 while ($banned = mysql_fetch_row($que)){180 $result = $ mysql->query("SELECT email FROM account WHERE id = '$banned[0]'");181 if($ mysql->result($result, 0, 'email')) array_push($email_array, $mysql->result($result, 0, 'email'));178 $que = $sql->query("SELECT id FROM account_banned"); 179 while ($banned = $sql->fetch_row($que)){ 180 $result = $sql->query("SELECT email FROM account WHERE id = '$banned[0]'"); 181 if($sql->result($result, 0, 'email')) array_push($email_array, $sql->result($result, 0, 'email')); 182 182 } 183 183 break; 184 184 185 185 default: 186 $ mysql->close();186 $sql->close(); 187 187 redirect("mail.php?error=5"); 188 188 } 189 $ mysql->close();189 $sql->close(); 190 190 191 191 foreach ($email_array as $mail_addr){ … … 206 206 207 207 case "ingame_mail": 208 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);208 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 209 209 210 210 require_once("scripts/gen_lib.php"); 211 211 212 212 if($to){ //single Recipient 213 $result = $ mysql->query("SELECT guid FROM `character` WHERE name ='$to'");214 215 if ($ mysql->num_rows($result) == 1) {216 $receiver = $ mysql->result($result, 0, 'guid');213 $result = $sql->query("SELECT guid FROM `character` WHERE name ='$to'"); 214 215 if ($sql->num_rows($result) == 1) { 216 $receiver = $sql->result($result, 0, 'guid'); 217 217 218 218 send_ingame_mail($receiver, 0, $subject, $body, $att_gold, $att_item, $att_stack); 219 219 220 220 } else { 221 $ mysql->close();221 $sql->close(); 222 222 redirect("mail.php?error=4"); 223 223 } 224 $ mysql->close();224 $sql->close(); 225 225 redirect("mail.php?error=2"); 226 226 break; … … 229 229 switch ($group_send) { 230 230 case "gm_level": 231 $ mysql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);232 $result = $ mysql->query("SELECT id FROM account WHERE gmlevel $group_sign '$group_value'");233 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);234 while($acc = $ mysql->fetch_row($result)){235 $result_2 = $ mysql->query("SELECT guid FROM `character` WHERE account = '$acc[0]'");236 while($char = $ mysql->fetch_row($result_2)) array_push($char_array, $char[0]);231 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 232 $result = $sql->query("SELECT id FROM account WHERE gmlevel $group_sign '$group_value'"); 233 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 234 while($acc = $sql->fetch_row($result)){ 235 $result_2 = $sql->query("SELECT guid FROM `character` WHERE account = '$acc[0]'"); 236 while($char = $sql->fetch_row($result_2)) array_push($char_array, $char[0]); 237 237 } 238 238 break; 239 239 240 240 case "online": 241 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);242 $result = $ mysql->query("SELECT guid FROM `character` WHERE online $group_sign '$group_value'");243 while($user = $ mysql->fetch_row($result)) array_push($char_array, $user[0]);241 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 242 $result = $sql->query("SELECT guid FROM `character` WHERE online $group_sign '$group_value'"); 243 while($user = $sql->fetch_row($result)) array_push($char_array, $user[0]); 244 244 break; 245 245 246 246 case "char_level": 247 $ mysql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']);248 $result = $ mysql->query("SELECT guid FROM `character` WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) $group_sign '$group_value'");249 while($user = $ mysql->fetch_row($result)) array_push($char_array, $user[0]);247 $sql->connect($mangos_db[$realm_id]['addr'], $mangos_db[$realm_id]['user'], $mangos_db[$realm_id]['pass'], $mangos_db[$realm_id]['name']); 248 $result = $sql->query("SELECT guid FROM `character` WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 35), ' ', -1) $group_sign '$group_value'"); 249 while($user = $sql->fetch_row($result)) array_push($char_array, $user[0]); 250 250 break; 251 251 252 252 default: 253 $ mysql->close();253 $sql->close(); 254 254 redirect("mail.php?error=5"); 255 255 } … … 259 259 send_ingame_mail($receiver, 0, $subject, $body, $att_gold, $att_item, $att_stack); 260 260 } 261 $ mysql->close();261 $sql->close(); 262 262 redirect("mail.php?error=2"); 263 263 }
Note:
See TracChangeset
for help on using the changeset viewer.