DAFTools Main Object

DAFTools main object is created with the command:

DAFTools = Server.CreateObject("dafinfo.dafinfo.1")

Methods and Properties

Information on current HTTP request

Creates a DB object

Retrieve all virtual IP addresses on the server

DAFTools Version

Creates DAFTools error object

Send an e-mail

Security Function


CurrentUser

Creates a User object using the current user information.

Syntax:

Set User = DAFTools.CurrentUser

Part Description
Return Value User object

Remarks:

The current user is the user authenticated while receiving the HTTP request.

See also: User object


CurrentDB

Creates a DB object using the current DAF database.

Syntax:

Set DB = DAFTools.CurrentDB

Part Description
Return Value DB object

Remarks:

The current DAF database, is the user list mapped to the IP address receiving the HTTP request.

See also: DB Object


ServerIP

Returns the IP address which received the current HTTP request.

Syntax:

CurrentIP = DAFTools.ServerIP

Part Description
Return Value string value

DB

Creates a DB object using an index value.

Syntax:

Set DB = DAFTools.DB(Id)

Part Description
Id 0 based index value
Return Value DB object

See also: DB Object


DBByName

Creates a DB object using a DAF DB name.

Syntax:

Set DB = DAFTools.DBByName(DBName)

Part Description
DBName Name of DAF Database
Return Value DB object

See also: DB Object


IPByDB

Returns an IP address attached to DAF database.

Syntax:

IP = DAFTools.IPByDB(DBName, Id)

Part Description
DBName DAF Database name
Id 0 based index value
Return Value String value

DBByIP

Creates a DB object using the DAF database mapped to an IP address.

Syntax:

Set DB = DAFTools.DBByIP(IP)

Part Description
IP IP address ("X.Y.Z.W")  defining the DAF DB object to create
Return Value DB object

See also: DB Object


IP

Lists all virtual IP addresses found on the server.

Syntax:

IP = DAFTools.IP(Id)

Part Description
Id 0 based index value
Return Value string value

Examples:

The following sample ASP script will display all virtual IP addresses found on the server.

DAFTools = Server.CreateObject("dafinfo.dafinfo.1")
.
.
.
i=0
do 
    sIP = DafTools.IP(i)
    if sIP="" then
	exit do
    else
	response.write "IP " & i & " : " & sIP & "<br>"
	i=i+1
    end if
loop

Version

Returns the DAFTools version as a string value.

Syntax:

DAFVersion = DAFTools.Version

Part Description
Return Value string value

VersionLo

Returns the DAFTools Low version as an integer value.

Syntax:

DAFVersion = DAFTools.VersionLo

Part Description
Return Value string value

VersionHi

Returns the DAFTools Hi version as an integer value.

Syntax:

DAFVersion = DAFTools.VersionHi

Part Description
Return Value string value

Version2

Returns the DAFTools version as an integer value.

Syntax:

DAFVersion = DAFTools.Version2

Part Description
Return Value integer value

Error

Creates an Error object which contains the last DAFTools error.

Syntax:

Set DAFError = DAFTools.Error

Part Description
Return Value Error object

See also: Error Object


ClearError

Resets the last DAFTools error.

Syntax:

DAFTools.ClearError

Part Description
Return Value None

SendMail

Sends an e-mail.

Syntax:

DAFVersion = DAFTools.SendMail(Host, ReturnPath, Subject, MailTo, Data)

Part Description
Host mail server
ReturnPath e-mail address for reply
Subject Subject of message
MailTo Recipient of message
Data Text of the message
Return value "OK" if success, or error string

MainAdminLogin

Login the main administrator.

Syntax:

Result = DAFTools.MainAdminLogin(AdminLogin, AdminPassword)

Part Description
AdminLogin DAF Administrator login
AdminPassword DAF Administrator password
Return Value Boolean value

Remarks:

The default DAF administrator is:

Only one DAF administrator can be defined, the login and password should be set with method SetMainAdmin.
If default DAF administrator name was not changed, the current script owns DAF Administrator rights.
To reset an existing DAF administrator, the following key in the registry should be deleted:

[HKEY_LOCAL_MACHINE\SOFTWARE\daf\DAFTools\Admin]


SetMainAdmin

Sets a new DAF administrator login and password.

Syntax:

Result = DAFTools.SetMainAdmin(oldLogin, oldPassword,newLogin,newPassword)

Part Description
oldLogin old DAF Administrator login
oldPassword old DAF Administrator password
newLogin new DAF Administrator login
newPassword new DAF Administrator password
Return Value Boolean value

Remarks:

The default DAF administrator is:

Example:

Result = DafTools.setmainadmin("admin","","newlogin","newpass")


IsMainAdminLogged

Returns the current logged state of DAF administrator.

Syntax:

AdminLogged = DAFTools.IsMainAdminLogged

Part Description
return value Boolean value: TRUE if administrator is logged
Return Value Boolean value

MainAdminLogOff

Log Off DAF administrator.

Syntax:

DAFTools.MainAdminLogOff

Part Description
Return Value None

LevelLogin

Login a DAF security level.

Syntax:

Result = DAFTools.LevelLogin(DBName,Level,Password)

Part Description
DBName DAF Database name
Level Level to login
Password Level password
Return Value Boolean value

Remarks:

Valid values for Level parameters are: "Level1","Level2","Level3".
To reset a Level password, the following key in the registry should be deleted:

[HKEY_LOCAL_MACHINE\SOFTWARE\daf\Databases\<DB Name>\DAFTools\Access\<level>]


IsLevelLogged

Returns the current logged state of a DAF security Level.

Syntax:

AdminLogged = DAFTools.IsLevelLogged(DBName)

Part Description
Return value Integer value:
- 0 if not logged
- 1 for level1
- 2 for level2
- 3 for level3

LevelLogOff

Log Off the DAF administrator.

Syntax:

DAFTools.LevelLogOff

Part Description
Return Value None

SetLevelPassword

Set a DAF security level password.

Syntax:

Result = DAFTools.SetLevelPassword(DBName,Level,oldPassword,newPassword)

Part Description
DBName DAF database name
Level Level for the new password
oldPassword Old level password
newPassword New level password
Return Value Boolean value