Monday, November 1, 2010

Server configuration variables

The purpose of server side configuration is to provide more control of the hosted sites to the server owner. All these variables are used to increase security of the server, by limiting developers access rights to certain server data (environmental variables, paths above virtual hosts wwwroot directory, writing files during run-time), or by limiting the ability to use some WBSP functionalities (scripting host, file upload, full definition of ADO connection string, limiting number of instances of the WBSP engine that can be used simultaneously by single virtual host or even disabling WBSP on certain virtual hosts) or by strictly defining the rules by which WBSP can be used in CGI mode.
Server-side configuration variables :
AbsolutePath
DefaultDocument
MaxInstances
RegCode
Upload

read more

Server configuration section

This section contains specific server side configuration for all aliases of a single virtual host defined in Servers section. It has to be created for every virtual host that needs separate configuration different from default settings. Here's an example:
[wbsp.com]
DisableWB=F
AbsolutePath=On
Upload=On
FileCommands=On
Execute=JavaScript,VBScript,JScript
HiddenEnvVars=PATH,COMP*,System*
TimeOutSec=20
DefaultDocument=index.wbsp
ADOConnectionString=T
ActivateCGIByExt=wbsp
CGISecurityString=LhBv3KP
MaxInstances=0
HideDocuments=sr,aut,inc,ic,mdb
ScriptTimeOutSec=60

[dsd.ba]
DisableWB=F
AbsolutePath=Off
Upload=On
FileCommands=Off
Execute=VBScript
HiddenEnvVars=PATH,COMP*,System*,Win*
TimeOutSec=10
DefaultDocument=default.wbsp
ADOConnectionString=F
ActivateCGIByExt=wbsp
CGISecurityString=LhBv3KP
MaxInstances=10
 

SF (WB_Command) - Send file

Description
This command is used for sending unchanged file defined in variable WB_TempName to client. The file will not be processed or changed in any way, regardless of its content or type.

read more

Subsection [MsgAndLbl]

This subsection contains the variables that define labels and style for navigation links (for previous, next, first and last page) and messages (empty recordset and deleted records). They can contain any valid HTML code including WhizBase report tags and functions both in input and output syntax.
It can also contain variables for formatting navigation links WB_Style.
These are variables that can be stored in this subsection (in alphabetic order):
WBM_NoMatch
Here is the example of MsgAndLbl section (marked blue):




Titles

Year published Title ISBN
$wbf[Year published] $wbf[title] $wbf[ISBN]

$wbnavigator


To test this example, create images rightarrow.gif, leftarrow.gif, first.gif and last.gif and place them in directory images located in same directory with this wbsp file. Also create images of the digits 0 to 9 (name them 0.gif, 1.gif, 2.gif, ..., 9.gif) and place them in directory digits located in same directory with this wbsp file.

read more

Section [UserData]

This section contains a list of custom, user-defined variables that can be used in WBSP files, in form:
UserVariable=AnyValue
These variables can be read using functions $WBRV and $WBRRV.
The user-defined variables in UserData section can contain WhizBase tags and functions, same as any WBSP system variable (variables starting with WB_).
Here is an example of UserData section in default.inc file in virtual hosts document root:
[UserData]
AdminEmail=admin@somemailserver.com
MyMailServer=mail.somemailserver.com
Later these variables can be accessed from your WBSP files like this:
[FormFields]
wb_mailserver=$wbrv{MyMailServer}
wb_bcc=$wbrv{AdminEmail}
Or like this:


some html code ...

Please send your comments/questions to
$wbrv[AdminEmail]

Thank you!
 

Subsection [Upload]

This subsection contains variables needed to control file upload using WBSP page. Using these variables, the developer can control where uploaded files will be saved, what is maximum size of a single file, what file types can not be uploaded, weather existing file will be overwritten or not, where to store log data and what prefix to add to URL of uploaded file. The variables that can be stored in this subsection are  (in alphabetic order):
WB_UploadLog
Here's an example of upload subsection (marked with blue):
[FormFields]
WB_BaseName=biblioA.mdb
WB_AllowMultipart=T
WB_Command=A
WB_UID=ISBN
WB_Redirect=titlesQ.wbsp
WB_RcdSet=Titles
[Upload]
WB_Disallow=![jpg,gif]
WB_UploadDir=images/
WB_Overwrite=T
WB_MaxFSize=24576
WB_UploadLog=upload.log
To learn more about uploading files using WBSP read the "Uploading files using WBSP" page.

read more

Section [Referrer Check]

Section Referrer Check defines what commands will require validation of referring page and what domains will be accepted as valid referrers.
It has a variable Referrer that contains a comma-separated list of servers (domains) that  will be accepted by WBSP engine as valid hosts for referring pages.
If this variable does not exist (or it is empty) then WBSP engine will not try to validate referrer. If you want to allow referring page to be located only on same server as WBSP file set this variable to $self$.
The main change from previous versions is that this section is part of the WBSP file while in previous versions it was part of WhizBase.ssc server-side configuration file.
Here is an example of Referrer check section:

[Referrer Check]
Referrer=whizbase.com,wbsp.com
 

Subsection [Include]

This subsection contains a list of files (respecting the WBSP path rules) that WBSP engine will check for input variables if they are not found in original WBSP file. Include files are processed backwards – from end to top of the list. WBSP will stop searching as soon as it finds first occurrence of the variable it search for.
Include files will be processed only if WBSP engine does not find the variable in WBSP file, but before WBSP engine tries to read variable from HTML form input fields. WBSP engine will read include files backwards (starting from the last file in the include section).

Here is an example of Include section (marked blue):




Titles


Year published Title ISBN
$wbf[Year published] $wbf[title] $wbf[ISBN]


$wbnavigator




And include file db.inc looks like this:
[FormFields]
WB_Basename=biblio.mdb

Special case are include files named default.inc.

read more

Subsection [FormFields]

This subsection contains the variables that are essential for processing WBSP file. Here you put information about the database, recordset, template, error template, log file, redirection, etc.
These are the variables that can be stored in FormFields subsection (in alphabetic order):

WB_DBReadDes WB_Debug
WB_FileName
WB_Null
WB_Usr
WB_WholeWord

Here's an example of FormFields section (marked blue):
[FormFields]
WB_basename=biblio.mdb
wb_rcdset=publishers
WB_Command=Q
wb_showlogo=F
wb_order=name




Publishers



$wbf[Name]

$wbsr[titles.sr]


Section [ErrorMessages]

This section contains a list of custom error messages in form:
ErrorNumber=ErrorMessage
ErrorNumber is standard number reported by WBSP engine. It can be either WhizBase error number or Jet  or any other error number. It is not recommended to put any Whizbase tags, functions, etc. in the  ErrorMessage, because it can produce unwanted results. If you need to place such content in  ErrorMessage, it is strongly recommended to test all possible situations before publishing the page to the real world. The exception to this is a reserved word $WBERRRED: followed by the URL of the web content where the WBSP engine will redirect visitor in the case of a specific error occurrence. This will work only if error occurs before WBSP sends HTTP header (e.g. if error  occurs before WBSP starts report rendering).
This is useful for translating the error messages from English or for using IMG HTML tag to display an image instead of error message, or to use block to process certain errors.

Here is an example of ErrorMessages section:
[ErrorMessages]
5034=
3030=
429=
5040=$WBERRRED:/requiredMissing.wbsp