rac

Top  Previous  Next

rac

a=new("rac")

 

Remote Access Control object for simplified document access from public users. The rac object allows creation and management of RAC codes, which are random codes linked to specific document images. RAC codes are very secure in that there are an extremely large number of possible codes (about 1.15e+77 combinations), so the potential for guessing a valid code and gaining access to a document is extremely small.

 

A remote access URL is in the form http://server/script?rac=code, where the code is a 44-byte encoded string previously generated for a specific document image.  These URL's can be emailed to users, who can open the link and view the single file associated with that document image.  Such a link does not require a login or password, so it useful in cases where a site doesn't wish to manage external user logins to provide full archive library access.  A code expires after a certain number of days (default defined with racdays in uf100d.ini), as specified in the rac object's create$() method.

 

If the uf100d.ini [archive] external= value is set to a path to a public access cgi script (or direct to the internal web server, though that is not typically done), then the browser interface document email screen can generate or delete an RAC url. Note if this is not configured, rule sets can still generate a code and a url, by providing a script prefix to the geturl$() method.

 

Methods

count() returns the number of documents in the RAC table.

create$(lib$,doctype$,docid$,subid$[,validdays][,force]) generates code for the given document image, valid for the number of days (default - uf100d.ini). If a code has been previously generated, that code is returned and a new expiration date is calculated.  To force the generation of a new code, use a force argument of 1.

deldoc(lib$,doctype$,docid$,subid$) removes the RAC code, if any,  associated with the given document.  This allows a rule set to explicitly revoke remote access for a given document.

getcode$(lib$,doctype$,docid$,subid$) returns the 44-byte code associated with the document image specified, or null if no code has been created.

getdoc(code$,lib$,doctype$,docid$,subid$) given a 44-byte RAC code, this fills the associated lib$, doctype$, docid$, and subid$ values.  It returns a 1 if the document is found, or a 0 if not.

getexpire$(lib$,doctype$,docid$,subid$) returns the expiration of the RAC code associated with the given document.  The format is yyyymmdd.  If the document has no RAC code available, a null string is returned.

geturl$(lib$,doctype$,docid$,subid$[,scriptpath$]) returns full URL for a given document, which can be used to retrieve the document.  If scriptpath$ is not supplied, then the 'external=' path is used from the uf100d.ini [archive] section.  This script is the http: path used by a public user (not generally the internal http server) to access the archive server.  Note this generally requires configuring a public-facing web server to use one of the CGI scripts supplied with UnForm.