When writing rules and headers, you can use Perl expressions that will be evaluated in a jail, to prevent bad code execution.
This is also true for:
Inside this jail, you can access to:
This function will check the day and the hour of current request, and compare it to allowed days and hours. It returns 1 if this match, 0 else.
By default, the allowed days and hours is an hexadecimal value, representing each hour of the week. A day has 24 hours, and a week 7 days, so the value contains 168 bits, converted into 42 hexadecimal characters. Sunday is the first day.
For example, for a full access, excepted week-end:
000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000
Functions parameters:
hexadecimal
(default) or octetstring
Simple usage example:
checkLogonHours($ssoLogonHours)
If you use the binary value (Active Directory), use this:
checkLogonHours($ssoLogonHours, 'octetstring')
You can also configure jetlag (if all of your users use the same timezone):
checkLogonHours($ssoLogonHours, '', '+2')
If you manage different timezones, you have to take the jetlag into account in ssoLogonHours values, or use the $_timezone parameter. This parameter is set by the portal and use javascript to get the connected user timezone. It should works on every browser:
checkLogonHours($ssoLogonHours, '', $_timezone)
You can modify the default behavior for people without value in ssoLogonHours. Indeed, by default, users without logon hours values are rejected. You can allow these users instead of reject them:
checkLogonHours($ssoLogonHours, '', '', '1')
This function will check the date of current request, and compare it to a start date and an end date. It returns 1 if this match, 0 else.
The date format is the LDAP date syntax, for example for the 1st March 2009:
20090301000000Z
Functions parameters:
Simple usage example:
checkDate($ssoStartDate, $ssoEndDate)
This function builds the Authorization
HTTP header used in HTTP Basic authentication scheme. It will force conversion from UTF-8 to ISO-8859-1 of user and password data.
Functions parameters:
Simple usage example:
basic($uid,$_password)
This function convert a string from UTF-8 to ISO-8859-1.
Functions parameters:
Simple usage example:
unicode2iso($name)
This function convert a string from ISO-8859-1 to UTF-8.
Functions parameters:
Simple usage example:
iso2unicode($name)