how registry lots users CSWEB

Other discussions about CSPro
diaznhugo
Posts: 18
Joined: December 1st, 2016, 7:24 am
Contact:

how registry lots users CSWEB

Postby diaznhugo » August 10th, 2017, 7:50 pm

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
Hugo Diaz Nuñez
Dominican Republic

josh
Posts: 1227
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: how registry lots users CSWEB

Postby josh » August 11th, 2017, 6:42 am

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.

htuser
Posts: 249
Joined: December 19th, 2011, 6:26 pm
Location: HAITI

Re: how registry lots users CSWEB

Postby htuser » August 11th, 2017, 2:22 pm

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!

josh
Posts: 1227
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: how registry lots users CSWEB

Postby josh » August 14th, 2017, 2:11 pm

@htuser. No, that is not in our near term plan.


Return to “Other”