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

<chapter>
	<chapterinfo>
	<revhistory>
		<revision>
		<revnumber>$Revision: 1827 $</revnumber>
		<date>$Date: 2007-03-12 17:22:53 +0200 (Mon, 12 Mar 2007) $</date>
		</revision>
	</revhistory>
	</chapterinfo>
	<title>User's Guide</title>

	<section>
	<title>Overview</title>
	<para>
		This module export functions necessary for group membership checking 
		over radius. There is a database table that contains list of users 
		and groups they belong to. The table is used by functions of this 
		module.
	</para>
	</section>

	<section>
	<title>Dependencies</title>
		<section>
			<title>&ser; Modules</title>
			<para>
			The module depends on the following modules (in the other words 
			the listed modules must be loaded before this module):
			<itemizedlist>
				<listitem>
				<para><emphasis>none</emphasis></para>
				</listitem>
			</itemizedlist>
			</para>
		</section>
		<section>
			<title>External Libraries or Applications</title>
			<para>
			The following libraries or applications must be installed 
			before compilling &ser; with this module loaded:
			<itemizedlist>
				<listitem>
				<para><emphasis>radiusclient-ng</emphasis> 0.5.0 or higher -- 
				library and development files. See <ulink 
				url='http://developer.berlios.de/projects/radiusclient-ng/'>
				http://developer.berlios.de/projects/radiusclient-ng/</ulink>.
				</para>
				</listitem>
			</itemizedlist>
		</section>
	</section>

	<section>
	<title>Exported Parameters</title>
	<section>
		<title><varname>radius_config</varname> (string)</title>
		<para>
		Location of the configuration file of the radius client library.
		</para>
		<para>
		<emphasis>
			Default value is 
			<quote>/usr/local/etc/radiusclient-ng/radiusclient.conf</quote>.
		</emphasis>
		</para>
		<example>
		<title>Set <varname>radius_config</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("group_radius", "radius_config", "/etc/radiusclient.conf")
...
</programlisting>
		</example>
	</section>
	<section>
		<title><varname>use_domain</varname> (integer)</title>
		<para>
		If set to 1 then username@domain will be used for lookup, if set to 0 
		then only username will be used.
		</para>
		<para>
		<emphasis>
			Default value is 0 (no).
		</emphasis>
		</para>
		<example>
		<title>Set <varname>use_domain</varname> parameter</title>
		<programlisting format="linespecific">
...
modparam("group_radius", "use_domain", 1)
...
</programlisting>
		</example>
	</section>

	</section>
	<section>
	<title>Exported Functions</title>
	<section>
		<title>
		<function moreinfo="none">radius_is_user_in(URI, group)</function>
		</title>
		<para>
		The function returns true if username in the given &uri; is member of 
		the given group and false if not.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para><emphasis>&uri;</emphasis> - &uri; whose username and 
			optionally domain to be used, this can be one of:
			<itemizedlist>
				<listitem>
				<para>Request-URI - Use Request-URI username and 
				(optionally) domain.</para>
				</listitem>
				<listitem>
				<para>To - Use To username and (optionally) domain.</para>
				</listitem>
				<listitem>
				<para>From - Use From username and (optionally) domain.</para>
				</listitem>
				<listitem>
				<para>Credentials - Use digest credentials username.</para>
				</listitem>
			</itemizedlist>
			</para>
		</listitem>
		<listitem>
			<para><emphasis>group</emphasis> - Name of the group to check.
			</para>
		</listitem>
		</itemizedlist>
		<para>
		This function can be used from REQUEST_ROUTE.
		</para>
		<example>
		<title><function>radius_is_user_in</function> usage</title>
		<programlisting format="linespecific">
...
if (radius_is_user_in("Request-URI", "ld")) {
	...
};
...
</programlisting>
		</example>
	</section>
	</section>
</chapter>

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