Products Downloads Prices Support Company
WebShareIt
Product Links
Download Now
FAQ
Email Support
Register
Updates
Demo
Manual
   


This Product has been discontinued, try SurgePlus instead.

WebShareIt installation and management guide

This guide is intended for system administrators who are installing / customising or managing a site running WebShareIt. WebShareIt is a cgi and because it's output comes from html based template files it can be extensively customized to provide a distinctive web based file sharing service for your customers. WebShareIt comes with a default set of template files this allows it to be used as is, or to be completely rewritten to provide a particular look and feel to make it unique.

The following sections describe...


Configuration settings

In order to configure the WebShareIt you need to edit the configuration file webshareit.ini found in the cgi's directory of your web server, the settings you can use in the webshareit.ini file are as follows...

Setting NT Example Unix Example Description
workarea \webshareit\work /var/spool/webshareit/work This is the directory where webshareit creates temporary files, keeps it's data files and the newuser files newuser.dat, visit.idx and site.idx files. This setting defaults to the templates directory.
templates \webshareit /var/spool/webshareit This is the directory where webshareit's .tpl files are, these are the html pages shown to users using webshareit.
logpath \webshareit\logs /var/spool/webshareit/logs This is the directory where webshareit creates it's log files. This setting defaults to the templates directory.
loglevel error (as nt) This is the level of logging information written into the log file, if you are having problems with webshareit set this to "debug", and read the log file, if this doesn't help you please send that log file to support-webshareit@netwinsite.com. The other values for this setting are "error" which only logs error messags and "info" which logs useful information about what commands get called and by whom.
manager postmaster (as nt) This is the user that has management control over the webshareit system. This user gets extra management options when they login to webshareit
auth_server 1.2.3.4 (as nt) This is the ip number of the server that webshareit uses to authenticate users, it can be a Pop3 or Ftp server. When a user logs in webshareit attempt to login to this server with the supplied username and password.
auth_port 110 (as nt) This is the port for the above Pop3 or Ftp server.
auth_prefix domain_ (as nt) This is the prefix prepended to the username sent to the pop3 or ftp server. Required if you have DMail Mail Server, this is a virtual domain, and you have prefix based virtual domains. This setting means a virtual domain user can just type thier name i.e. bob and webshareit will prepend the required domain_ before authenticating.
auth_suffix @domain.com (as nt) This is the suffix appended to the username sent to the pop3 or ftp server. Required if you have DMail Mail Server, this is a virtual domain, and you have suffix based virtual domains. This setting means a virtual domain user can just type thier name i.e. bob and webshareit will append the required @domain.com before authenticating.
smtphost 1.2.3.4 (as nt) This is the Smtp server that webshareit can use to email shares to people.
smtpport 25 (as nt) This is the port for the above Smtp server.
full_action true (as nt) This is a true false setting that tells webshareit to use a full url for the ||acton|| output variable. "true" causes webshareit to produce a full http:// url to itself and store it in the ||action|| variable, "false" causes a relative url to be produced i.e. "/scripts/webshareit.exe".
dflt_command show_login (as nt) This is the default command webshareit will carry out if it is given no other command.
nwimg /nwimg/webshareit (as nt) This is the relative url to the webshareit images that are used on the .tpl pages.
initial_folders Public,Private (as nt) This is a comma seperated list of folders to create for a new user who logs in for he first time.
file_content readme text/plain (as nt) This is a setting that allows you to tell webshareit what content-type header to use when sending files to the user when they download them, the content-type header effects what the browser does when it recieves the file. The first part of the setting is what webshareit tries to match against the filename, it is a wild card so you can have *.txt for example, the last part of the setting is the content-type to use.
autologin /scripts/webmail.exe c:\webmail /cgi-bin/webmail.cgi /var/spool/webmail This setting allows you to setup auto-login from webshareit to WebMail, WebNews or one of the other NetWin cgi programs. Auto-login is a way of using the other cgi without having to enter login details again, which means the transfer is seamless and if done well the user may not even be able to tell they have started to use another cgi program.
key aaaa-bbbb-cccc-dddd-eeee-ffff-gggg (as nt) This is the registration key, you will recieve one of these when you register your copy of webshareit.
domain webshareit.com (as nt) This is the domain name of the webshareit web server computer, webshareit uses it as the name of the local machine in the pulldown on the folders page, i.e. it shows "user@webshareit.com" where webshareit.com was the domain setting.
path_translation /web \inetpub\wwwroot\users\$(user)  Text /web /home/httpd/html/users/$(user) Text This setting creates a mounted folder in the users directory, this folder acts like a normal folder except files in it are actually stored in another location. The first part of the setting is the folder name the user sees, the seccond is the actual path where the files are stored and the third is a sentence or description of the folder shown to the user on the mounts page. This setting can be used in the webshareit.ini file and/ort the newuser.dat
default_ftp ftp.netwinsite.com Anonymous $(user)@$(auth_server) /pub (as nt) This setting sets up ftp sites for the user upon thier creation, these sites appear in the pull down list on the folders page and also on the servers page.
max_diskspace_dflt 25600 (as nt) This setting defines a global default value for a users maximum diskspace allowance
max_download_dflt 10240 (as nt) This setting defines a global default value for a user accounts maximum download allowance

Cgi commands

WebShareIt is a cgi and cgi programs gather input from web pages, as a result to tell the cgi what you want it to do you need to send it a command. To ask it to do something you use the "cmd" variable. For example in a query "?cmd=login" or as a form input tag <input type="text" name="cmd" value="login"> or if you want you can use an <input type="image" tag but you need to use the image name to specify the command e.g. <input type="image" name="login".

All these method will tell the cgi to attempt to login. Of course more information is required to do a login command, as in all the commands, below is a table explaining the commands and what variables are required. Most commands require you to be logged in, if so they require the utoken variable produced by the login and auto_login commands.

* optional variable.
^ command available before login.

Command Other input Description
^login_show *location This command displays the login page.
^login user,pass,*location This command logs the user in provided the usename and password are correct. If location is supplied then webshareit will show that site as soon as login is complete, otherwise the local site is shown.
^download location,download_file This command starts the download of the download_file from the location.
^auto_login user,pass_file This command auto-logs into webshareit from somewhere else, typically a NetWin cgi but detailed instructions on how to make something else auto-login to a NetWin cgi are available.
^folder_show   This command loads the new folder page.
^folder location,path,folder_name This command creates a new folder called folder_name in path on site specified by location.
do_auto_login *al_index This command attempts to auto-login to another NetWin cgi, you must setup the autologin settings in the config file first. Each auto-login setting you add gets an index (from 0) and the variable al_index is used to specify which autologin setting you actually want to use, if no al_index is given webshareit will attempt to auto-login to the first autologin setting (index  = 0).
logout   This command logs the user out, making the utoken variable useless.
location location This command displays the folder.tpl page, which then lists the files in the location variable.
refresh location,*path This command removes any cached ftp server directory listing, displays the folder.tpl page, which then lists the files in the location variable.
upload at_upload_file,location This command uploads the file specified by at_upload_file to location.
option_load   This command displays the options page and loads the users information.
option_save any _* variables This command saves the uses information.
server_load   This command loads the servers page.
server_open server_address,*server_port,*server_user,*server_pass This command saves then displays the server specified by then server_ variables.
server_save server_address,*server_port,*server_user,*server_pass This command saves the server specified by the server_ variables. The server_port setting defaults to 21, the server_username to "Anonymous", and the server_pass to "webshareit@netwinsite.com".
server_delete server_address,server_port,server_user,server_pass This command deletes the server specified by the server_ variables.
transfer_show   This command displays the transfer page.
transfer location,*path,sel_<filepath>,transfer_location,*transfer_path This command transfers files / folders selected by the sel_<filepath> checkboxes to the site and path specified by transfer_location and transfer_path.
delete_show   This command displays the delete page.
delete sel_<filepath> This command deletes all the files / folders selected by the sel_<filepath> checkboxes.
rename_show   This command displays the rename page.
rename location,*path,rename_from,rename_to This command renames rename_from to rename_to, on the folder template there is some javascript which takes the first file /folder selected by the sel_<filepath> checkboxes and places it's value in a hidden rename_file variable and ignores any more (the first in this case is the first passed to the cgi by the web server in the post data - this is not necessarily the highest vertically in the list on the page).
lock_show   This command displays the lock page.
unlock_show   This command displays the lock page.
lock location,*path,sel_<filepath> This command locks the file / folders selected by the sel_<filepath> checkboxes.
unlock location,*path,sel_<filepath> This command un-locks the file / folders selected by the sel_<filepath> checkboxes.
lock_load   This command displays the locks page.
lock_save lock_path This command saves the lock data specified by the lock_path variable.
lock_delete lock_path This command deletes the lock data specified by the lock_path variable.
copy_show   This command displays the copy page.
copy location,*path,copy_path,sel_<filepath> This command copies the files / folders specified by the sel_<filepath> checkboxes to the folder specified by the copy_path variable.
mount_load   This command shows the mounts.tpl page listing the mounts setup by the administrator.
move_show   This command displays the move page.
move location,*path,move_path,sel_<filepath> This command moves the files / folders specified by the sel_<filepath> checkboxes to the folder specified by the move_path variable.
share_show   This command displays the share page.
share location,*path,sel_<filepath> This command shares the folders specified by the sel_<filepath> checkboxes.
share_load   This command displays the shares page.
share_save share_path,share_pass,share_readonly,share_anonymous This command saves the share specified by the share_ variables.
share_delete share_path This command deletes the share specified by the share_path variable.
visit_load   This command displays the visit page.
visit_open visit_user,visit_name,visit_pass This command saves and then displays the visit specified by the visit_ variables.
visit_save visit_user,visit_name,visit_pass This command saves the visit specified by the visit_ variables.
visit_delete visit_user,visit_name This command deletes the visit specified by the visit_user and visit_name variables.
email_show   This command displays the email page.
email email_address This command emails email_address a small email message generated from the tofriend.tpl file which by default contains a url to webshareit containing the shared folder information but can in fact contain whatever you want.

Templates

WebShareIt uses template files to determine the output seen by the user. These files are simple html text files with extra bits. The extra bits are either variables or commands. Variables and commands are replaced or executed at runtime so while you only have one copy of the template file WebShareIt may create hundreds of different pages form it.

In order to place the value of a variable in a page returned by WebShareIt, simply place a || followed by the variable name and then another ||, like so...
||name||

and upon execution the ||name|| will be replaced by it's value and displayed.

There are several commands available and they all perform different operations. Using a command is similar to inserting a variable's value. You precede the command name with a || and finish it with a || as well, like so...
||define||

some commands like the define command require parameters. In order to add parameters to commands, simply seperate each parameter with a || like so....
||define||setting||value||

This command would create a variable called "setting" and give it a value "value".

Some commands are used to perform logical operations, like ||ifdef|| or ||ifequal||. In cases like these, the operation is performed and, depending on the outcome, the html following the command is either displayed or skipped. In order to reverse a logical operation, use the ||else|| command. In order to end a logical operation, use the ||endif|| command.

IMPORTANT: There must be an equal number of logical commands and concluding endif commands or errors will occur during template display.

Here is an example of a couple of logical operation commands...

||ifequal||name||netwin||
  <p>Name is netwin</p>
  ||ifdef||pass||
    <p>Password supplied</p>
  ||else||
    <p>No pass</p>
  ||endif||
||else||
  <p>Name is ||name||</p>
||endif||

Notice above that there are two logical operation commands -  ifequal (if equal) and ifdef (if defined) - and thus there are two endif commands. Also note that the lines have been tabbed to show which statements enclose others. This makes no difference to the cgi but makes it easier to read.

The cgi interprets the above as follows...
Does name = "netwin",
    If it does, the cgi writes "<p>Name is netwin</p>"
Does the variable pass exist,
    If it does, the cgi writes "<p>Password supplied</p>"
    If it doesn't, the cgi reads but doesn't write lines until the ||else|| statement on line five.
        The cgi writes "<p>No pass</p>"
    If it doesn't, the cgi reads but doesn't write any lines until the third to last line, an ||else|| command.
        The cgi writes "<p>Name is ||name||</p>"

Complete list of logical commands
The text variable, variableA, and variableB have been used where you could type either a variable name or some text to be matched literally.

Command Description
|ifdef||variable|| This tests whether a setting called variable exists.
||ifequal||variableA||variableB|| This tests whether variableB (or the value of variableB) is equal to variableA (or the value of variableA.)
||iflower||variableA||variableB|| This has the opposite result to the above command.
||ifinstr||variableA||variableB|| This tests whether variableB (or the value of variableB) is within the variableA (or the value of variableA).

The commands above may seem rather limited, say for example you wanted to test whether something wasn't equal to something, there is no actual command for that but you can use the ifequal command and an else statement to achive the desired result, for example.
||ifequal||foo||bar||
||else||
...etc...
||endif||

The same is true for ifdef, iflower, and ifinstr.

Other commands

Command Description
||define||variableA||variableB|| This creates variableA, or sets variableA to variableB (or the value of variableB).
||undef||variableA|| This removes variableA.
||endif|| This ends a logical operation.
||else|| This switches case inside a logial operation.

More complicated commands

Below is a list of more complicated commands. These commands come in two types, the commands which act like the commands above....

i.e.   ||command_name||vars||vars...etc...

and a new type of command which "loops" around, giving new information each time. These commands are identified by the "begin_" prefix to the command name. A good example is the begin_files command, this command can be implemented like this...
||begin_files||
...html containing a ||file_name|| somewhere...
||end_files||
What the template above will show is the html between the begin_files and the end_files label repeated for as many files as there are. So if there are five files then it will be repeated five times. This is good for a select list such as...
<select name=files>
||begin_files||
<option name="||files_name||">||files_name||</option>
||end_files||
</select>

Command Description
begin_user_info This command displays the user information stored in webshareit's user data files. Each time it looks it outputs: ui_name, ui_label, ui_value, ui_total, ui_index, and ui_multi. For an example of the data in each one of those variables have a look at the options.tpl page.
begin_servers This command displays the information about the servers setup on the servers page. Output: server_address, server_port, server_user, server_pass, server_home, server_location. For an example see the folder.tpl, and transfer.tpl pages.
begin_files This command displays the files in the site specified by the location and path variables. Output: file_path, file_name, file_type, file_link, file_txt, file_size, file_date, file_shared, file_locked. For an example see the folder.tpl page.
begin_shares This command displays the shares setup on the shares page. Output: share_path, share_name, share_pass, share_readonly, share_anonymous, share_location. For an example see the shares.tpl page.
begin_visits This command displays the visits setup on the visits page. Output: visit_location, visit_user, visit_name, visit_pass. For an example see visits.tpl.
begin_locks This command displays the locks setup on the folder and locks page. Output: lock_path, lock_name, lock_who, lock_when, lock_isdir. For an example see the locks page.
begin_mounts This command displays the mounts setup by the administrator for the user. Output: mount_name, mount_path, mount_info. For an example see the mounts page.
cdup This command takes one parameter, the parameter is a path or a variable containing a path. The ouput from this command is the path above the one passed in the parameter, for example "||cdup||/foo/bar||" would be replaced by "/foo". For an example see the folder.tpl page.
comma_number This command takes one parameter, the parameter is a number or variable containing a number. The output from this command is the same number but with comma's ever third digit, for example "||comma_number||1234567||" would be replaced by "1,234,567". For an example see the folder.tpl page.
time_all This command takes one parameter, the parameter is the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time. The output from this function is a date time string in the format "Wed Jan 02 02:03:55 1980"
time_date This command takes one parameter, the parameter is the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time. The output from this function is a date time string in the format "Wed Jan 02 1980"
time_time This command takes one parameter, the parameter is the number of seconds elapsed since midnight (00:00:00), January 1, 1970, coordinated universal time. The output from this function is a date time string in the format "02:03:55"
html_encode This command takes one parameter, the parameter is a href or other similar html that you want to appear as a string in a url or on the page rather than it being interpreted as html and processed. For example this "<input type='text' name=" would be changed to "%3Cinput+type%3D%27text%27+name%3D".

New user defaults

When a user logs in for the first time WebShareIt asks that user for thier personal information, it also loads some default settings from a file called newuser.dat found in the WebShareIt workarea directory. This file is a plain text file in the same format as the ini file, so # means comment and the lines contain "setting_name<whitespace>value<end_line>". The settings you can place in this file are as follows:

Setting name Example Description
max_diskspace 51200 This is the number of bytes of disk space given to the user.
max_download 20480 This is the number of bytes of downloads available every 24 hours.
path_translation (see above) This setting is identical to the path_translation setting in the ini file (see above)

In addition to the newuser.dat file there are two more files that you can place in the workarea directory to give new users default settings, they are "site.idx" and "visit.idx". These files are plain text files containing site and visit entries, these entries are one per line and each file is seperated by a | symbol.

The visit.idx file entry format is:
  username|path|password
for example:
  john|/Public|secret

The site.idx entry format is:
  site|port|username|password|path
for example:
  ftp.netwinsite.com|21|Anonymous|email@netwinsite.com|/pub/webshareit

The easiest way to create these files is to set the entries up with the cgi for a user then copy them out of the users folder to the workarea, but you can edit them by hand if you prefer.


User administration

In order to administrate your users you first need a designated manager account, to designate an account as the manager you simply edit the webshareit.ini file and add / modify the manager setting so it specifies the manager account, i.e.
  manager thisaccount
you can add several manager accounts by simply adding more manager settings i.e.
  manager thisaccount
  manager thataccount
and so on.

Next you login with the account designated as the manager, and you should see the exact same page as normal except now there is a users button in the menu that was not there before. Click this button. You will see a list of all the users who have logged into WebShareIt, clicking any of these username will display info on the user account like last login, upload, and download and will also let you set quota's and add ftp servers, visits and mounted folders to the user. Back on the user list page you will see the same options for quota's, ftp servers, visits and mounted folders but here you can specify a wild card and it will add what you specify to all users matching that wild card.