FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Basic scripted user manipulation
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Basic scripted user manipulation [message #33820] Fri, 22 September 2006 17:27 Go to next message
pssc is currently offline  pssc   United Kingdom
Messages: 6
Registered: September 2006
Karma: 0
Junior Member
Script allows you to manipulate form logins allowing you to create,delete,ban,unban,rename,modify,display users.

lives in the scripts directory

eg.
./users.php create pssc "Phillip Camp" pssc(at)noware(dot)com 'zxy123:'

./users.php ban pssc

./users.php rename pssc pcamp

Small patch for rename to work in forum_data dir:-
--- src/users_reg.inc.t.orig 2006-09-20 23:35:16.000000000 +0100
+++ src/users_reg.inc.t 2006-09-20 23:37:15.000000000 +0100
@@ -178,6 +178,7 @@
$this->html_fields();

q("UPDATE {SQL_TABLE_PREFIX}users SET ".$passwd."
+ login="._esc($this->login).",
name="._esc($this->name).",
alias="._esc($this->alias).",
email="._esc($this->email).",

  • Attachment: user.php
    (Size: 4.89KB, Downloaded 1404 times)
Re: Basic scripted user manipulation [message #34956 is a reply to message #33820] Mon, 27 November 2006 13:45 Go to previous messageGo to next message
appscontent   United States
Messages: 33
Registered: November 2006
Karma: 0
Member
I have been able to create a single user by running the users.php script detailed earlier in this thread. It works like a charm and greatly assists those of use who are not PHP coders and don't know how to call the functions in fudapi.inc.php.

I have saved an Excel file of my users in CSV format. It is my understanding that I could use PHP's fgetcsv() function to fetch users one at a time and for each user perform the create user. In other words, I don't want to add users one by one as follows:

./users.php create pssc "Phillip Camp" pssc(at)noware(dot)com 'zxy123:'


I would like to read a file and create the users until I hit the end of the file.

Could someone assist me in adding this logic into users.php (see original script attachment)? I have about 2000 users I want to add as users in the next day or so.
Re: Basic scripted user manipulation [message #161393 is a reply to message #34956] Sun, 20 December 2009 07:37 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
appscontent het op Mon, 27 November 2006 15:45 geskryf:
I would like to read a file and create the users until I hit the end of the file.


See example, "Add a list of users from a CSV file" at FUDAPI.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Wikipedia plugin is not working for Russians
Next Topic: Bridge Fudforum <--> Elgg
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri May 03 00:02:40 GMT 2024

Total time taken to generate the page: 0.02547 seconds