This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Adding, deleting and editing multiple users using a script

Snap provides a script addusers.pyc to create and modify accounts for Snap WebHost. This is supplied in the python utility folder of your installation (e.g. C:\Python25\Lib\site-packages\snap2\utils).

You must create a csv file or text file which lists the usernames and user details, including permissions.

Fields required in a csv or text file of users

The fields can be in any order. Only the username and password or email are required; all other fields can be omitted.

A description of the fields required is supplied in the file addusers.txt in the python utility folder and given below. (These are the same as the fields on the Snap WebHost User settings page.)

username

(required) Unique Id identifying the user

password

(required for new users if no email address) If left blank or omitted, the email address will be used

authnames

Authenticated username(s) for this account. Multiple authnames should be comma-separated (see Mapping authenticated users to Snap WebHost users retrospectively) If you are using a CSV file, multiple authnames should be quote delimited, e.g. "reduser, blueuser"

name

The name of the researcher

phone

Phone contact for the researcher

information

A note about the researcher (the researcher will not see this text)

email

(required for new users if no password) The email address of the researcher

survey_path

The absolute path to stored surveys (if blank/missing, a folder with the user's name will be created under the root user's folder)

style_path

The absolute path to stored style files (if blank/missing, a folder with the user's name will be created under the root user's style folder)

reports_path

The absolute path to the report files (if blank/missing, a folder with the user's name will be created under the default reports folder set in the System Admin tab)

logins

Number of concurrent logins allowed for this account (defaults to 1)

clients

The number of associates this user can create who have the right to see analyses on Snap WebHost. Defaults to DEFAULT_NUMBER_INTERVIEWING_ASSOCIATES in globalsettings.py

licences

The number of associates this user can create who have the right to use Snap Mobile Anywhere to connect to surveys on Snap WebHost and carry out interviews. Defaults to DEFAULT_NUMBER_INTERVIEWING_LICENCES in globalsettings.py

maxrespondents

The number of survey respondents allowed for this account. Leave blank or set to 0 to use the system setting (set in the System Admin tab)

maxsurveys

The number of surveys allowed for this account. Leave blank or set to 0 to use the system setting (set in the System Admin tab)

admin

Set to 1 if the user is a user admin and 0 if not (defaults to 0). User admin accounts cannot upload surveys.

offline

Set to 0 if Synchronisation service not installed. Set to 1 to enable user to upload surveys published in Mobile format for synchronisation and 0 to disable (defaults to 0)

projects

Set to 1 to enable access to survey list and responses etc and 0 to disable. (defaults to 1)

analysis

Set to 1 to enable viewing of survey analyses and 0 to disable (defaults to 1)

enabled

Set to 1 to enable access to Snap WebHost and 0 to disable (defaults to 1)

show_t&c

Set to 1 to show terms and conditions the next time this user logs on and 0 not to (defaults to 1)

changepassword

Set to 1 to force the user to change their password at their next login and 0 not to (defaults to 0)

If you are using a CSV file, the first row in the file must have the field names as the column headings. Each row represents a user.

If you are using a text file, each field must be on a line of its own in the format

field_name=value. You must delimit users with a asterisk (*) character on a line of its own.

Running the script

To set up the mapping within Snap WebHost run the script addusers.pyc in the following manner

python.exe addusers.pyc root_password user_details_file

E.g

python.exe addusers.pyc myRootPassword61 new_users.csv

See Also

Adding, deleting and editing individual users

User settings

Setting up users' styles and templates

Sharing surveys