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
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Import Users to Userspice
#1
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
  Reply
#2
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.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)