Create BULK users in OpenKM

OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
saquib.akhtar
Junior Boarder
Junior Boarder
Posts: 24
Joined: Mon Feb 26, 2018 7:37 am
Location: INDIA
Contact:

Create BULK users in OpenKM

Post by saquib.akhtar » Sat Aug 04, 2018 7:09 am

How can I create bulk users upto 100 in OpenKM panel ?
Is there any database script for that?

jllort
Moderator
Moderator
Posts: 10347
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Create BULK users in OpenKM

Post by jllort » Sat Aug 04, 2018 3:26 pm

If I understood, you are looking for a quick way for creating users ( 100 or more ). With or without roles ?

saquib.akhtar
Junior Boarder
Junior Boarder
Posts: 24
Joined: Mon Feb 26, 2018 7:37 am
Location: INDIA
Contact:

Re: Create BULK users in OpenKM

Post by saquib.akhtar » Sun Aug 05, 2018 7:46 pm

yes, creating 100 users with roles

jllort
Moderator
Moderator
Posts: 10347
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Create BULK users in OpenKM

Post by jllort » Mon Aug 06, 2018 5:31 pm

In that case I suggest scripting

Code: Select all

import com.openkm.api;

OKMAuth.getInstance().createUser(null, "userId", "password", "test@openkm.com", "User Name", true); // repeat the line for each user
OKMAuth.getInstance().assignRole(null, "userId", "ROLE_TEST"); // repeat the line for each role you wish to assign to the user
You can easily convert excel column as scripting.

saquib.akhtar
Junior Boarder
Junior Boarder
Posts: 24
Joined: Mon Feb 26, 2018 7:37 am
Location: INDIA
Contact:

Re: Create BULK users in OpenKM

Post by saquib.akhtar » Tue Aug 07, 2018 3:10 am

Will this need a text file or excel as input ?
(bash scripting)

jllort
Moderator
Moderator
Posts: 10347
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Create BULK users in OpenKM

Post by jllort » Thu Aug 09, 2018 4:37 pm

You can write the script manually with copy & paste or as I suggested create an XLS file -> export to CSV -> edit file and remove tabs, etc... -> you get the script ( where each row of the file is the insert )

saquib.akhtar
Junior Boarder
Junior Boarder
Posts: 24
Joined: Mon Feb 26, 2018 7:37 am
Location: INDIA
Contact:

Re: Create BULK users in OpenKM

Post by saquib.akhtar » Thu Aug 16, 2018 6:20 am

Thanks !!

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests