Flicks FAQ: Setvirtualdomain


Back to the top of the FAQ

SetVirtualDomain

AuthentiX ISP Only

The SetVirtualDomain method specifies which virtual domain subsequent operations apply to, based on the supplied IP address and script name. The parameters are easily obtained from server variables as shown in the example below, but only if the ASP page is within the virtual domain. If the page is outside the virtual domain, pass the required parameters to the page, or use the alternative SetVirtualDomainDirect.
Note: the CreateObject call is different for AuthentiX and AuthentiX ISP. Type regsvr32 authxisp.ocx at the command line to register on your system.

If you don't set this, and use other functions anyway, you will get errors like
"AXISP (7726725) error, directory not set."
or
(!m_codeName.IsEmpty()
or
(!m_directory.IsEmpty())
in the application event log.

Syntax

SetVirtualDomain(IPAddress, scriptName)

Parameters

IPAddress
IP Address of the virtual domain.
scriptName
Script name, the portion of the URL that follows the domain name.

Return Values

Returns 0 for success.

Example

The following example sets the domain and queries that domains AuthentiX database to see if a user is a member of the domain's group 'GroupX'.


<% 
Set auth = Server.CreateObject("AUTHXISP.AuthXOCXCtrl.1") 

auth.SetVirtualDomain(Request.ServerVariables("LOCAL_ADDR"), Request.ServerVariables("SCRIPT_NAME"))

if 0 = auth.GroupHasUser("GroupX", "user1") Then
%>
<h2>
Group has that user.
</h2>
<% Else %>
<h2>
No user with that name in that group.
</h2>
<% End If %>


 

Applies To

AuthentiX OCX Component

http://www.flicks.com/authentix/discover/main.htm

Back to the top of the FAQ