<!-- Module User's Guide -->

<chapter>
    <chapterinfo>
	<revhistory>
	    <revision>
		<revnumber>$Revision: 1.1 $</revnumber>
		<date>$Date: 2003/07/23 21:17:46 $</date>
	    </revision>
	</revhistory>
    </chapterinfo>
    <title>User's Guide</title>
    
    <section>
	<title>Overview</title>
	<para>Various checks related to &sip; &uri;.</para>
    </section>
    <section>
	<title>Dependencies</title>
	<section>
	    <title>&ser; Modules</title>
	    <para>
		The following modules must be loaded before this module:
	    	<itemizedlist>
		    <listitem>
			<para>
			    <emphasis>a &ser; database module</emphasis>.
			</para>
		    </listitem>
	    	</itemizedlist>
	    </para>
	</section>
	<section>
	    <title>External Libraries or Applications</title>
	    <para>
		The following libraries or applications must be installed before running
		&ser; with this module loaded:
	    	<itemizedlist>
		    <listitem>
			<para>
			    <emphasis>None</emphasis>.
			</para>
		    </listitem>
	    	</itemizedlist>
	    </para>
	</section>
    </section>
    <section>
	<title>Exported Parameters</title>

	<section>
	    <title><varname>db_url</varname> (string)</title>
	    <para>
		&url; of the database to be used.
	    </para>
	    <para>
		<emphasis>
		    Default value is <quote>sql://serro:47serro11@localhost/ser</quote>.
		</emphasis>
	    </para>
	    <example>
		<title>Set <varname>db_url</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("module", "db_url", "sql://username:password@localhost/ser")
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title><varname>uri_table</varname> (string)</title>
	    <para>
		Table containing list of allowed &uri;s for each user.
	    </para>
	    <para>
		<emphasis>
		    Default value is <quote>uri</quote>.
		</emphasis>
	    </para>
	    <example>
		<title>Set <varname>uri_table</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("module", "uri_table", "uri")
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title><varname>uri_user_column</varname> (string)</title>
	    <para>
		Column holding usernames in the &uri; table.
	    </para>
	    <para>
		<emphasis>
		    Default value is <quote>username</quote>.
		</emphasis>
	    </para>
	    <example>
		<title>Set <varname>uri_user_column</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("module", "uri_user_column", "username")
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title><varname>uri_domain_column</varname> (string)</title>
	    <para>
		Column holding domain in the &uri; table.
	    </para>
	    <para>
		<emphasis>
		    Default value is <quote>domain</quote>.
		</emphasis>
	    </para>
	    <example>
		<title>Set <varname>uri_domain_column</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("module", "uri_domain_column", "domain")
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title><varname>uri_uriuser_column</varname> (string)</title>
	    <para>
		Column holding &uri; username in the &uri; table.
	    </para>
	    <para>
		<emphasis>
		    Default value is <quote>uri_user</quote>.
		</emphasis>
	    </para>
	    <example>
		<title>Set <varname>uri_uriuser_column</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("module", "uri_uriuser_column", "uri_user")
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title><varname>subscriber_table</varname> (string)</title>
	    <para>
		Name of the subscriber table.
	    </para>
	    <para>
		<emphasis>
		    Default value is <quote>subscriber</quote>.
		</emphasis>
	    </para>
	    <example>
		<title>Set <varname>subscriber_table</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("module", "subscriber_table", "subscriber")
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title><varname>subscriber_user_column</varname> (string)</title>
	    <para>
		Column holding username in subscriber table.
	    </para>
	    <para>
		<emphasis>
		    Default value is <quote>username</quote>.
		</emphasis>
	    </para>
	    <example>
		<title>Set <varname>subscriber_user_column</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("module", "subscriber_user_column", "username")
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title><varname>subscriber_domain_column</varname> (string)</title>
	    <para>
		Column hodling domains in the subscriber table.
	    </para>
	    <para>
		<emphasis>
		    Default value is <quote>domain</quote>.
		</emphasis>
	    </para>
	    <example>
		<title>Set <varname>subscriber_domain_column</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("module", "subscriber_domain_column", "domain")
...
</programlisting>
	    </example>
	</section>

    </section>
    <section>
	<title>Exported Functions</title>
	<section>
	    <title>
		<function moreinfo="none">is_user(username)</function>
	    </title>
	    <para>
		Check if the username in credentials matches the given username.
	    </para>
	    <para>Meaning of the parameters is as follows:</para>
	    <itemizedlist>
		<listitem>
		    <para><emphasis>username</emphasis> - Username string.
		    </para>
		</listitem>
	    </itemizedlist>
	    <example>
		<title><function>is_user</function> usage</title>
		<programlisting format="linespecific">
...
if (is_user("jan")) {
    ...
};
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title>
		<function moreinfo="none">check_to()</function>
	    </title>
	    <para>
		Check To username against &uri; table or digest
		credentials.
	    </para>
	    <example>
		<title><function>check_to</function> usage</title>
		<programlisting format="linespecific">
...
if (check_to()) {
    ...
};
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title>
		<function moreinfo="none">check_from()</function>
	    </title>
	    <para>
		Check From username against &uri; table or digest
		credentials.
	    </para>
	    <example>
		<title><function>check_from</function> usage</title>
		<programlisting format="linespecific">
...
if (check_from()) {
    ...
};
...
</programlisting>
	    </example>
	</section>

	<section>
	    <title>
		<function moreinfo="none">does_uri_exist()</function>
	    </title>
	    <para>
		Check if username in the request &uri; belongs to an existing user.
	    </para>
	    <example>
		<title><function>does_uri_exist</function> usage</title>
		<programlisting format="linespecific">
...
if (does_uri_exist()) {
    ...
};
...
</programlisting>
	    </example>
	</section>
    </section>
</chapter>

<!-- Keep this element at the end of the file
Local Variables:
sgml-parent-document: ("uri.sgml" "Book" "chapter")
End:
-->
