The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
Import Users to Userspice - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Import Users to Userspice (/showthread.php?tid=484)



Import Users to Userspice - joeluvmusic - 03-02-2017

I am new to Userspice and it's great to have this framework which reduces the development time. But I would like to know how can I import users to Userspice? I am currently using Userspice to built an web application in which I need to import users from our legacy system. I would also like to assign a default password for all the users like 'test123' or something which they can change after logging in to the system.

If I can use SQL to import users then please let me know how to assign a default password for users.

I appreciate your time on my behalf and many thanks in advance.


Kind Regards,
Joe


Import Users to Userspice - mudmin - 03-02-2017

Ok. Here's how I would do that. I'm going to assume that you don't have a bunch of users in your userspice install yet... so here's what I would do.

Go into your old userspice table...probably would be best to be an export of that table.

Import it into your userspice database into a table called users2.

Make sure your users2 table has at least...
email (varchar255)
userername (varchar255)
password (varchar255)
fname (varchar255)
lname (varchar255)

Then go into userspice the old fashioned way and create a new account that has the default password you want to use.

Then you want to make a patch file like patchme.php and put it in your users folder. I wrote a basic patch. It could have a bug or 2, but it's really close.
https://hastebin.com/owowobonah.xml

Copy paste that in your patchme.php

NOTE: In the patch I used the default password of 'password'. If you want to use test123, then copy the password blob in your users table from the user you created above in place of the blob in my patch.

Let me know how that works.




Import Users to Userspice - joeluvmusic - 03-03-2017

Many Thanks Muadmin for your help, much appreciated!. I will try your solution soon.