137 lines
3.9 KiB
Plaintext
137 lines
3.9 KiB
Plaintext
CREATE OR REPLACE PACKAGE BODY EFT_NOM.cout_cookie_check IS
|
|
|
|
/**
|
|
-- Purpose : Check whether cookies have been enabled
|
|
-- #version $Revision: 1 $
|
|
-- #author $Author: Gilberta $
|
|
-- Created : 07/12/2004 10:37:19
|
|
*/
|
|
|
|
/*
|
|
$Header: /Isle Of Grain/database/PLSQL/cout_cookie_check.pck 1 7/01/05 12:54 Gilberta $ Logfile, Revision, Date, Author
|
|
|
|
$Date: 7/01/05 12:54 $ Date and time of last checkin
|
|
$Modtime: 4/01/05 16:40 $ Date and time of last modification
|
|
|
|
$History: cout_cookie_check.pck $
|
|
*
|
|
* ***************** Version 1 *****************
|
|
* User: Gilberta Date: 7/01/05 Time: 12:54
|
|
* Created in $/Isle Of Grain/database/PLSQL
|
|
* Initial Version
|
|
*/
|
|
|
|
g_front_page VARCHAR2(80) := 'home';
|
|
|
|
PROCEDURE main_page IS
|
|
l_cookie owa_cookie.cookie;
|
|
BEGIN
|
|
owa_util.mime_header(ccontent_type => 'text/html'
|
|
,bclose_header => FALSE);
|
|
|
|
l_cookie := owa_cookie.get(g_cookie_name);
|
|
|
|
IF l_cookie.num_vals = 0 THEN
|
|
owa_cookie.send(NAME => g_cookie_name
|
|
,VALUE => 'YES');
|
|
owa_util.redirect_url(g_package_name || '.check_cookie');
|
|
END IF;
|
|
|
|
owa_util.http_header_close;
|
|
|
|
htp.htmlopen;
|
|
htp.bodyopen;
|
|
htp.p('welcome to the main page');
|
|
htp.bodyclose;
|
|
htp.htmlclose;
|
|
|
|
END main_page;
|
|
|
|
PROCEDURE check_cookie IS
|
|
l_cookie owa_cookie.cookie;
|
|
BEGIN
|
|
owa_util.mime_header(ccontent_type => 'text/html'
|
|
,bclose_header => FALSE);
|
|
l_cookie := owa_cookie.get(NAME => g_cookie_name);
|
|
|
|
IF l_cookie.num_vals = 0 THEN
|
|
|
|
owa_util.http_header_close;
|
|
htp.htmlopen;
|
|
htp.title('Cookies Check');
|
|
htp.linkrel('stylesheet'
|
|
,'caco_system.css?p_type=general');
|
|
htp.bodyopen;
|
|
|
|
htp.title(caco_utilities.get_system_name);
|
|
--
|
|
htp.headclose;
|
|
--
|
|
htp.bodyopen;
|
|
--
|
|
htp.print(caco_system.menu);
|
|
|
|
htp.header(nsize => 1
|
|
,cheader => 'Cookies');
|
|
htp.para;
|
|
htp.p('You do not have cookies enabled on your browser. ');
|
|
htp.p('Cookies must be enabled to access this application.');
|
|
|
|
htp.para;
|
|
htp.p('Cookies are pieces of information generated by a Web server and stored on your computer');
|
|
htp.p('ready for future access.');
|
|
|
|
htp.para;
|
|
htp.ulistopen('This application uses two cookies:');
|
|
htp.listitem(g_cookie_name ||
|
|
'. Used to confirm that you have cookies enabled');
|
|
htp.listitem(wsgl.wsg_clientid_cookie ||
|
|
'. Used to hold security and navigation details whilst connected to this application.');
|
|
htp.ulistclose;
|
|
|
|
htp.para;
|
|
htp.p('These cookies can only be read by ' || htf.bold('this') ||
|
|
' server and the contain no personal information. ');
|
|
htp.p('Both cookies will be removed when you close the browser. ');
|
|
|
|
htp.para;
|
|
htp.p('Please alter your browser settings to enable cookies for this session.');
|
|
|
|
htp.p('<noscript>');
|
|
htp.header(nsize => 1
|
|
,cheader => 'JavaScript');
|
|
htp.para;
|
|
htp.p('You do not have JavaScript enabled on your browser. ');
|
|
htp.p('JavaScript must be enabled to access this application.');
|
|
htp.p('</noscript>');
|
|
|
|
htp.bodyclose;
|
|
htp.htmlclose;
|
|
|
|
ELSE
|
|
owa_util.redirect_url(g_front_page);
|
|
owa_util.http_header_close;
|
|
END IF;
|
|
END check_cookie;
|
|
|
|
PROCEDURE remove_cookie IS
|
|
BEGIN
|
|
owa_util.mime_header(bclose_header => FALSE);
|
|
owa_cookie.remove(NAME => g_cookie_name
|
|
,val => 'YES');
|
|
owa_util.http_header_close;
|
|
|
|
htp.htmlopen;
|
|
htp.bodyopen;
|
|
htp.p('Removed ' || g_cookie_name);
|
|
htp.bodyclose;
|
|
htp.htmlclose;
|
|
END remove_cookie;
|
|
|
|
BEGIN
|
|
-- Initialization
|
|
NULL;
|
|
END cout_cookie_check;
|
|
/
|
|
|