Page 1 of 1

how registry lots users CSWEB

Posted: August 10th, 2017, 7:50 pm
by diaznhugo
Hello community

I want know the way to create lots users on csweb server.

I need to create 30 users and want insert at mysql database the users, but i dont know what is the function i need to use csweb to encrypt password field.

thanks

Re: how registry lots users CSWEB

Posted: August 11th, 2017, 6:42 am
by josh
We are planning to add a a way to upload a spreadsheet of users to CSWeb but it is not ready yet. In the meantime if you look in the setup script (csweb\setup\configure.php) you can see how the admin user is created. It uses the standard php password_hash function:

$hash = password_hash($adminPassword, PASSWORD_DEFAULT);
$sql = <<<EOT
INSERT IGNORE INTO `cspro_users` (`username`, `password`, `first_name`, `last_name`,`role`) VALUES
('admin', '$hash', 'System', 'Administrator','2');
EOT;
$pdo->exec($sql);

To create a non-admin users change the '2' to '1'.

Note that in future versions of CSWeb this may not work as we are planning to add more fine-grained user permissions which will change the user table in the database. However this will work for the current version.

Re: how registry lots users CSWEB

Posted: August 11th, 2017, 2:22 pm
by htuser
Hi Josh,
Does that mean, by this way you'll consider implementing theses permissions too in DataViewer so a specific user can read-only/View only data ( No export, tabulate frequencies or convert)?
Also the Csdb file can be opened only in DataViewer using the same permissions/rights?
Thanks in advance for supporting me!

Re: how registry lots users CSWEB

Posted: August 14th, 2017, 2:11 pm
by josh
@htuser. No, that is not in our near term plan.