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
2008-07-07 16:21:32
This mod was made by Avtec from TBDEV....

This adduser mod allows staff to add users even if user registration is closed or by invites.....

<?

require "backend/functions.php";

dbconn();

loggedinonly();





if (get_user_class() < 5)

show_error_msg("Error", "Access denied<br>:(");



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($secret . $password . $secret));

$secret = sqlesc($secret);

mysql_query("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)") or die(mysql_error());

$res = mysql_query("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]");

die;

}

stdhead("Add user");

begin_frame();

?>

<div align=center>

<h1>Add user</h1>

<form method=post action=adduser.php>

<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();

?>


Cumpss
Unknown User
2008-07-07 17:51:49
here if you want this in admincp.php. note the link may be done different in your admincp.php because i have modified mine.

add to admincp.php:

print ("<td align=center><a href=admincp.php?action=adduser><img src=images/admin/users.gif border=0 width=32 height=32><br><center><b>Add User</center></b></a><BR></td>\n");





add to the end of admincp.php:





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

# Add Users

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

if ($action == "adduser") {

if ($CURUSER["class"] < "8"){

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);

mysql_query("INSERT INTO users (added, last_access, secret, username, password, status, email) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email)") or die(mysql_error());

$res = mysql_query("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]");

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
2008-07-07 22:57:29
:mellow: nice
Unknown User
2008-07-08 18:23:48
been looking for this lol thank you 100%
Unknown User
2008-08-16 13:55:47
Thank you  :blink: .
Unknown User
2008-10-02 18:30:16
I am having a hard time understanding this mod, where do i put the big peice of code at the top? do I replace my backend/functions.php?
Unknown User
2008-10-02 18:42:15
i have made that code at the top as you put it in to a php file ...upload it to root where the other site files are

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=2927"]adduser.php[/url]
adduser.php
Download
Unknown User
2008-10-02 18:45:46
so download the file and just put it in my root? will that overwrite anything?
Unknown User
2008-10-02 18:55:04
Ok I have uploaded it to my root folder, so now how do I use it? and is there anyway I can set a default number of invites a person gets once they register? Like say you get 2 invites when you register and you have to earn the rest though seed bonus?
Unknown User
2008-10-02 19:01:55
is it says in the 1st post this mod will allow staff to add a new user instead of them signing up ..

as for the invites ect i dont use the v2 so i am not clued up on it  ,, but there could well be a post for the invites

check in the requests and the completed sections
Unknown User
2008-10-14 11:19:55
mmm not work..

a new user is correctly insert in databae, but when i try to login with a new user i receive an error:

"'Password Incorrect'"
Unknown User
2008-10-14 13:59:11
change:

$passhash = sqlesc(md5($secret . $password . $secret));

to:

$passhash = sqlesc(md5($password));
Unknown User
2008-10-14 14:48:47
yeah! work!

thanx!
Unknown User
2008-12-12 14:43:07
can someone please check the username validation... it seems not working... if it got duplicate username, the blank page with message "Duplicate entry 'admin' for key 2" will appear... could someone please check it...
Unknown User
2009-01-16 21:21:42
this installed fine but now i have added duplicate ip mod and we cant make any new accounts is there anyway around it please

give me same message as it would if i just tried to make a new account from sign up

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