</thead> <tbody> <?php while ($u = mysqli_fetch_array($users)) { ?> <tr> <td><input type='checkbox' class='check' name='<?php echo $u['id']; ?> '></td> <td><?php echo "<a href='controlpanel.php?page=users&uid=" . $u['id'] . "'>" . $u['username'] . "</a>"; ?> </td> <td><?php echo getPermName($u['id']); ?> </td> <td><?php echo $u['email']; ?> </td> <td><?php echo date("j F Y", $u['registered_on']); ?> </td> </tr> <?php } ?> </tbody>
} elseif (getSetting("send_welcome_mail", "text") == "true") { // Send welcome mail, only if no activation mail is send $getuid = mysqli_query($con, "SELECT id FROM users WHERE username='******'"); $gu = mysqli_fetch_array($getuid); $subject = getSetting("welcome_mail_subject", "text"); $subject = str_replace("{name}", $username, $subject); $subject = str_replace("{email}", $email, $subject); $subject = str_replace("{date}", date("j-n-Y", $registered_on), $subject); $subject = str_replace("{ip}", $ip, $subject); $subject = str_replace("{perm}", getPermName($gu['id']), $subject); $message = getSetting("welcome_mail", "text"); $message = str_replace("{name}", $username, $message); $message = str_replace("{email}", $email, $message); $message = str_replace("{date}", date("j-n-Y", $registered_on), $message); $message = str_replace("{ip}", $ip, $message); $message = str_replace("{perm}", getPermName($gu['id']), $message); $message = nl2br($message); $message = html_entity_decode($message); sendMail($email, $subject, $message, $gu['id']); // Send welcome mail } else { // Nothing } $inputs2 = mysqli_query($con, "SELECT * FROM inputs"); while ($i2 = mysqli_fetch_array($inputs2)) { $name = $i2['name']; // Check if input is posted, or the if the input is an checkbox if (!empty($_POST[$name]) || $i2['type'] == "checkbox" && empty($_POST[$name])) { // If the input is an checkbox, and is it not posted, the checkbox is unchecked if ($i2['type'] == "checkbox") { if (!isset($_POST[$name])) {
function activateCode($activate_code) { global $con; global $m; $activate_code = mysqli_real_escape_string($con, $activate_code); $check = mysqli_query($con, "SELECT * FROM users WHERE activate_code='{$activate_code}'"); // Check if the activation code exists if (mysqli_num_rows($check) == 1) { $u = mysqli_fetch_array($check); $uid = $u['id']; // Make sure the user isn't already active if ($u['active'] == "0") { mysqli_query($con, "UPDATE users SET active='1' WHERE id='{$uid}'"); // Activate the user echo "<h5 class='text-center green'>" . $m['activation_success'] . "</h5>"; // Check if an welcome mail should be send if (getSetting("send_welcome_mail", "text") == "true") { // Send welcome mail $subject = getSetting("welcome_mail_subject", "text"); $subject = str_replace("{name}", $u['username'], $subject); $subject = str_replace("{email}", $u['email'], $subject); $subject = str_replace("{date}", date("j-n-Y", $u['registered_on']), $subject); $subject = str_replace("{ip}", $u['ip'], $subject); $subject = str_replace("{perm}", getPermName($u['id']), $subject); $message = getSetting("welcome_mail", "text"); $message = str_replace("{name}", $u['username'], $message); $message = str_replace("{email}", $u['email'], $message); $message = str_replace("{date}", date("j-n-Y", $u['registered_on']), $message); $message = str_replace("{ip}", $u['ip'], $message); $message = str_replace("{perm}", getPermName($u['id']), $message); $message = nl2br($message); $message = html_entity_decode($message); sendMail($u['email'], $subject, $message, $u['id']); } } else { echo "<h5 class='text-center red'>" . $m['already_active'] . "</h5>"; } } else { echo "<h5 class='text-center red'>" . $m['activate_code_not_found'] . "</h5>"; } }
echo $m['last_login']; ?> </td> <td><?php echo date("j F Y", $u['last_login']) . " " . $m['at'] . " " . date("G:i", $u['last_login']); ?> </td> </tr> <tr> <td><?php echo $m['permission']; ?> </td> <td><?php echo getPermName($uid); ?> </td> </tr> <?php $extra_inputs = mysqli_query($con, "SELECT * FROM inputs WHERE public='true' ORDER BY place DESC"); // Get extra inputs if (mysqli_num_rows($extra_inputs) > 0) { // Check if there are any inputs while ($ei = mysqli_fetch_array($extra_inputs)) { $name = $ei['name']; if ($ei['type'] == "checkbox") { // Check if the input type is checkbox if ($u[$name] == "true") { // Change true in Yes, and false in No