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
2009-02-27 20:02:08
"walker1977, post: 44129":
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

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



hello walker did can say how configure your code to insert 5 gb to her account and make default language and default theme ????????
Unknown User
2009-02-28 21:25:40
To answer RockySt's question...

You can make all you want via your database(add gigs and change id for theme and language)

For add gigs from your CP,a mod exist in "Premium Hacks & Modifications (V2 ONLY)"...if you are premium of course.
Unknown User
2009-02-28 22:55:29
the user should have the default theme and language that the site is set to when you make the account and they log in. to add gigs change the query below.

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





to





mysql_query("INSERT INTO users (added, last_access, secret, username, password, status, email,uploaded) VALUES(NOW(), NOW(), $secret, $username, $passhash, 'confirmed', $email, 5368709120)") or die(mysql_error());
Unknown User
2009-02-28 23:14:46
"walker1977, post: 54481":
the user should have the default theme and language that the site is set to when you make the account and they log in. to add gigs change the query below.


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




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



You're a chief  ;)

Works 100 %

But if i want to send the pm in config.php (the pm original) how i do ???
Unknown User
2009-03-01 00:28:56
here is the code with the default theme if for some reason there are problems.

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





as for the pm add what is below after the query.





$id = mysql_insert_id();

//send pm to new user

if ($site_config["WELCOMEPMON"]){

$dt = sqlesc(get_date_time());

$msg = sqlesc($site_config["WELCOMEPMMSG"]);

mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $id, $dt, $msg, 0)");

}
Unknown User
2009-03-01 01:28:09
Thanks you walker 100 % functions but for default theme and lang dont function (i have modified and function)

thanks you ;)
Unknown User
2009-04-07 08:49:55
Thanks for this i used walkers code but with a little search user option on it, if anyone wants to use it feel free.

Find:

stdhead("Add user");

navmenu();

begin_frame("Add User");

?>



After Add:

<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 />



Regards
Unknown User
2009-07-17 23:38:42
thanks for this mod , work number one :)
Unknown User
2010-03-12 20:00:27
"walker1977, post: 44129":
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

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


For 2..06 it works great.

Only 1 little thing needs to be changed.

Find

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

replace with:

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

If you don't delete the "/" then you get a blanc screen and not the new users account.
Unknown User
2010-10-29 01:51:38
Hi Guys,

I have tried this mod but I can't make it working correctly.  When I click on the ADD USER, I get the following message:

Error

'Sorry you do not have the rights to view this page!'

Note:  I am logged in as an administrator.

I will post my PHP file.

Thanx. Regards.

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=4305"]admincp.php[/url]
admincp.php
Download
Unknown User
2010-10-29 05:07:31
i strongly suggest this not to be used.

Why?

1.) It doesnt check the database to see if the username already exists, you would just probably see a mysql error and wonder why it was caused... this is the problem.

2.) The username should be validated by the validusername function which sits in account-signup.php, so move this function to backend/functions.php and you will be able to call it in admincp.php
Unknown User
2010-10-29 13:30:30
"rdesormiers, post: 66809":
Hi Guys,
I have tried this mod but I can't make it working correctly.  When I click on the ADD USER, I get the following message:

Error

'Sorry you do not have the rights to view this page!'

Note:  I am logged in as an administrator.

I will post my PHP file.

Thanx. Regards.


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

change nr 8 to 7
Unknown User
2010-10-29 20:32:38
"war02, post: 66823":
if ($CURUSER["class"] < "8"){
change nr 8 to 7


Thanx for the Q.  It's working now!

Though, I was wondering if it would be possible to put a BUTTON called, CREATE and EMAIL + maybe a feature that would do an automatic search if the USERS exist. So when you press it, the NEW MEMBER would receive all their informations by email.

Cheers!
Unknown User
2010-11-02 02:58:48
Array ( [status] => 10 [error_msg] => LOGIN_ERROR_USERNAME [user_row] => Array ( [user_id] => 1 ) )


could anyone help me with this error? the account gets created fine, it's when they go to log in.
Unknown User
2010-11-02 03:09:17
this looks like you have intregrated phpbb...

2 things you can try...

run the import and the user maybe there

or

delete the user and add some code to adduser to insert them into db like on registration
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