<script src="https://www.google.com/recaptcha/api.js" async defer></script><?php
require_once("backend/functions.php");
dbconn();
///Enter google keys below
$siteKey = 'key_here';
$secret = 'secretkey_here';
///end google reCAPTCHA
session_start();
$site_config["LEFTNAV"] = $site_config["MIDDLENAV"] = $site_config["RIGHTNAV"] = false;
///WARNING COMMENTED IF YOU HAVE A FULL PAGE LOGIN. OTHERWISE UNCOMMENT.
//if (!empty($_REQUEST["returnto"])) {
// if (!$_GET["nowarn"]) {
// $nowarn = T_("MEMBERS_ONLY");
// }
//}
// END WARNING COMMENT
if ($_POST["username"] && $_POST["password"]) {
$password = passhash($_POST["password"]);
if (!empty($_POST["username"]) && !empty($_POST["password"])) {
$res = SQL_Query_exec("SELECT id, password, secret, status, enabled FROM users WHERE username = " . sqlesc($_POST["username"]) . "");
$row = mysqli_fetch_assoc($res);
$captcha;
if(isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
$message = '<h2>Please check the the captcha form.</h2>';
header("Refresh: 1; url= account-login.php");
}
$secretKey = "<?php echo $secret;?>";
$ip = $_SERVER['REMOTE_ADDR'];
$response="file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip.")";
if ( ! $row || $row["password"] != $password )
$message = T_("LOGIN_INCORRECT");
elseif ($row["status"] == "pending")
$message = T_("ACCOUNT_PENDING");
elseif ($row["enabled"] == "no")
$message = T_("ACCOUNT_DISABLED");
} else
$message = T_("NO_EMPTY_FIELDS");
if (!$message){
logincookie($row["id"], $row["password"], $row["secret"]);
if (!empty($_POST["returnto"])) {
header("Refresh: 0; url=" . $_POST["returnto"]);
die();
}
else {
header("Refresh: 0; url=index.php");
die();
}
}else{
show_error_msg(T_("ACCESS_DENIED"), $message, 1);
}
}
unset($_POST['g-recaptcha-response']);
logoutcookie();
stdhead(T_("LOGIN"));
if ($nowarn)
show_error_msg(T_("ERROR"), $nowarn, 0);
begin_frame(T_("LOGIN"));
?>
<form method="post" action="account-login.php">
<table border="0" cellpadding="2" align="center">
<tr><td align="center"><b><?php echo T_("USERNAME"); ?>:</b> <input type="text" size="40" name="username" /></td></tr>
<tr><td align="center"><b><?php echo T_("PASSWORD"); ?>:</b> <input type="password" size="40" name="password" /></td></tr>
<tr><td align="center"><div class="g-recaptcha" data-theme="light" data-sitekey="<?php echo $siteKey; ?>"></div></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("LOGIN"); ?>" /><br /><br /><i><?php echo T_("COOKIES");?></i></td></tr>
</table>
<?php
if ( ! empty($_REQUEST["returnto"]) )
{
print("<input type=\"hidden\" name=\"returnto\" value=\"" . cleanstr($_REQUEST["returnto"]) . "\" />\n");
}
?>
</form>
<p align="center"><a href="account-signup.php"><?php echo T_("SIGNUP"); ?></a> | <a href="account-recover.php"><?php echo T_("RECOVER_ACCOUNT"); ?></a></p>
<?php
end_frame();
stdfoot();
?>
data-theme="light"
// MySQL escaping
function sqlesc($x) {
if (!is_numeric($x)) {
$x = "'".mysql_real_escape_string($x)."'";
}
return $x;
} ALTER TABLE `shoutbox` ADD `room` int(10) unsigned NOT NULL DEFAULT 0;.bb_icon, .bb_icon:hover {
background:#999999;
border:1px solid #666666;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
padding:1px;
min-width:16px;
cursor:pointer;
}
.bb_icon:hover {
border: 1px solid #dddddd;
}echo "<div align='right' style='float: right'></div>";
echo '</td><td style="font-size: 12px; padding-left: 5px"><a href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'" target="_parent"><b>'.($row['user']).':</b></a> '.nl2br(format_comment($row['message']));
echo '</td></tr>';echo "<div align='right' style='float: right'></div>";
echo '</td><td style="font-size: 12px; padding-left: 5px"><a href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'" target="_parent"><b>'.class_user($row['user']).'</b></a> '.nl2br(format_comment($row['message']));
echo '</td></tr>'; print (T_("LOGGED_IN_AS").": <a href='account-details.php?id=$CURUSER[id]'>".$CURUSER["username"]."</a>"); //DISPLAY NFO BLOCK
begin_frame("NFO");
if ($row["nfo"] == "yes") {
echo('<img src="nfo-view.php?id=' . $id . '">');
}
else {
if ($nfo) {
$nfo = my_nfo_translate($nfo);
echo "<br /><br /><b>NFO:</b><br />";
print("<textarea class='nfo' style='width:98%;height:100%;' align='center' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
} //$nfo
else {
$nfo = utf8_encode(str_replace("\x0d\x0d\x0a", "\x0d\x0a", @file_get_contents($nfofilelocation)));
if ($nfo) {
$nfo = my_nfo_translate($nfo);
echo "<br /><br /><b>NFO:</b><br />";
print("<textarea class='nfo' style='width:98%;height:100%;' align='center' rows='20' cols='20' readonly='readonly'>" . stripslashes($nfo) . "</textarea>");
} //$nfo
else {
print(T_("NFO_NOT_FOUND"));
}
}
}
end_frame();
///NEW NFO DISPLAY
begin_frame("NFO");
?>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.collapsible {
background-color: inherit;
color: inherit;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
}
.active, .collapsible:hover {
background-color: inherit;
}
.content {
padding: 0 18px;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
background-color: inherit;
}
</style>
</head>
<body>
<button class="collapsible">Click to view NFO</button>
<div class="content">
<p><?php echo "<br />";
if ($row["nfo"] == "yes") {
echo('<img src="nfo-view.php?id=' . $id . '">');
}
else {
print(T_("NFO_NOT_FOUND"));
}
echo "<br /><br />";
?></p>
</div></div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.maxHeight){
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
}
</script>
</body>
<?php
end_frame();
echo "<br /><br />";
///END NEW NFO DISPLAY
#======================================================================#
# Duplicate IP's
#======================================================================#
if ($action == "duplicateips")
{
$res = SQL_Query_exec("SELECT ip FROM users GROUP BY ip HAVING count(*) > 1");
$num = mysqli_num_rows($res);
list($pagertop, $pagerbottom, $limit) = pager(25, $num, 'admincp.php?action=duplicateips&');
$res = SQL_Query_exec("SELECT id, username, class, email, ip, added, last_access, COUNT(*) as count FROM users GROUP BY ip HAVING count(*) > 1 ORDER BY id ASC $limit");
stdhead(T_("DUPLICATEIP"));
navmenu();
begin_frame(T_("DUPLICATEIP"));
?>
<center><?php echo T_("DUPLICATEIPINFO"); ?></center>
<br />
<?php if ($num > 0): ?>
<br />
<table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
<tr>
<th class="table_head"><?php echo T_("USERNAME"); ?></th>
<th class="table_head"><?php echo T_("USERCLASS"); ?></th>
<th class="table_head"><?php echo T_("EMAIL"); ?></th>
<th class="table_head"><?php echo T_("IP"); ?></th>
<th class="table_head"><?php echo T_("ADDED"); ?></th>
<th class="table_head"><?php echo T_("COUNT"); ?></th>
</tr>
<?php while ($row = mysqli_fetch_assoc($res)): ?>
<tr>
<td class="table_col1" align="center"><a href="account-details.php?id=<?php echo $row["id"]; ?>"><?php echo $row["username"]; ?></a></td>
<td class="table_col2" align="center"><?php echo get_user_class_name($row["class"]); ?></td>
<td class="table_col1" align="center"><?php echo $row["email"]; ?></td>
<td class="table_col2" align="center"><?php echo $row["ip"]; ?></td>
<td class="table_col1" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
<td class="table_col1" align="center"><a href="admincp.php?action=usersearch&ip=<?php echo $row['ip']; ?>"><?php echo number_format($row['count']); ?></a></td>
</tr>
<?php endwhile; ?>
</table>
<?php else: ?>
<center><b><?php echo T_("NOTHING_FOUND"); ?></b></center>
<?php
endif;
if ($num > 25) echo $pagerbottom;
end_frame();
stdfoot();
}
#======================================================================#
# End Duplicate IP Mod
#======================================================================#<td align="center"><a href="admincp.php?action=duplicateips"><img src="images/admin/double-ip.ico" border="0" width="118" height="80" alt="" /><br /><?php echo T_("DUPLICATEIP"); ?><br /></a></td> $LANG['DUPLICATEIP'] = 'Duplicate IP\'s';
$LANG['DUPLICATEIPINFO'] = "This page displays all users which the database shows them having more than one account associated by their ip.";#======================================================================#
# Mass Mailer
#======================================================================#
if ($action == "massmail")
{
if ($do == "send")
{
$msg_log = "Sent to classes: ";
@set_time_limit(0);
$subject = $_POST["subject"];
$body = format_comment($_POST["body"]);
if (!$subject || !$body) show_error_msg("Error", "No subject or body specified.", 1);
if (!@count($_POST["groups"])) show_error_msg("Error", "No groups Selected.", 1);
$ids = array_map("intval", $_POST["groups"]);
$ids = implode(", ", $ids);
$res_log = SQL_Query_exec("SELECT DISTINCT level FROM groups WHERE group_id IN ($ids)");
while ($row_log = mysqli_fetch_assoc($res_log))
{
$msg_log .= $row_log["level"] . ", ";
}
$res = SQL_Query_exec("SELECT u.email FROM users u LEFT JOIN groups g ON u.class = g.group_id WHERE u.enabled = 'yes' AND u.status = 'confirmed' AND u.class IN ($ids)");
while ($row = mysqli_fetch_assoc($res))
{
sendmail($row["email"], $subject, $body, "Content-type: text/html; charset=utf-8", "-f$site_config[SITEEMAIL]");
}
write_log("<b><font color='Magenta'>A Mass E-Mail</font> was sent by (<font color='Navy'>$CURUSER[username]</font>) $msg_log<b>");
// show_error_msg("Success", "Your Mass E-mail was sent.", 1);
autolink ("admincp.php", "<b><font color='#ff0000'>Mass mail sent....</font></b>");
}
$res = SQL_Query_exec("SELECT `group_id`, `level` FROM `groups` ORDER BY `group_id` ASC");
stdhead("Mass Mailer");
navmenu();
begin_frame("Mass Mailer");
?>
<center>
This page allows you to send a mass-email to all members, in the usergroups you choose.
</center>
<br />
<form id="massmail" name="massmail" method="post" action="admincp.php?action=massmail">
<input type="hidden" name="do" value="send" />
<table border="0" cellpadding="3" cellspacing="0" width="100%" align="center">
<tr>
<td align="center">Subject: <input type="text" name="subject" size="40" /></td>
</tr>
<tr>
<td align="center">To:
<?php while ($row = mysqli_fetch_assoc($res)): ?>
<input type="checkbox" name="groups[]" value="<?php echo $row["group_id"]; ?>" /> <?php echo $row["level"]; ?>
<?php endwhile; ?>
<input type="checkbox" name="checkall" onclick="checkAll(this.form.id)" /> All
</td>
</tr>
<tr>
<td align="center"><?php echo textbbcode("massmail", "body"); ?></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Send" />
<input type="reset" value="Reset" />
</td>
</tr>
</table>
</form>
<?php
end_frame();
stdfoot();
}
#======================================================================#
# End Mass Mail
#======================================================================# <td align="center"><a href="admincp.php?action=massmail"><img src="images/admin/massmail.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("MASSMAILER"); ?><br /></a></td>$LANG["MASSMAILER"] = "Mass Mailer";$site_config["mail_type"] = "pear"; /// Must have pear installed and working
$site_config["mail_smtp_host"] = "smtp.gmail.com"; // SMTP server hostname
$site_config["mail_smtp_port"] = "465"; // SMTP server port
$site_config["mail_smtp_ssl"] = true; // true to use SSL
$site_config["mail_smtp_auth"] = true; // true to use auth for SMTP
$site_config["mail_smtp_user"] = "user@gmail.com"; // SMTP username
$site_config["mail_smtp_pass"] = "gmail_password"; // SMTP password