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
[ADDON] adduser.php
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2012-06-12 08:18:49
thanks walker1977 and johnnyvang
Unknown User
2012-11-20 16:31:05
i use the below code but when a user to connect in tracker i take the message. Ithink the problem is somewhere the sha1 password

The specified username or password was incorrect.



#======================================================================#

# 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("Error", "Missing form data.");

if ($_POST["password"] != $_POST["password2"])

show_error_msg("Error", "Passwords mismatch.");

$username = sqlesc($_POST["username"]);

$password = $_POST["password"];

$email = sqlesc($_POST["email"]);

$secret = mksecret();

$passhash = sqlesc(md5($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 = mysql_fetch_row($res);

if (!$arr)

show_error_msg("Erro", "Unable to create the account. The user name is possibly already taken.");

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

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>Username</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>Re-type 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="Okay" class=btn></td></tr>

</table>

</form>

</div>

<?

end_frame();

stdfoot();

}

#======================================================================#

# END Add Users

#======================================================================#

EDIT:i change the
$passhash = sqlesc(md5($password)); 

[b] with the


$passhash = sqlesc(sha1($password)); 
 and its ok now
Unknown User
2012-11-20 18:15:18
might be simpler to use

$passhash = passhash($password);// hash the password
in 2.08 svn.  That way all the password hashs match:)
Unknown User
2012-11-20 19:04:44
Database Error in admincp.php on line 4847: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, 'confirmed', 'xxxxx@gmail.com')' at line 1. Query was: INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), 'xxxxxxxxxxxxxxxxxxxxxxxxxx', 'test', aaaaaaaaaaaaaaa, 'confirmed', 'xxxxxx@gmail.com').

in line 4847

SQL_Query_exec("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)");
Unknown User
2012-11-20 19:46:37
err forgot this page dont use sqlesc on write:( change it to

$passhash = sqlesc(passhash($password));// hash the password
Unknown User
2012-11-20 19:53:52
Updated to work with 2.08 svn





#======================================================================#

# 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 = mysql_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>Username</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>Re-type 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="Okay" class=btn></td></tr>

</table>

</form>

</div>

<?

   end_frame();

   stdfoot();

}

#======================================================================#

# END Add Users

#======================================================================#

Unknown User
2012-11-20 22:06:02
i keep getting when trying to log in the new created user:

The specified username or password was incorrect.

and am using this 2.08 code
Unknown User
2012-11-20 22:47:13
weird did you change your login password hash? like if you upgraded from another version some people change the password hash to match.. I would check account-signup.php and see how thats making the password hash.

I just tried it on my test site and works perfect..
Unknown User
2012-11-20 23:29:11
I have added ownercp.php and did something wrong with classes it's not recognizing my owner class that's bigger then admin as ,well, bigger

on admincp which is as default 7 the mod is working perfect...
Unknown User
2012-11-21 03:00:25
its ok for me, thanks Arcticwolf
2012-11-21 03:19:43
Thank you! " V2.8  :)

	 <td align="center"><a href="admincp.php?action=adduser"><img src="images/admin/adduser.png" border="0" width="32" height="32"><br/><?php echo T_("ADD_USER"); ?></a><br/></td>


Langues

French: $LANG["ADD_USER"] = "Ajouter un Membre";

Anglish: $LANG["ADD_USER"] = "Add User";

@+

adduser.png
adduser.png

Unknown User
2013-01-05 22:40:18
hello ,i have problem  :unsure:  I click okay and

"Database Error

Database Error. Please report this to an administrator."

I have this version:

TorrentTrader-2.08-FINAL

AdminCP in Annex

Database Error in admincp.php on line 371:Table '************_tracker.Users' doesn't exist

EDIT: sorry already running ,swapped "Users" to lowercase :)

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6450"]admincp.php[/url]
admincp.php
Download
Unknown User
2013-06-15 12:42:52
hello ArticWolf

use TT2.08

this correct this code?

#======================================================================#
# Add Users
#======================================================================#
if ($action == "adduser") {
   if ($CURUSER["class"] < "9") {
       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, stylesheet, language, uploaded) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email, $site_config["default_theme"], $site_config["default_language"], 5368709120)") or die(mysql_error());
       $id = mysql_insert_id();
//send pm to new user
if ($site_config["WELCOMEPMON"]){
       $dt = sqlesc(get_date_time());
       $msg = sqlesc($site_config["WELCOMEPMMSG"]);
       SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $id, $dt, $msg, 0)");
}
       $res = SQL_Query_exec("SELECT id FROM users WHERE username=$username");
       $arr = mysql_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("Add User");
?>

<div align=center>    
<CENTER><form method=get action=?>    
<input type=hidden name=action value=users>    Search Users: <input type=text size=30 name=search>    <input type=submit value='Search'>    
</form></CENTER><br />

<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>Username</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>Re-type 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="Okay" class=btn></td></tr>
</table>
</form>
</div>
<?

end_frame();
stdfoot();

}
#======================================================================#
# END Add Users
#======================================================================#
Unknown User
2013-06-16 22:28:07
it's work resolved TT2.08

copy exactly this code

#======================================================================#
# Add Users
#======================================================================#
if ($action == "adduser") {
if ($CURUSER["class"] < "9") {
       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 = mysql_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>Username</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>Re-type 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="Okay" class=btn></td></tr>
</table>
</form>
</div>
<?php
end_frame();
stdfoot();
}
#======================================================================#
# END Add Users
#======================================================================#


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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728