S/Web Objects

Home S/Web Description S/Web Overview S/Web Installation S/Web Features S/Web Functions S/Web Objects S/Web Settings S/Web Troubleshoot S/Web FAQ S/Web Appendices

Cache Client Document LH Repository Request Response Server Session

 

Links on this page:
 

Properties

Methods

Client

This object handles information relating to the client making the current request.

Properties:

PropertyGet/SetDescription
ANONYMOUSGet/SetHolds a Boolean value indicating if this client has been allowed in using an anonymous procedure.
ANONYMOUSPROCSGet/SetContains an @FM delimited list of SWEB_ procedures allowed anonymous access. Thus users may be allowed to access aspects of the system without logging in.
BASICAUTHENTICATIONPROCGet/SetContains the name of a function to use for verifying Basic Authentication requests
BASICAUTHENTICATIONREALMGet/SetContains the name of the realm used for Basic Authentication. This will be used as the title text in the basic authentication dialog.
DATAGet/SetHolds any app-specific data defined that belongs to the client
ERRORMSGGet/SetThis property contains information about the error messages for the current instance of the object.  This generally only happens with the login.
IDGet/SetHolds the ID of the client that made the request
LOGINGet/SetTrue if this is the actual login request
NAMEGet/SetContains the user name of the currently logged in user
NOREDIRECT A Boolean flag indicating whether the client may be allowed to redirect to another URL. Used to override a cached redirection request. When the user bookmarks or tries to go to a URL without logging in, S/Web will cache the request and send them there after a successful login. If the programmer wishes to override this redirect they must set NOREDIRECT to True$
TIMEOUTGet/SetTime in minutes that a client is allowed to be active before being timed out. By default set to contents of wwwSvrEnvRec@<WWWCFG_CLIENT_TIMEOUT$>.
UNAUTHORIZEDGet/SetIndicated if the client failed the login request
VALIDGet/SetTrue if this client is valid. Note that if you are using ANONYMOUSPROCS you should use this in conjunction with the ANONYMOUS property as whilst the client is using an anonymous procedure VALID will still be set to true.
XVERSIONGetContains the current S/Web version

See Chapter 4, Security, for more information on the authentication and anonymous properties

Methods:

call www_Exec_Method( "CLIENT", method, param1, param2, param3, param4, param5)

MethodDescription
CREATECreates the client object. 
DESTROYDestroys the current object.
GET  Retrieves properties of the current client object.
GETHEADER Retrieves the header of the current client object. 
ISEXPIREDChecks to see if a client has expired.
PURGEPurges the system cache
SETSets properties of the current client object.

[top]

CREATE Method

This method creates the CLIENT object.  This is automatically called by S/Web and should not be called by the developer.

ArgumentDescription
param1  Not used.
param2  Not used.
param3  Not used.
param4  Not used.
param5  Not used.

[top]

DESTROY method

This method destroys the current client.  Calling this method will require that the current session logs in again.

ArgumentDescription
param1  The client ID to destroy.  Defaults to current client if none specified.
param2  Not used. 
param3  Not used. 
param4  Not used.
param5  Not used.

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical
CurrentTime  =  Time()
*  If time is after 5:00pm local time, then logout the current user
If CurrentTime > 61200 Then
    if www_Exec_Method( "CLIENT", "DESTROY", "", "", "", "", "", "", errorText ) then
      clientHeader<WWW_CLIENT$AUTHENTICATED$> = FALSE$
   end else
      abort = TRUE$
   end
end

[top]

ISEXPIRED method

This method checks to see if a client has expired.

ArgumentDescription
param1  A client number (defaults to current client)
param2  Returns TRUE$ if the client is expired.
param3  Not used. 
param4  Not used. 
param5  Not used.

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical
if www_Exec_Method( "CLIENT", "ISEXPIRED", isExp, "", "", "", "", "", errorText ) then
   If isExp Then
      docID   =   "EXPIRED"
   end else
      docID   =   "VALID"
   end
end else
   abort = TRUE$
end

[top]

GET method

This method allows you to retrieve properties from the client object.

ArgumentDescription
param1  An @RM list of properties to retrieve
param2  An @RM list of retrieved property values.
param3  Not used. 
param4  Not used. 
param5  Not used.

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical
Properties  =   "NAME"
Properties  :=  @RM : "DATA"
if www_Exec_Method( "CLIENT", "GET", Properties, RetVals, "", "", "", "", errorText ) then
   UserName  =  Field( RetVals, @RM, 1 )
   UserData  =  Field( RetVals, @RM, 2 )
end else
   abort = TRUE$
end

[top]

GETHEADER

This method returns the client header from the cache.  If no client is passed, the current client is assumed.

ArgumentDescription
param1  The client ID whose header you wish to retrieve
param2  The client header is returned in this parameter.
param3  Not used. 
param4  Not used. 
param5  Not used. 

Example:   

declare function www_Exec_Method, www_Get_Status, www_Set_Status   
$insert www_Status_Equates   
$insert logical    
if www_Exec_Method( "CLIENT", "GETHEADER", "", ClientHeader, "", "", "", "", errorText ) then
   null
end else
   abort = TRUE$
end

[top]

PURGE method

This function purges the client cache table

ArgumentDescription
param1  Not used. 
param2  Not used. 
param3  Not used. 
param4  Not used. 
param5  Not used. 

Example:   

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical
if www_Exec_Method( "CLIENT", "PURGE", "", "", "", "", "", "", errorText ) then
   null
end else
   abort = TRUE$
end

[top]

SET method

This method allows you to set properties of the client object

ArgumentDescription
param1  An @RM list of properties to retrieve
param2  An @RM list of retrieved property values.
param3  An @RM list of the original property values
param4  Not used. 
param5  Not used. 

Example:

declare function www_Exec_Method, www_Get_Status, www_Set_Status
$insert www_Status_Equates
$insert logical
Properties  =   "NAME"
Properties  :=  @RM : "DATA"
Values      :=  "Homer Simpson"
Values      :=  "Springfield" : @FM : "Sector 7G"
if www_Exec_Method( "CLIENT", "SET", Properties, Values, OrigValues, "", "", "", errorText ) then
   OrigUserName  =  Field( OrigValues, @RM, 1 )
   OrigUserData  =  Field( OrigValues, @RM, 2 )
end else
   abort = TRUE$   
end

[top]

Copyright © 2005 The Sprezzatura Group. All rights reserved.