Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Manual Add User
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

Unknown User
2019-07-07 16:58:59
(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 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
adduser-standard.zip
Download
adduser-ENCRYPT.zip
Download
2020-03-13 18:34:15
This one give me a 404 page can not be found error for the standard version. Has it been tested?
If It Ain't Dutch, It Ain't Much!!
2020-03-15 03:37:21
Im not in a position to be able to test this right now, but it seems something has to be missing. I dont see how it calls that file that needs uploaded.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2020-04-04 03:32:20
"Propaganda, post: 68150, member: 60":

This one give me a 404 page can not be found error for the standard version. Has it been tested?

In the section added to admincp.php find the following:
       header("Location: account-details?id=$arr[0]");
change to:
       header("Location: account-details.php?id=$arr[0]");

find the following:
      <form method=post action=admincp?action=adduser>
change to:
      <form method=post action=admincp.php?action=adduser>
2020-04-14 14:43:51
Here are 2 pictures if someone can use them
adduser.png
adduser.png
deluser.png
deluser.png
2020-04-18 15:25:06
Is it possible to include a class selection there ? For example that I can add a user as moderator.

KD
2020-04-19 17:40:27
It redirects you to the users page and you can change it from there. Unless someone can explain to me what the "adduser" file does, you do NOT need to upload that file. You only need to do the admincp.php edit. I do not see a call for adduser.php in the code anywhere. Also, just for fun, you can use this
autolink ("account-details.php?id=$arr[0]", "<b><font color='#ff0000'> Account Created...Directing to details page</font></b>");

instead of this
header("Location: account-details.php?id=$arr[0]");

I always forget about the autolink
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2020-04-19 17:48:48
Original post edited to reflect the changes needed for some to use the .php extension. If  serph feels this is not right, let me know. I didnt edit anything else. Just wanted the code to be as useful as possible without having to read the whole post to find that some or most folks need to explicitly define the .php part :)
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728