Bulk user creation
Moderators: Amaradana, TurboPT, TL Developers
Bulk user creation
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
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
Re: Bulk user creation
does anyone has a solution for this
Re: Bulk user creation
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
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
Re: Bulk user creation
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
Query
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') )
Re: Bulk user creation
appreciate your support
Re: Bulk user creation
Which database are you using?
I believe (but I could be wrong) that the HashBytes is specific to sql server?
I believe (but I could be wrong) that the HashBytes is specific to sql server?
Re: Bulk user creation
i'm executing that query through PHPmyadmin on the testlink database so how to crate hashcode into MYSQL
Re: Bulk user creation
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
\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
Re: Bulk user creation
thanks Turbo this what i have used above and the error the same
error
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') );
Code: Select all
#1305 - FUNCTION testlink.HashBytes does not exist
Re: Bulk user creation
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.
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.
Re: Bulk user creation
Thanks Turbo ,i was opened the wrong file but the correct path so that i posted the same query again 

Re: Bulk user creation
So is the query good now?
Re: Bulk user creation
yes , it working good