[TOOL] Import Users

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Scam Warning
Locked
jelo77
Registered User
Posts: 13
Joined: Thu Dec 23, 2010 3:25 am

Re: [TOOL] Import Users

Post by jelo77 » Thu Dec 23, 2010 3:33 am

HI,

I have successfully installed this tool and manage to import users. Could you please advice how to configure this tool or the board so that the imported users have to agree to the "terms of use" upon first connecting to the board? Until they have agreed, their profile should not be visible in the member directory.

Thanks, Jelo

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky » Thu Dec 23, 2010 5:46 am

Jelo,

I don't know how you would do that. In order for the new members not to show in the memberlist, they will need to be marked as inactive. If a member is marked as inactive, they will not be able to log in because they did not receive an activation email.

The other thing is, how to differentiate the newly added members from members that have registered and read the terms of use but not activated their account or visited the board since they registered. One way you may be able to tell, is that the import tool sets user_pass_convert to 1 unless you imported them with a phpbb_hashed password, but you may need to add another field to the users table so you can tell who has read the terms of use and who has not.

Your best bet is to ask in the MOD Requests forum if anyone has any ideas. You will need some sort of switch to send these imported users to the Terms of Use page and have a button to send them to the index page when they have agreed to the ToS. It would be similar to the registration process but have a different redirection and the ability to mark a field that they have read the ToS.
Have you hugged someone today?

jelo77
Registered User
Posts: 13
Joined: Thu Dec 23, 2010 3:25 am

Re: [TOOL] Import Users

Post by jelo77 » Thu Dec 23, 2010 6:12 am

Hi Dicky,

Thanks for the quick reply. I had hoped I can use the groups and permission to realize something like that.

Couldn't I create a group that I import the users into, such as unconfirmed, and then set permissions so that members in this group can view forums until they agree to the terms? I am not sure if phpBB can change a group membership automatically based on a trigger such as checkbox ticked. That way I could lock them out of everything except the terms and once they agree to the terms, their group is changed and they move into registered users.

That would leave the question if the permissions are granular enough to let me create new permissions for
- being displayed in the member directory
- being allowed to view the member directory

Cheers, Jelo

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky » Thu Dec 23, 2010 6:27 am

There are permissions for viewing the memberlist. There are no permissions for being displayed in the memberlist. That is determined by the member's active/inactive status.

Placing the imported members into a special group does sound like a good idea. I believe there is a post in this topic on how to add a user to a special group.

There is a MOD that will place a member in a group based on post count. Possibly this could be adapted or modified to fit your situation, but you should ask in the MOD Requests forum as this is beyond the scope of the convertors forum and MOD writers visit the MODs forums more than they do the convertors forum.
Have you hugged someone today?

Giles314
Registered User
Posts: 51
Joined: Thu Nov 11, 2010 12:12 am

V1.2 Update

Post by Giles314 » Tue Jan 04, 2011 8:09 pm

I realized I was missing the websites of my users so I made a new version of the import tool that can import them. I took the opportunity of this new version to catch an uncaught error when the enclosing character is not provided (the indication that this parameter is mandatory has been added too).

PS: Once you have imported your users you may want to import their messages. I have published a message import tool built from the example of this user import tool that may help you in this operation.

Edit: Switch to V1.2.1 to fix wrong packaging and a syntax error in the fr package.
New edit: Now switching to V1.2.2 to fix some import password problem and possibly killing notice outputs
Again a new version V1.2.3 to fix additional potential notice outputs (if notices are enabled) but without other impact
Again a bug fix in version V1.2.4: This fixes the installer
(keep using V1.2.1-fr language package. It is still compatible with V1.2.4 core mod)
Attachments
csv_user_import_V1.2.1-fr.zip
CSV Import User V1.2.1 French Language pack
(5.57 KiB) Downloaded 319 times
csv_user_import_V1.2.4.zip
CSV Import User V1.2.4 MOD
(44.19 KiB) Downloaded 1583 times
Last edited by Giles314 on Thu Sep 13, 2012 10:09 pm, edited 5 times in total.

jelo77
Registered User
Posts: 13
Joined: Thu Dec 23, 2010 3:25 am

Re: [TOOL] Import Users

Post by jelo77 » Wed Jan 19, 2011 11:19 pm

I solved my problem with the memberlist. Basically, I just hacked a few files to make use of the field user_lastvisit in the users table. I am now only showing users in the memberlist who have at least logged in one time (if they haven't, the user_lastvisit field will be 0).

However, I now have two other problems:

1) My email template user_import.txt in language/en/email: I updated the text, but it just will not show up in the email that is actually send. Do I need to clear some cache or something and how do I do that?

2) The email that is send out always reads: "You password is unable to be determined since it was encrypted in our previous database". I can select plaintext or hashed, it only makes a difference in the database, but not in the email that goes out to the user. Given that I upload a file including a plain text password, shouldn't it show up in the email correctly?

Thanks, J.

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky » Thu Jan 20, 2011 12:01 am

jelo77 wrote:1) My email template user_import.txt in language/en/email: I updated the text, but it just will not show up in the email that is actually send. Do I need to clear some cache or something and how do I do that?
I do believe you have to clear the cache.
jelo77 wrote:2) The email that is send out always reads: "You password is unable to be determined since it was encrypted in our previous database". I can select plaintext or hashed, it only makes a difference in the database, but not in the email that goes out to the user. Given that I upload a file including a plain text password, shouldn't it show up in the email correctly?
The password is sent only if the tool generates a password. This is when you don't have a password to import and the password field is left blank. Otherwise it is assumed that your users will use the password from whatever system you were using before.
Have you hugged someone today?

jelo77
Registered User
Posts: 13
Joined: Thu Dec 23, 2010 3:25 am

Re: [TOOL] Import Users

Post by jelo77 » Thu Jan 20, 2011 12:24 am

Okay, clearing the cache worked. Apparently, I cleared the wrong cache before. I tried it on the template files. Now I realized there is a button right on the first page of the ACP to clear the cache and it worked.

However, the password is not showing in the email. I tried all options, including leaving the password field empty. A line in the csv file would look like:
test,,test@test.com

In the upload screen I would set username to 0, password to 1 and email to 2. Does anybody else have the same issue?

Thanks, J.

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky » Thu Jan 20, 2011 1:00 am

jelo77 wrote:However, the password is not showing in the email. I tried all options, including leaving the password field empty. A line in the csv file would look like:
test,,test@test.com

In the upload screen I would set username to 0, password to 1 and email to 2.
Those settings are correct.

When you modified your template file, did you leave the password field in

Code: Select all

----------------------------
Username: {USERNAME}
Password: {PASSWORD}

Board URL: {U_BOARD}
----------------------------
I just tested and it worked for me
Please keep this e-mail for your records. Your account information is as
follows:

----------------------------
Username: DickyIII
Password: 2FWRFK

Board URL: http://localhost/phpBB3
----------------------------
Have you hugged someone today?

jelo77
Registered User
Posts: 13
Joined: Thu Dec 23, 2010 3:25 am

Re: [TOOL] Import Users

Post by jelo77 » Thu Jan 20, 2011 2:54 am

Strange... Password field is still in the template.

Anyway, I will try it out again tomorrow. Does the import make use of the same functions to look up users as the member directory? I assumed it would take the value directly from the import file (and not get it from the database). If it comes from the database instead, maybe my changes to the files to exclude users that have not logged in yet causes the issue...

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky » Thu Jan 20, 2011 3:28 am

The import tool does take the data from the import file to send out the email. It doesn't look in the database for this.
Have you hugged someone today?

User avatar
BellaChiCa
Registered User
Posts: 36
Joined: Sun Dec 07, 2008 1:16 am

Re: [TOOL] Import Users

Post by BellaChiCa » Fri Jan 28, 2011 1:54 pm

Hey,

I have tried this import tool on a phpbb3 forum with nuke-data, but i get this error :

No Username found on line 1: line skipped.
....

My CSV file:

Code: Select all

"user_id","name","Username","user_email","femail","user_website","user_avatar","user_regdate","user_icq","user_occ","user_from","user_interests","user_sig","user_viewemail","user_theme","user_aim","user_yim","user_msnm","user_password","storynum","umode","uorder","thold","noscore","bio","ublockon","ublock","theme","commentmax","counter","newsletter","user_posts","user_attachsig","user_rank","user_level","broadcast","popmeson","user_active","user_session_time","user_session_page","user_lastvisit","user_timezone","user_style","user_lang","user_dateformat","user_new_privmsg","user_unread_privmsg","user_last_privmsg","user_emailtime","user_allowhtml","user_allowbbcode","user_allowsmile","user_allowavatar","user_allow_pm","user_allow_viewonline","user_notify","user_notify_pm","user_popup_pm","user_avatar_type","user_sig_bbcode_uid","user_actkey","user_newpasswd","points","last_ip","karma","user_group_cp","user_group_list_cp","user_active_cp","agreedtos","user_nqlm_enable","user_nqlm_level","user_gender"

User avatar
D¡cky
Former Team Member
Posts: 11812
Joined: Tue Jan 25, 2005 8:38 pm
Location: New Hampshire, USA
Name: Richard Foote
Contact:

Re: [TOOL] Import Users

Post by D¡cky » Fri Jan 28, 2011 4:06 pm

BellaChiCa wrote:Hey,

I have tried this import tool on a phpbb3 forum with nuke-data, but i get this error :

No Username found on line 1: line skipped.
....

My CSV file:

Code: Select all

"user_id","name","Username","user_email","femail","user_website","user_avatar","user_regdate","user_icq","user_occ","user_from","user_interests","user_sig","user_viewemail","user_theme","user_aim","user_yim","user_msnm","user_password","storynum","umode","uorder","thold","noscore","bio","ublockon","ublock","theme","commentmax","counter","newsletter","user_posts","user_attachsig","user_rank","user_level","broadcast","popmeson","user_active","user_session_time","user_session_page","user_lastvisit","user_timezone","user_style","user_lang","user_dateformat","user_new_privmsg","user_unread_privmsg","user_last_privmsg","user_emailtime","user_allowhtml","user_allowbbcode","user_allowsmile","user_allowavatar","user_allow_pm","user_allow_viewonline","user_notify","user_notify_pm","user_popup_pm","user_avatar_type","user_sig_bbcode_uid","user_actkey","user_newpasswd","points","last_ip","karma","user_group_cp","user_group_list_cp","user_active_cp","agreedtos","user_nqlm_enable","user_nqlm_level","user_gender"
If that is the first row, that is the problem. You cannot have the field names as the first row.

You want to use the Username field for the user's name, so the field numbering is:
username = 2
user_email = 3
password = 18
You should be able to figure the positioning of any other fields you want from there.
Have you hugged someone today?

User avatar
BellaChiCa
Registered User
Posts: 36
Joined: Sun Dec 07, 2008 1:16 am

Re: [TOOL] Import Users

Post by BellaChiCa » Fri Jan 28, 2011 5:13 pm

D¡cky wrote: If that is the first row, that is the problem. You cannot have the field names as the first row.

You want to use the Username field for the user's name, so the field numbering is:
username = 2
user_email = 3
password = 18
You should be able to figure the positioning of any other fields you want from there.

ooh, now I do understand! Ill test it in the evening, thank you very much :D

livetek
Registered User
Posts: 2
Joined: Mon Feb 14, 2011 9:51 am

Re: [TOOL] Import Users

Post by livetek » Mon Feb 14, 2011 11:41 am

Hello Dicky, Can you tell me from where I can download this Import Users script? I have just not been able to find this on the Customize mods section anywhere.

Thanks,
Vishal

Locked

Return to “[3.0.x] Convertors”