$invitetime = gmtime() - $site_config["freeinvite"];
$dt = sqlesc(get_date_time());
$subject = sqlesc('Your Free Invites');
$query = SQL_Query_exec("SELECT `id`, `username`, invites FROM `users` WHERE added < FROM_UNIXTIME($invitetime)");
while ($row = mysqli_fetch_array($query)) {
$msg = sqlesc($row['username'] . 'You have recieved 2 invites for being a registerd user for 31 days');
SQL_Query_exec("UPDATE users SET invites = ($row[invites] +2 ) WHERE id = $row[id] AND added < FROM_UNIXTIME($invitetime) ");
SQL_Query_exec("INSERT INTO `messages` (`sender`, `receiver`, `added`, `msg`, `poster`, `subject`) VALUES (0, " . $row['id'] . ", $dt, $msg, 0, $subject)");
}
[$site_config['freeinvites'] = 2678400; // defualt (31 Days)
///ADD TWO INVITES EVERY 31 DAYS
$date = get_date_time(gmtime() - 86400 * 31);
$dt = sqlesc(get_date_time());
$subject = sqlesc('Your Free Invites');
$query = SQL_Query_exec("SELECT `id`, `username`, `invites` FROM `users` WHERE `added` >= '{$date}' AND `enabled` = 'yes'");
while ($row = mysqli_fetch_array($query)) {
$msg = sqlesc($row['username'] . ' You have recieved 2 invites for being a registerd user for 31 days');
SQL_Query_exec("UPDATE users SET invites = ($row[invites] +2 ) WHERE id = $row[id]");
SQL_Query_exec("INSERT INTO `messages` (`sender`, `receiver`, `added`, `msg`, `poster`, `subject`) VALUES (0, " . $row['id'] . ", $dt, $msg, 0, $subject)");
}
<a href="account-signup.php"><?php echo T_("SIGNUP"); ?></a> | <a href="account-recover.php"><?php echo T_("RECOVER_ACCOUNT"); ?></a><a href="account-signup.php"><?php echo T_("SIGNUP"); ?></a> | <a href="account-recover.php"><?php echo T_("RECOVER_ACCOUNT"); ?></a> | <a href="emailresend.php"><?php echo T_("ACTIVE_RESEND"); ?></a> if ($type =="noconf"){//email conf is disabled?
stdhead(T_("ACCOUNT_ALREADY_CONFIRMED"));
begin_frame(T_("PLEASE_NOW_LOGIN"));
print(T_("PLEASE_NOW_LOGIN_REST"));
end_frame();
stdfoot();
die();
}if ($type == "resend" && validemail($email)) {
stdhead(T_("ACTIVATE_RESEND"));
begin_frame(T_("EMAIL_RESEND_SUCCESS"));
if (!$site_config["ACONFIRM"]) {
print(T_("EMAIL_RESEND_SUCCESS"). " (" . htmlspecialchars($email) . "). " .T_("ACCOUNT_CONFIRM_SENT_TO_ADDY_REST"). " <br/ >");
}
}if (!mysqli_affected_rows())if (!mysqli_affected_rows($GLOBALS["DBconnector"]))
//EMAIL RESEND
$LANG["EMAIL_RESEND_SUCCESS"] = "<br/><br/>Activation link resent You will need to read and respond to this email before you can use your account.<br/>If you don't do this, the new account will be deleted automatically after a few days.";
$LANG["ACTIVATE_RESEND"] = "Email activation resend";
$LANG["EMAIL_RESEND_SUCCESS"] = "Activation link sent successfully!";
$LANG["EMAIL_RESEND"] = "PLease Enter You're Email Address";
$LANG["EMAIL_ACTIVE_RE"] = "Resend Actavation Email";
$LANG["ACTIVE_RESEND"] = "Activation Resend";
$LANG["CORRECT_EMAIL_ADD"] = "<b>Please use the <Font color = 'red'>EMAIL</font> you created your account with!<br />";
/////END///////////////
#======================================================================#
# Add Users
#======================================================================#
if ($action == "adduser") {
if ($CURUSER["class"] < "7") {
show_error_msg("Error", "Sorry you do not have the rights to view this page!", 1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST["username"] == "" || $_POST["password"] == "" || $_POST["email"] == "")
show_error_msg(T_("ERROR"), T_("DONT_LEAVE_ANY_FIELD_BLANK"),1);
if ($_POST["password"] != $_POST["password2"])
show_error_msg(T_("ERROR"), T_("PASSWORDS_NOT_MATCH"),1);
$username = sqlesc($_POST["username"]);
$password = $_POST["password"];
$email = sqlesc($_POST["email"]);
$secret = mksecret();
$passhash = sqlesc(passhash($password)); // hash the password
$secret = sqlesc($secret);
SQL_Query_exec("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");
$res = SQL_Query_exec("SELECT id FROM users WHERE username=$username");
$arr = mysqli_fetch_row($res);
if (!$arr)
show_error_msg(T_("ERROR"), "Unable to create the account. The user name is possibly already taken.",1);
header("Location: account-details.php?id=$arr[0]");
die;
}
stdhead("Add user");
navmenu();
begin_frame();
?>
<div align=center>
<h1>Add User</h1>
<form method=post action=admincp.php?action=adduser>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead>Name</td><td><input type=text name=username size=40></td></tr>
<tr><td class=rowhead>Password</td><td><input type=password name=password size=40></td></tr>
<tr><td class=rowhead>Retype password</td><td><input type=password name=password2 size=40></td></tr>
<tr><td class=rowhead>E-mail</td><td><input type=text name=email size=40></td></tr>
<tr><td colspan=2 align=center><input type=submit value="Create" class=btn></td></tr>
</table>
</form>
</div>
<?php
end_frame();
stdfoot();
}
#======================================================================#
# END Add Users
#======================================================================#
#======================================================================#
# Add Users
#======================================================================#
if ($action == "adduser") {
if ($CURUSER["class"] < "7") {
show_error_msg("Error", "Sorry you do not have the rights to view this page!", 1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($_POST["username"] == "" || $_POST["password"] == "" || $_POST["email"] == "")
show_error_msg(T_("ERROR"), T_("DONT_LEAVE_ANY_FIELD_BLANK"),1);
if ($_POST["password"] != $_POST["password2"])
show_error_msg(T_("ERROR"), T_("PASSWORDS_NOT_MATCH"),1);
$username = sqlesc($_POST["username"]);
$password = $_POST["password"];
$email = sqlesc($_POST["email"]);
$secret = mksecret();
$passhash = sqlesc(password_hash($password, PASSWORD_BCRYPT)); // hash the password
$secret = sqlesc($secret);
SQL_Query_exec("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");
$res = SQL_Query_exec("SELECT id FROM users WHERE username=$username");
$arr = mysqli_fetch_row($res);
if (!$arr)
show_error_msg(T_("ERROR"), "Unable to create the account. The user name is possibly already taken.",1);
header("Location: account-details.php?id=$arr[0]");
die;
}
stdhead("Add user");
navmenu();
begin_frame();
?>
<div align=center>
<h1>Add User</h1>
<form method=post action=admincp.php?action=adduser>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead>Name</td><td><input type=text name=username size=40></td></tr>
<tr><td class=rowhead>Password</td><td><input type=password name=password size=40></td></tr>
<tr><td class=rowhead>Retype password</td><td><input type=password name=password2 size=40></td></tr>
<tr><td class=rowhead>E-mail</td><td><input type=text name=email size=40></td></tr>
<tr><td colspan=2 align=center><input type=submit value="Create" class=btn></td></tr>
</table>
</form>
</div>
<?php
end_frame();
stdfoot();
}
#======================================================================#
# END Add Users
<td align="center"><a href="admincp.php?action=adduser"><img src="images/adduser.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("ADDUSER"); ?></a><br /></td>
$LANG["ADDUSER"] = "Adduser";
$mail = $crypt->b64decode($user[email], $clef);
$mail = $crypt->b64decode($user['email'], $clef);
[email] like ['email']
$password_maxlength = 60;
ALTER TABLE `users` CHANGE `password` `password` VARCHAR(60) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '';
if ($action=="avatars"){
stdhead("Avatar Log");
navmenu();
# Nick Name Change
#======================================================================#
if($action == "nick_change")
{
stdhead();
navmenu();
if ($CURUSER["edit_users"]!="yes")
show_error_msg("STOP", "You cannot acces this function");
if (!isset($_GET['what'])) $_GET['what'] = '';
begin_frame("Change Nick Name");
?>
<script type="text/javascript">
<!--
var newwindow;
function popusers(url)
{
newwindow=window.open(url,'popusers','height=70,width=400');
if (window.focus) {newwindow.focus()}
}
// -->
</script>
<form method=post name=edit action=admincp.php>
<input type='hidden' name='sid' value='<?=$sid?>'>
<input type='hidden' name='action' value='sql'>
<input type='hidden' name='do' value='change_username'>
<table border=0 cellspacing=0 cellpadding=5>
<?php
print("<tr><td>Nick:</td>");
print("<td>");
if (!$receiver){
print("<input type=\"text\" name=\"receiver\"
value=\"".($_GET["what"]!="new" ? unesc($result["poster"]):urldecode($_GET["to"]))."\" size=\"40\" ".($_GET["what"]!="new" ? "READONLY" : "")." />
<a href=\"javascript:popusers('userfind_to_nick.php');\">Find a NickName</a>");
}
else{
?>
<input type=text name=receiver value="<?=$receiver?>" READONLY>
<?php
}
?>
<tr>
<td>New Nickname:</td>
<td><input name='new_username' type='text' id="new_username" size='20' maxlength='20'></td>
</tr>
<tr>
<td colspan='2' align='center'><input type='submit' value='Make changes'>
</td>
</tr>
</form>
</table>
<p>
<?php
end_frame();
stdfoot();
}
if ($do == "change_username")
{
stdhead();
navmenu();
if ($CURUSER["edit_users"]!="yes")
show_error_msg("STOP", "you Cannot access this function",1);
begin_frame("Changes have been successful");
$current_username = $_POST['receiver'];
$new_username=$_POST['new_username'];
$q = SQL_Query_exec("UPDATE users SET username = '$new_username' WHERE username = '$current_username'");
if ($q)
echo '<b> Changes have been successful, User: '.$current_username.' is now '.$new_username.'</b>';
else
echo '<b> Changes <font size=1 face=Verdana color=red>Unccessful</font></b>';
end_frame();
stdfoot();
}
///////////////////////////////////////////END CODE//////////////////////////////////////
<td align="center"><a href=admincp.php?action=nick_change><img src="images/changenick.png " border=0 width=32 height=32><br>Change NickName</a><BR></td>
if ( ! $row || $row["password"] != $password )
if (!$row)
$message = T_("USERNAME_INCORRECT");
elseif ($row["status"] == "pending")
$message = T_("ACCOUNT_PENDING");
elseif ( !$row || !password_verify($password,$row["password"]))
$message = T_("PASSWORD_INCORRECT");
elseif ($row["enabled"] == "no")
$message = T_("ACCOUNT_DISABLED");
} else
$message = T_("NO_EMPTY_FIELDS");
$res = SQL_Query_exec("SELECT id FROM users WHERE id = $_REQUEST[invite] AND password_hash(secret) = ".sqlesc($_REQUEST["secret"]));
header("Refresh: 0; url=account.php?action=edit_settings&do=edit header("Refresh: 0; url=account.php?action=edit_settings&do=edit"); CREATE TABLE `invites` (
`id` int(10) unsigned NOT NULL auto_increment,
`inviter` int(10) unsigned NOT NULL default '0',
`inviteid` int(10) NOT NULL default '0',
`invite` varchar(32) NOT NULL default '',
`time_invited` datetime NOT NULL default '0000-00-00 00:00:00',
`confirmed` char(3) NOT NULL default 'no',
PRIMARY KEY (`id`),
KEY `inviter` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;ALTER TABLE `users` ADD `invited_by` int(10) NOT NULL default '0';
ALTER TABLE `users` ADD `invites` smallint(4) NOT NULL default '0';//invite only check
if ($site_config["INVITEONLY"]){
show_error_msg("Invite only", "<br><br><center>Sorry this site has disabled user registration, the only way to register is via a invite from a existing member.<br><br></center>",1);
}
// Disable checks if we're signing up with an invite
if (!is_valid_id($_REQUEST["invite"]) || strlen($_REQUEST["secret"]) != 32) {
//invite only check
if ($site_config["INVITEONLY"]) {
show_error_msg(T_("INVITE_ONLY"), "<br /><br /><center>".T_("INVITE_ONLY_MSG")."<br /><br /></center>",1);
}
// Disable checks if we're signing up with an invite
if ($site_config["INVITEONLY"]){
$invite = $_POST["invite"];
$r = SQL_Query_exec("SELECT inviter, inviteid, confirmed FROM invites WHERE invite=".sqlesc($invite));
$i = mysqli_fetch_assoc($r);
if (mysqli_num_rows($r) == 0)
show_error_msg("Error", "Invite ".htmlspecialchars($invite)." not found.\nPlease retry signup or request a new one.", 1);
if ($i["inviteid"] != 0)
show_error_msg("Error", "Invite ".htmlspecialchars($invite)." already taken.\nPlease request a new one with your inviter.", 1);
}
$message == "";
if ($site_config["CONFIRMEMAIL"]){//req confirm email true/false
$status = "pending";
}else{
$status = "confirmed";
}if ($site_config["CONFIRMEMAIL"]){//req confirm email true/false
$status = "pending";
}else{
if ($site_config["INVITEONLY"]){
$status = "pending";
}else{
$status = "confirmed";
}
}
SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, last_access, age, country, gender, client, stylesheet, language, class, ip) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip()))).")");
if ($site_config["INVITEONLY"]){
$ret = SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, age, country, gender, client, stylesheet, language, class, ip, invited_by, invitedate) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip(), $i["inviter"], get_date_time()))).")");
} else {
$ret = SQL_Query_exec("INSERT INTO users (username, password, secret, email, status, added, age, country, gender, client, stylesheet, language, class, ip) VALUES (" .
implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip()))).")");
}
$id = mysqli_insert_id($GLOBALS["DBconnector"]);
if ($site_config["INVITEONLY"]){
SQL_Query_exec(" UPDATE invites SET inviteid = $id, confirmed='no' WHERE invite = " . sqlesc($invite));
}
if ($site_config["CONFIRMEMAIL"]){ //email confirmation is on
ini_set("sendmail_from", "");
mail($email, "Your ".$site_config['SITENAME']." User Account", $body, "From: ".$site_config['SITENAME']." <".$site_config['SITEEMAIL'].">");
header("Refresh: 0; url=account-confirm-ok.php?type=signup&email=" . urlencode($email));
}else{
header("Refresh: 0; url=account-confirm-ok.php?type=noconf");
}if ($site_config["CONFIRMEMAIL"]){ //email confirmation is on
ini_set("sendmail_from", "");
mail($email, "Your ".$site_config['SITENAME']." User Account", $body, "From: ".$site_config['SITENAME']." <".$site_config['SITEEMAIL'].">");
header("Refresh: 0; url=account-confirm-ok.php?type=signup&email=" . urlencode($email));
}else{
if ($site_config["INVITEONLY"]){ //invite only is on
SQL_Query_exec("DELETE FROM invites WHERE invite = ".sqlesc($invite));
header("Refresh: 0; url=account-confirm-ok.php?type=invite");
}else{
header("Refresh: 0; url=account-confirm-ok.php?type=noconf");
}
}
<?php echo T_("COOKIES"); ?>
<? echo ("<center>[b] Cookies Must Be Enabled To Register.</cenetr>");?> <td>Email: <font class="small"><font color="#FF0000">*</font></td>
<td><input type="text" size="40" name="email"/></td>
</tr>
<tr><?php
if ($site_config["INVITEONLY"]):
?>
<td>Invite Code: <font class="small"><font color="#FF0000">*</font></td>
<td><input type="text" size="40" name="invite"/></td>
</tr>
<tr>
<?php endif; ?>SQL_Query_exec("UPDATE users SET uploaded='2150000000' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND uploaded='0'");
$result = SQL_Query_exec("SELECT * from users WHERE username = '".$CURUSER['username']."'");
while ($row = mysqli_fetch_array($result)){ $old_upload_value = $row['uploaded'] + 2150000000; }
SQL_Query_exec("UPDATE users SET uploaded='$old_upload_value' WHERE username = '".$CURUSER['username']."'");
//INVITES
$LANG["INVCODE_ERR"] = "Sorry you do not have any invites to generate a code!";
$LANG["SUCCESS"] = "Sign Up Succsesful Welcome To $site_config[SITENAME]";
$LANG["INVITE_DONE"] = "<b>Invite Succsesful Please Note Your Inviter Needs To Confirm Your Account Before You Can Login!<b>";
<?php print("<a href='mailbox.php'><b>".T_("YOUR_MESSAGES")."</b></a>");?>
|
<?php print("<a href='invite.php'><b>".T_("INVITES")."</b></a>");?>