");
if ($session['user']['superuser'] & SU_IS_GAMEMASTER) {
rawoutput("");
}
rawoutput("");
$superusers = array();
if (($session['user']['superuser'] & SU_IS_GAMEMASTER) && $from > "") {
output("`2From: `^%s`n", $from);
}
if (isset($row['login']) && $row['login']!=""){
output_notl("",true);
output("`2To: `^%s`n",$row['name']);
if (($row['superuser'] & SU_GIVES_YOM_WARNING) && !($row['superuser'] & SU_OVERRIDE_YOM_WARNING)) {
array_push($superusers,$row['login']);
}
}else{
output("`2To: ");
$to = httppost('to');
$sql = "SELECT login,name,superuser FROM accounts WHERE login = '".addslashes($to)."' AND locked = 0";
$result = db_query($sql);
$db_num_rows = db_num_rows($result);
if($db_num_rows != 1) {
$string="%";
$to_len = strlen($to);
for($x=0; $x < $to_len; ++$x) {
$string .= $to{$x}."%";
}
$sql = "SELECT login,name,superuser FROM " . db_prefix("accounts") . " WHERE name LIKE '".addslashes($string)."' AND locked=0 ORDER by login='$to' DESC, name='$to' DESC, login";
$result = db_query($sql);
$db_num_rows = db_num_rows($result);
}
if ($db_num_rows==1){
$row = db_fetch_assoc($result);
output_notl("",true);
output_notl("`^{$row['name']}`n");
if (($row['superuser'] & SU_GIVES_YOM_WARNING) && !($row['superuser'] & SU_OVERRIDE_YOM_WARNING)) {
array_push($superusers,$row['login']);
}
}elseif ($db_num_rows==0){
output("`\$No one was found who matches \"%s\".`n",stripslashes($to));
output("`@Please try again.`n");
httpset('prepop', $to, true);
rawoutput("");
require("lib/mail/case_address.php");
popup_footer();
}else{
output_notl("`n",true);
}
}
rawoutput("");
output("`2Subject:");
rawoutput("
");
rawoutput("