IsSMTP(); // send using SMTP
$phpmailerU->Host = "$phpmailerHost"; // SMTP server to use
$phpmailerU->SMTPAuth = true; // use SMTP Auth
$phpmailerU->Username = "$phpmailerUser"; // SMTP username
$phpmailerU->Password = "$phpmailerPass"; // SMTP password
$phpmailerU->From = "$email_from"; // sender EMail
$phpmailerU->FromName = "Galatool $owner Uni $global_universe"; // sender name
$phpmailerU->WordWrap = 80; // set word wrap
$phpmailerU->IsHTML(false); // send as HTML
}
makeheader(USERINFO_TITLE);
mysql_connect($dbhost,$dbusername,$dbpassword);
mysql_select_db($dbname);
if (isset($_GET['order'])) {
$order = mysql_escape_string($_GET['order'])." ";
$what = $_GET['order'];
} else {
$order = "username ";
$what = "username";
}
if (isset($_GET['how'])) {
switch ($_GET['how']) {
case "desc" : $order .= "DESC"; $how_link = "asc"; break;
default : $order .= "ASC"; $how_link = "desc"; break;
}
} else {
$order .= "ASC";
$how_link = "desc";
}
if (isset($_GET['activate']) && is_numeric($_GET['activate'])) {
$userid = (int)$_GET['activate'];
$query = "UPDATE $utablename SET status='active' WHERE id='$userid'";
$res = mysql_query($query) or die(mysql_error());
// send email to activated player
$query = "SELECT * FROM $utablename WHERE id='$userid'";
$res = mysql_query($query) or die(mysql_error());
$line = mysql_fetch_object($res);
// send email for veryfication
if ($usePHPMailer) {
$phpmailerU->AddAddress($email);
$phpmailerU->Subject = USERINFO_ACTIVATED ;
$phpmailerU->Body = USERINFO_ACTIVATIONTEXT ;
$result = ($phpmailerU->Send());
} else {
$headers = "From: ".$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/plain; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n";
// Send
$result = mail($line->email, USERINFO_ACTIVATED, USERINFO_ACTIVATIONTEXT, $headers);
}
}
if (!isset($_GET['userid'])) {
echo '
'.USERINFO_TITLE.' |
'.USERINFO_NAMES.': |
'.USERINFO_USERNAME.' |
'.USERINFO_INGAME.' |
'.USERINFO_ALLYTAG.' |
'.USERINFO_STATUS.' |
'.USERINFO_LOGINS.' |
'.USERINFO_LASTLOGIN.' |
';
$query = "SELECT *,DATE_FORMAT(CONVERT_TZ(lastlogin, '+00:00', '".$_SESSION['s_timezone_offset']."'), '%d. %m. %Y - %H:%i:%s') FROM $utablename ORDER BY $order";
$res = mysql_query($query) or die(mysql_error());
while ($line = mysql_fetch_object($res)) {
// User Info
switch ($line->status) {
case "email":
$status_style = "traffic_light_red";
break;
case "admin":
$status_style = "traffic_light_yellow";
break;
case "active":
$status_style = "traffic_light_green";
break;
}
if ($line->lastlogin == "0000-00-00 00:00:00") {
$lastlogin = USERINFO_NOLOGIN;
} else {
$lastlogin = $line->lastlogin;
}
echo '
'.$line->username.' |
'.$line->ingame.' |
'.$line->allytag.' |
'.$line->status.' |
'.$line->logins.' |
'.$lastlogin.' |
'."\n";
}
echo " |
\n";
} elseif (isset($_GET['userid']) && is_numeric($_GET['userid'])) {
$userid = (int)$_GET['userid'];
$query = "SELECT *, DATE_FORMAT(CONVERT_TZ(lastlogin, '+00:00', '".$_SESSION['s_timezone_offset']."'), '%d. %m. %Y - %H:%i:%s') as lastlogin FROM $utablename WHERE id='$userid'";
$res = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($res) > 0) {
$line = mysql_fetch_object($res);
// User Info
switch ($line->status) {
case "email":
$status = $line->status.' '.USERINFO_ACTIVATE.'';
$status_style = "traffic_light_red";
break;
case "admin":
$status = $line->status.' '.USERINFO_ACTIVATE.'';
$status_style = "traffic_light_yellow";
break;
case "active":
$status = $line->status;
$status_style = "traffic_light_green";
break;
}
if ($line->lastlogin == "0000-00-00 00:00:00") {
$lastlogin = USERINFO_NOLOGIN;
} else {
$lastlogin = $line->lastlogin;
}
echo '
'.USERINFO_TITLE.' |
'.USERINFO_DETAIL.': |
'.$line->username.' |
'.USERINFO_INGAME.': | '.$line->ingame.' |
'.USERINFO_EMAIL.': | '.$line->email.' |
'.USERINFO_ALLYTAG.': | '.$line->allytag.' |
'.USERINFO_STYLEPATH.': | '.$line->stylepath.' |
'.USERINFO_STATUS.': | '.$status.' |
'.USERINFO_LOGINS.': | '.$line->logins.' |
'.USERINFO_LASTLOGIN.': | '.$lastlogin.' | ';
$query = "SELECT DATE_FORMAT(CONVERT_TZ(MAX(last_update), '+00:00', '".$_SESSION['s_timezone_offset']."'), '%d. %m. %Y - %H:%i:%s') as glast_update FROM $dbtablename WHERE user_id='".$userid."'";
$res = mysql_query($query) or die(mysql_error());
$line = mysql_fetch_object($res);
if (!empty($line->glast_update)) {
$last_galaxyupdate = $line->glast_update;
} else {
$last_galaxyupdate = "";
}
echo '
'.USERINFO_LAST_GALAXYUPDATE.': | '.$last_galaxyupdate.' |
|
';
// Galaxy Info
echo '
';
$query = "SELECT galaxy,count(*) as anzahl FROM $dbtablename WHERE user_id=$userid AND planet='1' GROUP BY galaxy ORDER BY galaxy";
$res = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($res) == 0) {
echo ''.USERINFO_DATA.' |
'.USERINFO_NODATA.' | '."\n";
} else {
echo ''.USERINFO_GALAXY.' | '.USERINFO_SYSTEMS.' | '."\n";
while ($line = mysql_fetch_object($res)) {
echo ''.$line->galaxy.' | '.$line->anzahl.' | '."\n";
}
}
echo " |
\n";
if ($_SESSION['s_isadmin'] == true) {
// IP Info
echo '
';
$query = "SELECT *,DATE_FORMAT(CONVERT_TZ(logintime, '+00:00', '".$_SESSION['s_timezone_offset']."'), '%d. %m. %Y - %H:%i:%s') as logintime_formated FROM $iptablename WHERE userid='$userid' ORDER BY logintime DESC";
$res = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($res) == 0) {
echo ''.USERINFO_IP.' |
'.USERINFO_NOLOGIN.' |
';
} else {
echo ''.USERINFO_IP.' | '.USERINFO_LOGINTIME.' | '."\n";
while ($line = mysql_fetch_object($res)) {
echo ''.$line->ip.' | '.$line->logintime_formated.' | '."\n";
}
}
echo " |
\n";
}
// end
echo "
";
} else {
echo ''.USERINFO_ERROR1.'
';
}
}
makefooter();
?>