4D v14.3

WA SET URL FILTERS

Home

 
4D v14.3
WA SET URL FILTERS

WA SET URL FILTERS 


 

WA SET URL FILTERS ( {* ;} object ; filtersArr ; allowDenyArr ) 
Parameter Type   Description
Operator in If specified, object is an object name (string) If omitted, object is a variable
object  Form object in Object name (if * is specified) or Variable (if * is omitted)
filtersArr  String array in Filters array
allowDenyArr  Boolean array in Allow-deny array

The WA SET URL FILTERS command sets up one or more filters for the Web area designated by the * and object parameters.

Before loading any page requested by the user, 4D consults the list of filters in order to check whether or not the target URL is allowed. The evaluation of the URL is based on the contents of the filtersArr and allowDenyArr arrays.

If the requested URL is not allowed, it is not loaded and the On URL Filtering form event is generated.

The filtersArr and allowDenyArr arrays must be synchronized.

  • Each element of the filtersArr array must contain a URL to be filtered. You can use the * as a wildcard to replace one or more characters.
  • Each corresponding element in the allowDenyArr array must contain a Boolean indicating whether the URL must be allowed (True) or denied (False).

If there is a contradiction at the configuration level (the same URL is both allowed and denied), the last setting is the one taken into account.

To disable URL filtering, call the command and pass empty arrays or pass, respectively, the values "*" and True in the last elements of the filtersArr and allowDenyArr arrays.

Once the command has been executed, the filters become a property of the Web area. If the filtersArr and allowDenyArr arrays are deleted or reinitialized, the filters remain active as long as the command has not been executed again. To find out the active filters for an area, you must use the WA GET URL FILTERS command.

Important: The filtering of URLs carried out by this command only applies to the "URL" variable associated with the Web area (variable usually enterable and displayed in the form).
The filtering does not apply to the WA OPEN URL command, nor to the other navigation commands.

You want to deny access for all the .org, .net and .fr Web sites:

 ARRAY TEXT($filters;0)
 ARRAY BOOLEAN($AllowDeny;0)
 
 APPEND TO ARRAY($filters;"*.org")
 APPEND TO ARRAY($AllowDeny;False)
 APPEND TO ARRAY($filters;"*.net")
 APPEND TO ARRAY($AllowDeny;False)
 APPEND TO ARRAY($filters;"*.fr")
 APPEND TO ARRAY($AllowDeny;False)
 WA SET URL FILTERS(MyWArea;$filters;$AllowDeny)

You want to deny access for all Web sites except Russian ones (.ru):

 ARRAY TEXT($filters;0)
 ARRAY BOOLEAN($AllowDeny;0)
 
 APPEND TO ARRAY($filters;"*") `Select all
 APPEND TO ARRAY($AllowDeny;False`Deny all
 APPEND TO ARRAY($filters;"www.*.ru") `Select *.ru
 APPEND TO ARRAY($AllowDeny;True`Allow
 WA SET URL FILTERS(MyWArea;$filters;$AllowDeny)

You want to allow access only to 4D Web sites (.com, .fr, .es, etc.):

 ARRAY TEXT($filters;0)
 ARRAY BOOLEAN($AllowDeny;0)
 
 APPEND TO ARRAY($filters;"*") `Select all
 APPEND TO ARRAY($AllowDeny;False`Deny all
 APPEND TO ARRAY($filters;"www.4D.*") `Select 4d.fr, 4d.com...
 APPEND TO ARRAY($AllowDeny;True`Allow
 WA SET URL FILTERS(MyWArea;$filters;$AllowDeny)

You want to allow local access to the documentation only (found in the folder C://doc):

 ARRAY TEXT($filters;0)
 ARRAY BOOLEAN($AllowDeny;0)
 
 APPEND TO ARRAY($filters;"*") `Select all
 APPEND TO ARRAY($AllowDeny;False`Deny all
 APPEND TO ARRAY($filters;"file://C:/doc/*")
  `Select the path file:// allowed
 APPEND TO ARRAY($AllowDeny;True`Allow
 WA SET URL FILTERS(MyWArea;$filters;$AllowDeny)

You want to allow access for all sites except one, for example the Elcaro site:

 ARRAY TEXT($filters;0)
 ARRAY BOOLEAN($AllowDeny;0)
 
 APPEND TO ARRAY($filters;"*")
 APPEND TO ARRAY($AllowDeny;True`Allow all
 APPEND TO ARRAY($filters;"*elcaro*") `Deny all that contain elcaro
 APPEND TO ARRAY($AllowDeny;False)
 WA SET URL FILTERS(MyWArea;$filters;$AllowDeny)

You want to deny access to specific IP addresses:

 ARRAY TEXT($filters;0)
 ARRAY BOOLEAN($AllowDeny;0)
 
 APPEND TO ARRAY($filters;"*") `Select all
 APPEND TO ARRAY($AllowDeny;True`Allow all
 APPEND TO ARRAY($filters;86.83.*")  `Select IP addresses beginning with 86.83.
 APPEND TO ARRAY($AllowDeny;False`Deny
 APPEND TO ARRAY($filters;86.1*")  `Select IP addresses beginning with 86.1 (86.10, 86.135 etc.)
 APPEND TO ARRAY($AllowDeny;False`Deny
 WA SET URL FILTERS(MyWArea;$filters;$AllowDeny)
  `(Note that the IP address of a domain may vary).

 
PROPERTIES 

Product: 4D
Theme: Web Area
Number: 1030

 
HISTORY 

Created: 4D v11 SQL Release 2

 
SEE ALSO 

WA GET URL FILTERS
WA SET EXTERNAL LINKS FILTERS

 
ARTICLE USAGE

4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)