Bulk user creation

LATEST Official version.
Questions and discussions - NO ISSUES
FOR ISSUES => http://mantis.testlink.org

Moderators: Amaradana, TurboPT, TL Developers

Bulk user creation

Postby richinek » Thu Apr 14, 2016 8:38 am

Hi Testlink fans!

every month I need to create about 10-20 Testlink accounts. I do it manually via UI. Is there any other way how to do it? Script, API...?

Thx
richinek
Advanced user
 
Posts: 19
Joined: Thu Jan 13, 2011 8:39 am

Re: Bulk user creation

Postby Titovetch » Wed Sep 06, 2017 10:41 pm

does anyone has a solution for this
Titovetch
Advanced user
 
Posts: 15
Joined: Sat Jun 17, 2017 2:24 pm

Re: Bulk user creation

Postby fman » Fri Sep 08, 2017 3:12 pm

you have to use a simple sql script.
give a look to insert used on the sql script provided for installing testlink, there exists the line to create admin user, you can use it as model/example
fman
Member of TestLink Community
 
Posts: 2997
Joined: Tue Nov 15, 2005 7:19 am

Re: Bulk user creation

Postby Titovetch » Sun Sep 10, 2017 2:58 pm

Thanks Fman
i have used the below query with the same admin hash password to be "admin" as the default but its gave me this error


Error

Code: Select all
#1305 - FUNCTION testlink.HashBytes does not exist



Query
Code: Select all
 INSERT INTO /*prefix*/users (login,password,role_id,email,first,last,locale,active,cookie_string)
 VALUES ('Username','21232f297a57a5a743894a0e4a801fc3', 7,'', 'A', 'B','en_GB',1,HashBytes('MD5',CAST(RAND() AS CHAR)) + HashBytes('MD5','Username') )
Titovetch
Advanced user
 
Posts: 15
Joined: Sat Jun 17, 2017 2:24 pm

Re: Bulk user creation

Postby Titovetch » Wed Sep 13, 2017 4:14 pm

appreciate your support
Titovetch
Advanced user
 
Posts: 15
Joined: Sat Jun 17, 2017 2:24 pm

Re: Bulk user creation

Postby TurboPT » Wed Sep 13, 2017 8:58 pm

Which database are you using?

I believe (but I could be wrong) that the HashBytes is specific to sql server?
TurboPT
Member of TestLink Community
 
Posts: 328
Joined: Sun Dec 10, 2006 4:51 am

Re: Bulk user creation

Postby Titovetch » Sun Sep 17, 2017 4:41 pm

i'm executing that query through PHPmyadmin on the testlink database so how to crate hashcode into MYSQL
Titovetch
Advanced user
 
Posts: 15
Joined: Sat Jun 17, 2017 2:24 pm

Re: Bulk user creation

Postby TurboPT » Sun Sep 17, 2017 4:59 pm

Ok, so it does look like that you have used the insert query example (with HashBytes) found in:
\install\sql\mssql\testlink_create_default_data.sql

...but for MySQL, use the insert query example found in:
\install\sql\mysql\testlink_create_default_data.sql
TurboPT
Member of TestLink Community
 
Posts: 328
Joined: Sun Dec 10, 2006 4:51 am

Re: Bulk user creation

Postby Titovetch » Mon Sep 18, 2017 6:41 am

thanks Turbo this what i have used above and the error the same

Code: Select all
INSERT INTO /*prefix*/users (login,password,role_id,email,first,last,locale,active,cookie_string)
 VALUES ('admin','21232f297a57a5a743894a0e4a801fc3', 8,'', 'Testlink', 'Administrator', 'en_GB',1,HashBytes('MD5',CAST(RAND() AS CHAR)) + HashBytes('MD5','admin') );


error
Code: Select all
#1305 - FUNCTION testlink.HashBytes does not exist
Titovetch
Advanced user
 
Posts: 15
Joined: Sat Jun 17, 2017 2:24 pm

Re: Bulk user creation

Postby TurboPT » Mon Sep 18, 2017 4:14 pm

Did you not read my previous post?

The query that you have used will give the same error, because you are using the WRONG insert example for MySQL.

You need the insert user example found in the MySQL path, and NOT the MSSQL path.
See my previous post for the path differences, so that you get the example from the correct file.
TurboPT
Member of TestLink Community
 
Posts: 328
Joined: Sun Dec 10, 2006 4:51 am

Re: Bulk user creation

Postby Titovetch » Tue Sep 19, 2017 8:27 pm

Thanks Turbo ,i was opened the wrong file but the correct path so that i posted the same query again :D
Titovetch
Advanced user
 
Posts: 15
Joined: Sat Jun 17, 2017 2:24 pm

Re: Bulk user creation

Postby TurboPT » Tue Sep 19, 2017 8:29 pm

So is the query good now?
TurboPT
Member of TestLink Community
 
Posts: 328
Joined: Sun Dec 10, 2006 4:51 am


Return to TestLink 1.9



Who is online

Users browsing this forum: No registered users and 2 guests