Databases Reference
In-Depth Information
Parameter
Value
Description
RESTRICTED MESSAGE The application is currently
unavailable due to maintenance
activities.
Message to be displayed when an
unauthorized user calls the application
In your APEX application you will have to create an application process (process point before
header) to check the availability of the application at all times, as shown in Listing 9-12.
Listing 9-12. After Header Application Process to Check the Application Availability
BEGIN
IF XLIB CONF.GET VALUE ('RESTRICTED MODE') = '1'
THEN
IF IS RUN IN BUILDER = FALSE
AND INSTR (NVL (XLIB CONF.GET VALUE ('RESTRICTED USERS'), '#'),
OWA UTIL.GET CGI ENV ('REMOTE ADDR')) = 0
THEN
HTP.P (XLIB CONF.GET VALUE ('RESTRICTED MESSAGE'));
HTP.P (
'<br /><span style="color:white;>"'
|| OWA UTIL.GET CGI ENV (REMOTE ADDR)
|| '</span>');
APEX APPLICATION.G UNRECOVERABLE ERROR := TRUE;
END IF;
END IF;
END;
The function xlib conf.get value will return the current value of the configuration parameter (i.e..
RESTRICTED MODE ) from the configuration table.
Using the function is run in builder (see Listing 9-13) you can determine whether the application
is run from within the application builder having developer privileges in the current workspace.
Listing 9-13. Function is_run_in_builder
FUNCTION is run in builder
RETURN BOOLEAN
IS
BEGIN
RETURN APEX APPLICATION.g edit cookie session id IS NOT NULL;
END;
You can determine your current IP address by calling the function OWA UTIL.GET CGI ENV
('REMOTE ADDR') to check it against the list of privileged IP addresses in restricted mode. After the final
successful testing you can release the application and simply set the configuration parameter
RESTRICTED MODE to 0 .
Search WWH ::




Custom Search