(credits to original coder)
ok like always back up you're files
if you have installed the new passowrd encrypt mod
https://www.torrenttrader.xyz/index.php?threads/important-password-update-ttv3.9804/
follow the instructions below (Encrypted version)
(for the standard version)
open admincp.php and add before the last ?>
add the attached file adduser-standard to root folder
if you have installed the password encrypt mod
(Encrypted version)
open up admincp.php before the last ?> add
add attached zip adduser-encrypt
add a link in admincp like
add to /languages/english.php
sorry i dont have an image but if you find one name it to adduser.png and pop it in images folder
ok like always back up you're files
if you have installed the new passowrd encrypt mod
https://www.torrenttrader.xyz/index.php?threads/important-password-update-ttv3.9804/
follow the instructions below (Encrypted version)
(for the standard version)
open admincp.php and add before the last ?>
#======================================================================#
# 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 the attached file adduser-standard to root folder
if you have installed the password encrypt mod
(Encrypted version)
open up admincp.php before the last ?> add
#======================================================================#
# 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
add attached zip adduser-encrypt
add a link in admincp like
<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>
add to /languages/english.php
$LANG["ADDUSER"] = "Adduser";
sorry i dont have an image but if you find one name it to adduser.png and pop it in images folder