1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_http_map_get">
<refmeta>
<refentrytitle>http_map_get</refentrytitle>
<refmiscinfo>ws</refmiscinfo>
</refmeta>
<refnamediv>
<refname>http_map_get</refname>
<refpurpose>get values from HTTP virtual host path mapping table</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_http_map_get">
<funcprototype id="fproto_http_map_get">
<funcdef><function>http_map_get</function></funcdef>
<paramdef>in <parameter>element_name</parameter> varchar</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_http_map_get"><title>Description</title>
<para>
Retrieves information associated with the virtual host / HTTP path mapping in
effect for the VSP page being processed.
Values valid
in current connection or URL context may be retrieved by <parameter>element_name</parameter>.</para>
<para>Calling <function>http_map_get</function> has no use outside of http context. In this case an
error will be signalled.</para>
</refsect1>
<refsect1 id="params_http_map_get"><title>Parameters</title>
<refsect2><title>element_name</title>
<para>The possible values for element_name are: 'vsp_uid', 'soap_uid', 'persist_ses_vars',
'default_page', 'browseable', 'security_level' , 'auth_opts', 'soap_opts', 'domain',
'mounted'.</para>
</refsect2>
</refsect1>
<refsect1 id="ret_http_map_get"><title>Return Types</title>
<para>Value returned depends of <parameter>element_name</parameter>:</para>
<table><title>Values returned by http_map_get</title>
<tgroup cols="3">
<thead>
<row>
<entry>element_name</entry>
<entry>Datatype</entry>
<entry>Return value</entry>
</row>
</thead>
<tbody>
<row>
<entry>vsp_uid</entry>
<entry><type>VARCHAR</type></entry>
<entry>Which SQL user active content will execute as</entry>
</row>
<row>
<entry>soap_uid</entry>
<entry><type>VARCHAR</type></entry>
<entry>Which SQL user SOAP calls will be executed as</entry>
</row>
<row>
<entry>persist_ses_vars</entry>
<entry><type>INTEGER</type></entry>
<entry>Is persisting of session variables enabled?</entry>
</row>
<row>
<entry>default_page</entry>
<entry><type>VARCHAR</type></entry>
<entry>Default page for current mapping</entry>
</row>
<row>
<entry>browseable</entry>
<entry><type>INTEGER</type></entry>
<entry>Is directory browsing enabled?</entry>
</row>
<row>
<entry>security_level</entry>
<entry><type>VARCHAR</type></entry>
<entry>Security level ('DIGEST', 'SSL', 'BASIC')</entry>
</row>
<row>
<entry>auth_opts</entry>
<entry><type>ANY</type></entry>
<entry>Application-specific authentication options</entry>
</row>
<row>
<entry>soap_opts</entry>
<entry><type>ANY</type></entry>
<entry>Application-specific SOAP options</entry>
</row>
<row>
<entry>domain</entry>
<entry><type>VARCHAR</type></entry>
<entry>Directory path that is the logical start point of current mapping.</entry>
</row>
<row>
<entry>mounted</entry>
<entry><type>VARCHAR</type></entry>
<entry>Physical path that is the physical start point of current mapping</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
<refsect1 id="examples_http_map_get"><title>Examples</title>
<example id="ex_http_map_get"><title>Retrieving Mapping Details</title>
<screen><?vsp
declare def_page varchar;
def_page := http_map_get ('default_page');
http (sprintf ('<p>The default page for this path is: %s </p>', def_page));
?>
</screen>
</example>
<example id="ex_http_map_get_2"><title>Warn users if non-SSL connection</title>
<screen><HTML>
<HEAD>
<TITLE>TEST</TITLE>
</HEAD>
<BODY>
<P>We're executing as <?= http_map_get ('vsp_uid') ?></P>
<?vsp
if (http_map_get ('security_level') <> 'SSL')
{
?>
Warning: This page is not protected by transport level encryption
and may be viewable by anybody in the middle with a network
sniffer.
<?vsp
}
?>
</BODY>
</HTML>
</screen>
</example>
</refsect1>
</refentry>
|