how registry lots users CSWEB

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
diaznhugo
Posts: 18
Joined: December 1st, 2016, 7:24 am

how registry lots users CSWEB

Post 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
Hugo Diaz Nuñez
Dominican Republic
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: how registry lots users CSWEB

Post 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.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: how registry lots users CSWEB

Post 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!
G.VOLNY, a CSProuser from Haiti, since 2004
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: how registry lots users CSWEB

Post by josh »

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