<!-- $Id$ -->
<chapter id="user">
 <title>User Interface (LMS-UI)</title>
 <para>LMS User Interface is basically administration panel available via Web
 interface that can be used to create and manage customer and computers (nodes)
 data and containing numerous features such as: You're able to bind computer data to your customers and assign it to given
 network. You're also able to define users liabilities and manage your network
 finances. You can search in user and computer data quickly, send mass mailing
 to specific user groups, define access to this UI for selected users and with
 fine grained access rights. Additionally you can track your bandwidth usability
 statistics, create backups of your database online and configuration and
 management of your services. Those are only selected features of
 <emphasis>LMS-UI</emphasis>, so read on to find description of all features.
 </para>
  <sect1 id="user-login">
	<title>Login</title>
        <para>After you enter LMS installation URL in your Web browser, you'll
        be prompted with login screen, where you need to enter correct username
        and password. All passwords in database are stored in encrypted form.
        </para>
        <para>If it's your first session with LMS, and you don't have any
        account created yet, you'll be redirected to new user account screen.
        At this moment you have only access to this one module, so that you can
        create your initial account.</para>
  </sect1>
  <sect1 id="menu-administration">
	<title>Administration</title>
        <para>After successful login to the system you'll have administration
        menu presented on the left side, while content of selected module will be
        displayed on the right side. Initially, you can read some useful information
        about system here. In administration menu, you're able to manage other users
        accounts and create or restore database backups.</para>
        <para>You can select any module to work with on the left panel. There
        are also buttons allowing you to change your password, logout or do a quick
        search for customers/computers/helpdesk. You can search by name or id, but also
        additionally by computer name, surname, fragment of address, phone, email, IP or
        MAC. If there are more than one matching record for your search you'll get only
        first result.</para>
	<sect2 id="administration-info">
	    <title>Info</title>
            <para>This is where all basic information about system that is
            running LMS are displayed. It lists the following information:
            LMS core and components versions, copyright notice, uptime and
            kernel version of your server, customers and nodes totals, computer
            activity totals and financial balance. Additionally all LMS links
            are gathered here.</para>
	</sect2>
	<sect2 id="administration-users">
	    <title>Users</title>
	    <para>'Users' panel is designed for LMS users (ie. network
            administrators) management. You can create or modify any account here, change
            assigned passwords and access rights.</para>
	    <para>For more information on access rights, see <xref linkend="install-rights">.</para> 
	    <para>Initially after selecting 'Users', you'll get list of all
            users with last login time and host information. When you click on the account,
            you're able to see it's details, including defined access rights.
	    You can modify data any time by clicking 'Edit' link. To create new user 
	    use left panel and click 'New user'.</para>
	</sect2>
	<sect2 id="administration-newuser">
	<title>New user</title>
	    <para>In order to create new user, you need to provide at least
            login name and non empty password. Name and email fields are optional. 
	    Allowed hosts is a coma separated list of host or network IP addresses
	    in 'allow_from' configuration option style. If that list is empty,
	    hosts checking is skipped. Below you can mark specific system access 
	    rights. If you leave all those fields unchecked
            (default), user will be granted with 'full access'.</para>
	</sect2>
	<sect2 id="administration-db">
	    <title>Backups</title>
	    <para>You can manage your database backup copies here. Database copy
            is plain text file with SQL statements needed to reconstruct all tables and it's
            data, which is saved in directory defined with <prompt>backup_dir</prompt>
            variable in <emphasis>[directories]</emphasis>
            section of <filename>lms.ini</filename>.</para>
	    <para><note><para>By default your backups will be placed in
            <filename>lms/backups</filename> directory, which could be accessed with your
            browser, without any authentication, so it's wise to move it above your Web
            Server DocumentRoot.</para></note></para>
	    <para>All copies can be viewed, removed or downloaded to your
            computer at any time. By clicking on 'recover' icon your current database will
            be deleted and replaced by the one in backup copy. For your safety, before such
            operation current database backup is performed automatically.</para>
	</sect2>
 </sect1>
 <sect1 id="menu-customers">
	<title>Customers</title>
	<para>This is your customers control center, where you can store and
        manage their data, their finances and also their computers. You can even cut all
        customer computers off with single mouse click.
	<note><para>Automatic cutoff of computers which owners are in debt is
        performed by lms-cutoff Perl script.</para></note></para>
	<sect2 id="menu-customers-list">
	    <title>List</title>
	    <para>After you select 'List' you'll see list of your users, that
            can be filtered based on selected criteria (customer status, group or network) or
            sort by any highlighted column. Warning triangle on the right side of the record
            shows if any warnings are active for the customer. Computer icon next to triangle
            informs you about computers status (connected of cutoff). Clicking of any of 
            those two symbols toggles status for all computers of the given customer. </para>
            <para>Records of customers with negative balance will have 'payback' icon
            (stack of coins), which allows you to account instant payment for the customer,
            which value will reset his debt.</para>
	    <para>When you click on selected customer you'll get screen with details
            for the customer, divided in several panels: customer details, computer details,
            liabilities details and customer account details. You can also select to edit
            any of the panels on this screen, define customer liabilities, payoff or charge the
            customer.</para>
	</sect2>
	<sect2 id="menu-customers-new">
	    <title>New Customer</title>
	    <para>This option will let you enter data for new customer record.
            You can enter his last and first name here, or if your customer is
also legal company, enter company name in "Name" and company representative in
"Forename" field. You should also fill customers phone (up to 3) and address (you
can enter additional address for correspondence) and his status (connected,
waiting in queue, prospect).
	    <note><para>Wrong capitalization (uppercase) of customer's last name is
one of most frequent bug reports. Uppercase is implemented via SQL functions and
thus you should seek for solution in your DB engine configuration.</para></note>
	    </para>
	</sect2>
	<sect2 id="menu-customers-search">
	    <title>Search</title>
	    <para>You're able to search customers (including deleted customers), using
various criteria. This module is more powerful than appropriate quick search
box in left panel, as you can specify exact field names to search and if many
customers are found, the list of records will be returned, not only the first one.
</para>
	</sect2>
	<sect2 id="menu-customers-groups">
	    <title>Groups</title>
	    <para>This is a place where it's possible to divide your customers into
groups. After you click 'Groups' you'll see list of all defined groups with some
basic information. Clicking on selected group will give you details view, where
you are able to edit this group properties, and view/add/remove group members.
</para>
	</sect2>
	<sect2 id="menu-customers-newgropup">
	    <title>New Group</title>
	    <para>You can define new group here, providing its name is unique,
and it only contains letters, digits and underscore and minus signs. Groups are
being used in scripts configuration, and for this reason group names cannot
contain spaces.</para>
	</sect2>
	<sect2 id="menu-customers-notices">
	    <title>Notices</title>
            <para>In this module, you're able to write administrative notice (message) which
            will appear on customers Web browser screen and assign it massively to all
            or majority of your customers (just pick them using selection box on the left).
            It's also possible here to deselect administrative messages massively here.
            </para>
	</sect2>
	<sect2 id="menu-customers-reports">
	    <title>Reports</title>
	    <para>Set of modules to provide printer-friendly version of your
            records:
	    <itemizedlist>
		<listitem>
		    <para><emphasis>Customer list</emphasis> with filter and sort abilities, </para>
		</listitem>
		<listitem>
		    <para><emphasis>Liability report</emphasis> for any range of customer(s), for specified date,</para>
		</listitem>
		<listitem>
		    <para><emphasis>Customer balance</emphasis> for selected period</para>
		</listitem>
	    </itemizedlist>
	    </para>
	</sect2>
 </sect1>
 <sect1 id="menu-nodes">
	<title>Nodes</title>
	<para>This panel is designed to manage your computer records, namely:
view computer list (with sorting), search, add new or delete existing computers
from database and editing capabilities.</para>
	<sect2 id="menu-nodes-list">
	    <title>List</title>
	    <para>List of computers will appear after you select 'List' link.
You can sort it by clicking on any highlighted column name. You have several icons on
each computer record: light bulb for connecting and cutting off selected
computer, warning triangle for warning screen toggle, eraser for computer
removal, pencil for editing details and file icon for viewing it. The last
module (computer/owner view) might be also accessed simply by clicking on
selected record.</para>
	</sect2>
	<sect2 id="menu-nodes-new">
	<title>New Node</title>
	    <para>You can add new computer here. First select good name for it
(it may contain letters, digits, underscore or minus sign), then it's owner. IP
and MAC addresses may be entered manually, or - by clicking arrow signs on the
right - you may select them from pool which is read from database and ARP daemon. After
you finish - click 'Save'. If you need to enter more computers it's
helpful to activate 'Display this form again' checkbox.
	    <note><para>To search computer addresses in your network you can use
nbtscan program. If it's available in system, you can click 'Scan' to get all
data about computers that are online.</para></note>
	    <note><para>You need to create customer and network first, so you can
assign new computer to it.</para></note></para>
	</sect2>
	<sect2 id="menu-nodes-search">
	    <title>Search</title>
	    <para>You can search for computers here by any given criteria. You
can enter whole IP, MAC or computer name, or just its fragment and search will
guess for you.</para>
	</sect2>
	<sect2 id="menu-nodes-notices">
	    <title>Notices</title>
		<para>You can write administration notice (message) here and it will
appear on customer's Web browser screen. In this module you can select majority or
all computers and assign them common message. Just choose computers using
selectbox on the left (computers with message already on will be displayed in
red). If you only want to assign a message to customer, but don't want to turn it
on, just write a notice and don't select any of 'Enable/Disable' boxes.
</para>
	</sect2>	
	<sect2 id="menu-nodes-reports">
	    <title>Reports</title>
		<para>You can get printer friendly list of your computers here.
It's possible to use same filter and sorting capabilities as on 'List'.</para>
	</sect2>
 </sect1>
 <sect1 id="menu-netdevices">
	<title>Net Devices</title>
	<para>In this panel you're able to keep all your network inventory and
define connections between your equipment and customer nodes. Each device
(switch, hub, router, server) might have also IP address(es) assigned.</para>
	    <sect2 id="menu-netdevices-list">
	    <title>List</title>
		<para>List of devices might include its names, symbols, physical
and logical location, description and number of available connection ports. You
might sort its output by any highlighted column. To see device details or define
all options and manage connected devices just click on selected record. It's
also possible to interchange two connections between devices on this
screen.</para>
	    </sect2>
	    <sect2 id="menu-netdevices-new">
	    <title>New device</title>
		<para>Network device should have unique name, all other
		parameters (manufacturer, model, serial number, ports, 
		location and description) are optional.</para>
	    </sect2>
	    <sect2 id="menu-netdevices-search">
	    <title>Search</title>
	    <para>You can search for devices here by any given criteria. You
		can enter whole IP, MAC or device name, or just its fragment and 
		search will guess for you.</para>
	    </sect2>
	    <sect2 id="menu-netdevices-map">
	    <title>Map</title>
		<para>Selection of 'Map' option draws graphical map of entire
		network. You can define root device, which will appear on top of the map and all
		other devices will be drawn relative to it.
		<note><para>You need GD or Ming library compiled in PHP 
		to be able to use graphical map.</para></note>
		Use <filename>'map_type'</filename> option in section <emphasis>[phpui]</emphasis> 
		section to specify type of map. Set it to "flash" if you've
		got Ming library, "gd" for graphic images or "openlayers" if you want to use
		map based on this library. By default (option
		not set) LMS will try to generate flash map, and when this fails, 
		t will fallback to GD.
		</para>
		<para>Device status is shown on the map - computers in black are
offline. Question mark on device icon means that its status is unknown (device 
has not been scanned yet). To use this functionality you need to setup scanning
script in crontab. Computer is marked as online if computer was online on last
successful scan and period since last scan is lesser than defined in
configuration (Default: 600 seconds). This parameter can be set with
<filename>lastonline_limit</filename> in [phpui] section of configuration file.
Above feature applies both to computers and devices, but in case of devices all
its ports (IPs) must be up for device to appear online. Computers status is also
available on nodes list in 'Nodes' panel. 
		<note><para>You can use lms-fping Perl script or lmsd daemon to
probe hosts availability.</para></note>
		</para>
	    </sect2>
 </sect1>
 <sect1 id="menu-networks">
	<title>IP Networks</title>
	<para>You can define all your networks here. Network is IP address pool
with parameters such as domain, DNSes, default gateway and DHCP pool. If you use
LMS to manage numerous networks or you use numerous address pools, it's
possible to define them here.</para>
	<sect2 id="menu-networks-list">
	    <title>List</title>
	    <para>Among basic data about network, each record contains
information about address space conservation - you can see summary of assigned
and free addresses. You're able to modify network properties after you click on
selected network or by clicking 'Edit' icon.</para>
	    <para>During edit you are able to browse list of nodes connected to
this network, node name will appear instead of IP number if that number is
occupied. If you click on free IP address, without any computer assigned to it,
new computer form will appear. There are also other features available for your
convenience: <emphasis>Put in order</emphasis> will readdress computers so that
there's no gap in the list and <emphasis>Reassign the network</emphasis> to move
all nodes from one network to another.</para>
	</sect2>
	<sect2 id="menu-networks-new">
	    <title>New Network</title>
	    <para>Defines a new network. Network needs to have unique name and address pool, defined by its IP address and netmask.
		    All other data is optional.</para>
	    <para>Physical interfaces, IP aliases and vlans are recognized in below manner:
<itemizedlist>
	<listitem>
		<para><emphasis>Physical interface</emphasis> - example: eth0</para>
	</listitem>
	<listitem>
		<para><emphasis>IP alias</emphasis> - example: eth0:1</para>
	</listitem>
	<listitem>
		<para><emphasis>Vlan interface with VID 19</emphasis> - example: eth0.19</para>
	</listitem>
	<listitem>
		<para><emphasis>First IP alias on vlan interface with VID 19</emphasis> - example: eth0.19:1</para>
	</listitem>
	    </itemizedlist>
</para>
	</sect2>
 </sect1>
 <sect1 id="menu-finances">
	<title>Finances</title>
	<para>This is actually the whole collection of modules, that gives you
possibility to efficiently manage finances of your network. You can define
periodical liabilities here (subscriptions), solid liabilities (orders),
perform accounting operations, check each account history and draw invoices
and balance sheets.</para>
	<sect2 id="menu-tariffs-list">
	    <title>Tariffs List</title>
	    <para>When you enter 'Tariffs List' panel you'll be able to see list of
liabilities (Tariffs) that might be assigned to your customers, with basic
information about it. When you select and click on liability you'll move to
'Tariff' module where you're able to edit its parameters and exchange customers
between available liabilities. In 'Number of customers'  field you can read
number of customers who are assigned to it and two numbers in parenthesis: total
number of assignments and number of active assignments, considered by its
activity periods.</para>
	</sect2>
	<sect2 id="menu-tariffs-new">
	    <title>New Tariff</title>
	    <para>When defining new tariff you need to enter unique name, amount
	    and tax rate.</para>
	</sect2>
	<sect2 id="menu-payments-list">
	    <title>Payments list</title>
    	    <para>This is a list of your company payments. Among standard fields
	    you'll find 'Account this payment' icon,
	    where you're able to charge your account. Periodical charges
	    might be done with 'lms-payments' Perl script, or appropriate module of lmsd
	    daemon. Select and click on chosen payment to view 'Payment Info' module, where
	    you're able to edit its parameters or account given payment to financial
	    database.</para>
	</sect2>
	<sect2 id="menu-payments-new">
	    <title>New payment</title>
	    <para>You have to assign unique name, amount and pay date for each
	    new payment you setup.</para>
	</sect2>
	<sect2 id="menu-balance">
	    <title>Balance sheet</title>
	    <para>This is history of your financial operations with total
incomes, expenditures, payments and customers liabilities. Printer icon allows
you to print invoice for corresponding record.</para>
	</sect2>
	<sect2 id="menu-newbalance">
	    <title>New Balance</title>
	    <para>You can add new financial operation with this module. It's
possible to account the same operation for multiple customers at the same
time.</para>
	    <para><note><para>It's best to use lms-payments Perl script or
<emphasis>lmsd</emphasis> daemon to automate periodical operations, such as
subscription fees. Those modules are also able to write out appropriate
invoices.</para></note></para>
	</sect2>
	<sect2 id="menu-invoices-list">
		<title>Invoices List</title>
		<para>List of invoices that has been already written out. You're
		able to print (by selecting 'Print' icon) and check as accounted selected
		invoices.</para>
	</sect2>
	<sect2 id="menu-invoices-new">
		<title>New Invoice</title>
		<para>Allows you to issue an invoice for selected customer manually.</para>
	</sect2>
	<sect2 id="menu-debitnotes-list">
		<title>Debit Notes List</title>
		<para>List of debit notes that has been already written out. You're
		able to print (by selecting 'Print' icon) and check as accounted selected
		notes.</para>
	</sect2>
	<sect2 id="menu-debitnotes-new">
		<title>New Debit Note</title>
		<para>Allows you to issue an debit note for selected customer manually.</para>
	</sect2>
	<sect2 id="menu-receipts-list">
	    <title>Cash Registry</title>
		<para>Cash register can be divided on many registries like cash1, cash2,
		main cash, bank, etc. On regirstries list are placed all information about
		defined registries with actual balance and summary which include only
		registries with not set "Disable summary" option.</para>
		<para>Each registry can have own numbering of cash-in and cash-out
		documents and access rights for users. "Write" privilage is assigned for
		common cashiers and dismiss receipts read and addition. 
		"Advanced" users can edit and delete documents and change number or date
		when create new document.</para>
		<para>Cash receipts are a proofs of payment in and out cash.
		Receipts list, which you'll find by clicking on selected registry on registries 
		list, can be sorted in any order and filtered like the
		invoices list. You've got also print selected receipts.</para>
		<para>From list you can go to receipt edition. Making changes in
		created documents needs special care, because submitting changes
		will delete old receipt and linked operations and insert 
		new ones.</para>
	</sect2>
	<sect2 id="menu-receipts-new">
	    <title>New Cash Receipt</title>
		<para>To create new cash document in first place you must specify registry
		and operation type (pay in/pay out), select customer from list or search 
		them using filter. You can select other operation type i.e. assets move or
		operation not associated with customer. Also you can set date and number 
		(better to leave values proposed by system). Then click 'Select' to affirm 
		your choice. After that you can add any number of positions with value and
		description or select them from list of not closed invoices/credit notes.
		'Save and Print' will finish and save receipt
		and payments in system and display receipt's printout in new window.</para>
		<para>Printouts look configuration is desribed in chapter Installation and
		Configuration.</para>
	</sect2>
	<sect2 id="menu-import">
	    <title>Import</title>
		<para>If you use homebanking, and you're able to get a list of
		financial operations (ie. from bank www or email that they send
		you), Import module can be used to (semi)automatically load it
		into LMS accounting database and assign to respective customers.
		You should write (or use, if it's already in distribution) a
		parser script, which loads data to the cashimport table. Please,
		check example script lms-cashimport-ingbs to see how this is
		being done. After you run it, you should get a list of pending
		financial operations, in Import module, where you can correct
		them and accept into LMS accounting database.</para>
		<para>You can also load previously prepared text file using this
		module. It will be read line by line and parsed using setup
		regular expressions to get needed data types (ie. customer id,
		amount, etc). After file is loaded, you will be presented with
		the same corrections/acceptance screen as above.</para>
		<para>To setup regular expressions, which suit to your input
		files you should create PHP script which location you must set in
		<filename>import_config</filename> option in <emphasis>[phpui]</emphasis>
		section. Example values and parameters descriptions are placed in
		<filename>modules/cashimportcfg.php</filename>.
		Default configuration assumes that input data will be in 
		the following format (tab separated):
<screen>
23.02.2004	Machniak Aleksander	123,45	Internet subscription - 04/2004 ID:0013
15.02.2004	Pain Joseph	123,45	Invoice paid - LMS/34/2004
</screen>
		</para>
		<para>While import operations are being accepted it's possible to
		enable auto-accounting of invoices. To do this enable option
		'cashimport_checkinvoices' in section <emphasis>[finances]</emphasis>.
		Invoice (and assigned credit notes) is checked when imported payment
		(taking customer balance into account) is greater than invoice liability.</para>
	</sect2>
	<sect2 id="menu-export">
	        <title>Export</title>
		<para>Financial data export to external systems rely on generation
		of text files with data fetched according to defined filters.
		For each document is created one record in text file. Record's 
		format sets user using variables.</para>
		<para>Export configuration is placed in file, which localization
		is set in <filename>export_config</filename> option of section 
		<emphasis>[phpui]</emphasis>. Example values with variables description 
		you can find in <filename>modules/exportcfg.php</filename>. 
		The bast way is to copy that file and there making needed changes.</para>
		<para>For each position of Sale Registry (each invoice)
		we have one record in result file. When exporting Cash Report one record is 
		for each position of cash document.</para>
	</sect2>
	<sect2 id="menu-finances-reports">
	    <title>Reports</title>
	    <para>There are several options for balance sheet printouts:
	    <itemizedlist>
		<listitem>
			<para><emphasis>Balance sheet for your network</emphasis>
			including financial operations for given period</para>
		</listitem>
		<listitem>
			<para><emphasis>Customer balance sheet</emphasis> for given
			period.</para>
		</listitem>
		<listitem>
			<para><emphasis>Sale Registry</emphasis>, which consists of
			invoices for given period.</para>
		</listitem>
		<listitem>
			<para><emphasis>Cash Report</emphasis>, which consists of
			cash receipts for given period and/or given registry and cashier.</para>
		</listitem>
		<listitem>
			<para><emphasis>Invoices</emphasis> for given
			period or/and selected customer.</para>
		</listitem>
		<listitem>
			<para><emphasis>Transfer forms</emphasis> for selected
			customer or customers group and given balance limit (only for polish forms).</para>
		</listitem>
		<listitem>
			<para><emphasis>Total invoiceless income</emphasis> for
			given period</para>
		</listitem>
		<listitem>
			<para><emphasis>Liability report</emphasis> for given day,
			for all or selected user</para>
		</listitem>
		<listitem>
			<para><emphasis>Cash import history</emphasis> for given
			period.</para>
		</listitem>
	    </itemizedlist>
	    </para>
	</sect2>
 </sect1>
 <sect1 id="menu-documents">
	<title>Documents</title>
	<para>Non-financial documents can be found direct on customer's page
	or in 'Documents' menu. In LMS you can store prepared files in many formats 
	or generate new ones with user-defined templates. This feature is most interesting
	because makes possible to create expanded plugins. Plugins can provide
	many actions not limited to just printout generation.</para>
	<sect2 id="menu-documents-list">
		<title>List</title>
		<para>List consist basic infos about all documents i.e. number, title
		type, creation date, obligation dates and customer name. Simple filter
		let you documents searching by type and/or customer.</para>
	</sect2>
	<sect2 id="menu-documents-new">
		<title>New document</title>
		<para>Documents can be created with templates made accordingly to
		rules described in section <xref linkend="install-documents-other">. Those can be also
		prepared files, which will be uploaded to server. Each document 
		should have defined title and type. Additionally you might define it's 
		time span (time until when it's valid) and description. Documents can be
		numbered with any numbering plan defined in system.</para>
	</sect2>
	<sect2 id="menu-customers-documentgen">
		<title>Documents Generator</title>
		<para>Generator provides possibility to create documents according to selected template
		group of customers. With option 'Print' you can print generated documents but only
		if they are of html type.
		<note><para>For performance reasons is recommended to use templates optimized for
		generator and to not print many (hundreds) documents (possible browser
		hang).</para></note></para>
	</sect2>
	<sect2 id="menu-documents-rights">
		<title>Access Rights</title>
		<para>Here you can define users access for specified actions
		(read, create, write, confirm, edit, delete) on documents by their types.</para>
	</sect2>
</sect1>
<sect1 id="menu-hosting">
	<title>Hosting</title>
	<para>It's now possible to manage accounts from your services using LMS.
This functionality is provided for advanced system administrators, because it
requires in-depth knowledge of services running on server in order to configure
them to use LMS database.</para>
	<para>You can create five types of accounts now: shell (1), email (2),
www (4), ftp (8) and sql (16). Decimal values for internal representation of those accounts
are given in parenthesis. This approach enables to provide multi-type accounts,
eg. if you define shell+email+ftp account it will be given number 11 in
database. This means that for recognition of account type you should use binary
sums in WHERE clauses of your SQL queries (few examples are written
below).</para>
	<para>You have also possibility to define domains and aliases.</para>
	<sect2 id="menu-hosting-accounts">
	    <title>Accounts</title>
	    <para>Account list contains basic information about your customer
accounts. It's possible to sort it by any highlighted column title and to filter
it for given criteria. You can edit any account clicking 'Edit' icon.
Administrator (LMS user) is also able to change account passwords.</para>
	</sect2>
	<sect2 id="menu-hosting-new-account">
	    <title>New Account</title>
	    <para>To create new account you have to provide its login, password,
	    choose domain, at least one account type and assign customer to it.</para>
	    <para>You can define any home directory for account. Option
	    <filename>homedir_prefix</filename> from section <emphasis>[phpui]</emphasis>
	    consists default prefix "/home/".</para>
	</sect2>
	<sect2 id="menu-hosting-aliases">
	    <title>Aliases</title>
	    <para>Every account (email type mainly) might have any number of
	    aliases that is needed. Mail server administrator might redirect mail locally
	    from all those aliases to physical existing account(s). Basic information about
	    alias and accompanying account is provided on the list. It's possible to sort
	    this list by any highlighted column name and to filter list for given criteria.</para>
	</sect2>
	<sect2 id="menu-hosting-new-alias">
	    <title>New Alias</title>
	    <para>Creating alias you have to define login, domain and destination account(s).
	    Destination accounts must exists in LMS. If you need alias for external account, 
	    you should create an account with redirect address.</para>
	</sect2>
	<sect2 id="menu-hosting-domains">
	    <title>Domains</title>
	    <para>Currently LMS can directly manage PowerDNS server with mysql/pqsql backend.
	    LMS now has full support for most of the features of PowerDNS server.
	    It has full support for zone types: master,  native and  slave.
	    You're able to see basic information about domains on the list such as: name, type, owner. 
	    It's possible to sort this list by any highlighted column name and to filter 
	    list for given criteria and by first letter of domain name. You can edit domain 
	    data by clicking 'Edit' icon. Add new domain at the bottom and at the top of the list.</para>
	</sect2>
	<sect2 id="menu-hosting-new-domain">
	    <title>New Domain</title>
	    <para>Domain data consists of name, description, type (master,slave,native), IP address of webserver,
	    IP address of mailserver, IP address of master NS (when type slave is selected) and other 
	    parameter which have default values stored in "zones" section. 
	    Domain can be assigned to customer. </para>
	</sect2>
	<sect2 id="menu-hosting-search">
	    <title>Search</title>
	    <para>You can search for accounts, aliases and domains here by any given criteria.</para>
	</sect2>
	<sect2 id="hosting-examples">
	    <title>Examples</title>
	    <para>The following section contains fragments of proftpd daemon
configuration (version 1.2.10) relevant to process of authentication with using
data available in LMS database. This example contains Postgres configuration and
optional MySQL configuration in comments, followed by pound (hash) sign.
	    <example id="hosting-e1">
		<title>Accounts. Proftpd configuration.</title>
<screen>
  ServerName	"LMS FTP Server"
  
  #dbname@host:port dbuser dbpass
  SQLConnectInfo lms@localhost:5432 lms mypassword
  
  SQLAuthTypes Crypt Plaintext
  SQLUserInfo passwd login password uid NULL home NULL
  RequireValidShell off
  SQLAuthenticate users
  
  # create user home directory if it doesn't exists yet
  SQLHomedirOnDemand on
  
  # login message
  SQLShowInfo PASS "230" "Last login: %{getlastlogin}"
  SQLLog PASS setlastlogin
  
  # SQLNamedQuery getlastlogin SELECT "CASE lastlogin WHEN 0 THEN '' ELSE FROM_UNIXTIME(lastlogin) END FROM passwd WHERE login='%u'"
  # SQLNamedQuery setlastlogin UPDATE "lastlogin=UNIX_TIMESTAMP() WHERE login='%u'" passwd 
  SQLNamedQuery getlastlogin SELECT "CASE lastlogin WHEN 0 THEN '' ELSE lastlogin::abstime::timestamp::text END FROM passwd WHERE login='%u'"
  SQLNamedQuery setlastlogin UPDATE "lastlogin=EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0)) WHERE login='%u'" passwd
  
  # We limit access to valid (not expired) accounts with ftp type
  # SQLUserWhereClause "type & 8 = 8 AND (expdate = 0 OR expdate &gt; UNIX_TIMESTAMP())"
  SQLUserWhereClause "type & 8 = 8 AND (expdate = 0 OR expdate &gt; EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0)))"
</screen>
	    </example></para>
	    <para>Next example will show us how to configure Postfix 2.1.1 mail
server with Cyrus-SASL 2.1.19 and Courier-IMAP/POP3 3.0.4, so that they use LMS
database. LMS accounts will be virtual, which means that they will be all
maintained by one uid on server with mail stored in Maildir format.</para>
	    <para>You'll need to patch your SASL for encrypted passwords,
because LMS database contains them only in this form. In comments we have
provided MySQL specific options. Only fragments relevant to database setup are
shown below:
	    <example id="hosting-e2">
		<title>Accounts. Mail server configuration (postfix+sasl+courier).</title>
<screen>
# smtpd.conf file (Cyrus-SASL):

pwcheck_method: auxprop
#sql_engine: mysql
sql_engine: pgsql
sql_user: lms
sql_passwd: dbpass
sql_hostnames: localhost
sql_database: lms
#sql_select: SELECT p.password FROM passwd p, domains d WHERE p.domainid = d.id
#   AND p.login='%u' AND d.name ='%r' AND p.type & 2 = 2 
#	AND (p.expdate = 0 OR p.expdate &gt; UNIX_TIMESTAMP())
sql_select: SELECT p.password FROM passwd p, domains d WHERE p.domainid = d.id
	AND p.login='%u' AND d.name ='%r' AND p.type & 2 = 2 
	AND (p.expdate = 0 OR p.expdate &gt; EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0)))
password_format: crypt
mech_list: login plain

# authpgsqlrc (or authmysqlrc) (Courier):

# user postfix (owner of mail directory)
#MYSQL_UID_FIELD '1004'
PGSQL_UID_FIELD '1004'
# group postfix (owner of mail directory)
#MYSQL_GID_FIELD '1004'
PGSQL_GID_FIELD '1004'
#MYSQL_PORT		3306
PGSQL_PORT		5432
#MYSQL_USERNAME		lms
PGSQL_USERNAME		lms
#MYSQL_PASSWORD		dbpass
PGSQL_PASSWORD		dbpass
#MYSQL_DATABASE		lms
PGSQL_DATABASE		lms
#MYSQL_SELECT_CLAUSE SELECT p.login, \
#       p.password, '', 104, 104, '/var/spool/mail/virtual', \
#       CONCAT(d.name,'/', p.login, '/'), '', p.login, '' \
#       FROM passwd p, domains d WHERE p.domainid = d.id \
#       AND p.login = '$(local_part)' AND d.name = '$(domain)' \
#       AND p.type & 2 = 2 AND (p.expdate = 0 OR p.expdate &gt; UNIX_TIMESTAMP())
PGSQL_SELECT_CLAUSE SELECT p.login, \
        p.password, '', 104, 104, '/var/spool/mail/virtual', \
        d.name || '/' || p.login ||'/', '', p.login, '' \
        FROM passwd p, domains d WHERE p.domainid = d.id 
        AND p.login = '$(local_part)' AND d.name = '$(domain)' \
        AND p.type & 2 = 2 \
        AND (p.expdate = 0 OR p.expdate &gt; EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0)))

# main.cf (Postfix):

virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_domains = pgsql:/etc/postfix/virtual_domains_maps.cf
virtual_mailbox_maps = pgsql:/etc/postfix/virtual_mailbox_maps.cf
virtual_alias_maps = pgsql:/etc/postfix/virtual_alias_maps.cf
recipient_bcc_maps = pgsql:/etc/postfix/recipient_bcc_maps.cf

# virtual_domains_maps.cf (Postfix):

user = lms
password = dbpass
hosts = localhost
dbname = lms
query = SELECT name FROM domains WHERE name = '%s'

# virtual_mailbox_maps.cf (Postfix):

user = lms
password = dbpass
hosts = localhost
dbname = lms
# MySQL
#query = SELECT CONCAT(d.name, '/', p.login, '/') 
#	FROM passwd p, domains d WHERE p.domainid = d.id
#       AND p.login = '%u' AND d.name = '%d' 
#       AND p.type & 2 = 2 
#       AND (p.expdate = 0 OR p.expdate &gt; UNIX_TIMESTAMP())
# PostgreSQL
query = SELECT d.name || '/' || p.login || '/' 
	FROM passwd p, domains d WHERE p.domainid = d.id
        AND p.login = '%u' AND d.name = '%d' 
        AND p.type & 2 = 2 
        AND (p.expdate = 0 OR p.expdate &gt; EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0)))

# virtual_alias_maps.cf (Postfix):

user = lms
password = dbpass
hosts = localhost
dbname = lms
# MySQL
# MySQL
#query = SELECT p.mail_forward
#	FROM passwd p
#	JOIN domains d ON (p.domainid = d.id)
#	WHERE p.login = '%u' AND d.name = '%d'
#		AND p.type & 2 = 2 AND p.mail_forward != ''
#		AND (p.expdate = 0 OR p.expdate &gt; UNIX_TIMESTAMP())
#	UNION
#   SELECT CASE WHEN aa.mail_forward != '' THEN aa.mail_forward ELSE CONCAT(p.login, '@', pd.name) END
#	FROM aliases a
#	JOIN domains ad ON (a.domainid = ad.id)
#	JOIN aliasassignments aa ON (aa.aliasid = a.id)
#	LEFT JOIN passwd p ON (aa.accountid = p.id AND (p.expdate = 0 OR p.expdate &gt; UNIX_TIMESTAMP()))
#	LEFT JOIN domains pd ON (p.domainid = pd.id)
#	WHERE a.login = '%u' AND ad.name = '%d'
#		AND (aa.mail_forward != '' OR p.id IS NOT NULL)
# PostgreSQL	
query = SELECT p.mail_forward
	FROM passwd p
	JOIN domains d ON (p.domainid = d.id)
	WHERE p.login = '%u' AND d.name = '%d'
		AND p.type & 2 = 2 AND p.mail_forward != ''
		AND (p.expdate = 0 OR p.expdate &gt; EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0)))
	UNION
	SELECT CASE WHEN aa.mail_forward != '' THEN aa.mail_forward ELSE p.login || '@' || pd.name END
	FROM aliases a
	JOIN domains ad ON (a.domainid = ad.id)
	JOIN aliasassignments aa ON (aa.aliasid = a.id)
	LEFT JOIN passwd p ON (aa.accountid = p.id
		AND (p.expdate = 0 OR p.expdate &gt; EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0))))
	LEFT JOIN domains pd ON (p.domainid = pd.id)
	WHERE a.login = '%u' AND ad.name = '%d'
		AND (aa.mail_forward != '' OR p.id IS NOT NULL)

# recipient_bcc_maps.cf (Postfix):

user = lms
password = dbpass
hosts = localhost
dbname = lms
# MySQL
#query = SELECT p.mail_bcc
#        FROM passwd p, domains d WHERE p.domainid = d.id
#		AND p.login = '%u' AND d.name = '%d'
#		AND p.type & 2 = 2
#		AND p.mail_bcc != ''
#		AND (p.expdate = 0 OR p.expdate &gt; UNIX_TIMESTAMP())
# PostgreSQL
query = SELECT p.mail_bcc
        FROM passwd p, domains d WHERE p.domainid = d.id
		AND p.login = '%u' AND d.name = '%d'
		AND p.type & 2 = 2
		AND p.mail_bcc != ''
		AND (p.expdate = 0 OR p.expdate &gt; EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0)))
</screen>
	    </example></para>
	</sect2>
 </sect1>
 <sect1 id="menu-messages">
	<title>Messages</title>
	<para>Messages is a component where you can spam groups of your customers
	with email or sms messages.</para>
	<sect2 id="menu-messages-list">
		<title>List</title>
	    	<para>On the list you have a history of sent messages. You can sort them
	    	using filter. Clicking on the message record moves you to information page
	    	with message content and list of recipients. On the list you have 
	    	delivery status of every (sub)message.</para>
	</sect2>
	<sect2 id="menu-messages-new">
    	    	<title>New message</title>
	    	<para>To send a message you should specify appropriate
	    	group of recipients, type of message (email/sms). Your attendance can be
	    	grouped by status, network or customer/node groups, etc.</para> 
		<para>In message body you can use variables, which will be replaced by
	    	customer data:
	    	<simplelist>
			<member><prompt>%customer</prompt> - name/lastname and forename</member>
			<member><prompt>%balance</prompt> - balance value (with sign)</member>
			<member><prompt>%cid</prompt> - customer ID</member>
			<member><prompt>%pin</prompt> - customer PIN</member>
			<member><prompt>%last_10_in_a_table</prompt> - last 10 operations on customer account</member>
			<member><prompt>%bankaccount</prompt> - bank account number</member>
		</simplelist>
		</para>
	</sect2>
	<sect2 id="menu-messages-conf">
		<title>Configuration</title>
		<para>Your server has to support PEAR::Mail for this to send email messages.
		If you use mail server on remote host, you will need to set options
	    	smtp_host, smtp_port, smtp_username, smtp_password in [mail] section.</para>
	    	<para>Here we've got the list of configuration options for mailing. These options
	    	should be placed in <emphasis>[mail]</emphasis> section.
    	    	<itemizedlist>
    	    	<listitem>
        		<para>debug_email</para>
        		<para>E-mail address for debugging - messages sent from module 'Messages' will be delivered
        		to this address instead of sending them to real users. </para>
        		<para>Example:     <prompt>debug_email = root@localhost</prompt></para>
    	    	</listitem>
    	    	<listitem>
        		<para>smtp_host, smtp_port, smtp_username, smtp_password</para>
        		<para>Parameters for smtp authorization in mailing. Default: 127.0.0.1:25.</para>
        		<para>Example:     <prompt>smtp_host = mail.domain.pl</prompt></para>
    	    	</listitem>
    	    	<listitem>
        		<para>smtp_auth_type</para>
        		<para>Smtp authorization method in mailing. By default LMS (exactly PEAR::Net_SMTP) 
    			will use the best supported method. Default: none.</para>
        		<para>Example:     <prompt>smtp_auth_type = DIGEST-MD5</prompt></para>
    	    	</listitem>
	    	</itemizedlist>
	    	</para>
		<para>SMS configuration is more complex. Forst of all you have to define
		a service type to use. This could be a SMS gateway or some software installed
		on LMS server (e.g. gnokii, smstools). For SMS configuration options <emphasis>[sms]</emphasis>
		section is intended:
		<itemizedlist>
			<listitem>
				<para>service</para>
				<para>service type for sending text messages. Supported values: 'smstools' and 'smscenter'.</para>
				<para>Example:     <prompt>service = smstools</prompt></para>
			</listitem>
			<listitem>
				<para>prefix</para>
				<para>Phone country code. Default: 48 (Poland)</para>
				<para>Example:     <prompt>prefix = 49</prompt></para>
			</listitem>
			<listitem>
				<para>from</para>
				<para>Message sender. Default empty.</para>
				<para>Example:     <prompt>from = ISP Co.</prompt></para>
			</listitem>
			<listitem>
				<para>username</para>
				<para>Username for sms gateway. Default: empty.</para>
				<para>Example:     <prompt>username = isp</prompt></para>
			</listitem>
			<listitem>
				<para>password</para>
				<para>Password for sms gateway. Default: empty.</para>
				<para>Example:     <prompt>password = haslo</prompt></para>
			</listitem>
			<listitem>
				<para>smscenter_type</para>
				<para>Type of account you have at smscenter service. LMS will add sender at 
				the end of message, when static type has been set. 
				Correct values are: static and dynamic. Default: dynamic.</para>
				<para>Example:     <prompt>smscenter_type = static</prompt></para>
			</listitem>
			<listitem>
				<para>smstools_outdir</para>
				<para>Directory with outgoing message files for smsd (smstools).
				HTTP server must have a write access to it. Deafault: /var/spool/sms/outgoing.</para>
				<para>Example:     <prompt>smstools_outdir = /home/smsd/outgoing</prompt></para>
			</listitem>
		</itemizedlist>
		</para>
	</sect2>
 </sect1>
 <sect1 id="menu-reload">
	<title>Reload</title>
	<para>Click on 'Reload' and reload request or command should execute.
	If you did configure hosts, you will see list of hosts for
	selection to reload configuration on selected hosts.
	What services and how they're updated is configured in
	<emphasis>LMS-MGC</emphasis> or <emphasis>lmsd</emphasis> daemon. You'll find
	needed information about configuration in appropriate chapters of this
	documentation.</para>
 </sect1>
 <sect1 id="menu-stats">
	<title>Stats</title>
	<para>This is interface to view bandwidth consumption per host
statistics enclosed in bar graphs. Statistics contains data about sent and
received bytes for given interface for each node. Using drop down menu you can
quickly generate statistics for given time periods: last hour, day, 30 days or
year.
	    <note><para>You need working lms-traffic Perl script or
<emphasis>lmsd</emphasis> daemon running to collect statistics.</para></note>
	</para>
	<sect2 id="menu-stats-filter">
	<title>Filter</title>
	    <para>Before you can see graphs you can define parameters to limit
period or network (if you have many), top number of computers considered and
sort output as you like (ie. by top download).</para>
	</sect2>
	<sect2 id="menu-stats-compact">
	<title>Compacting</title>
	    <para>Depending on chosen update frequency amount of database data
used for statistics might grow fast, which will lead to extension of time needed
to generate statistics. For that reason in 'Compacting' menu you're able to
shrink your database size without data loss. This module will compact data using
following logic:
		<itemizedlist>
		    <listitem><para><emphasis>Low precision (low)</emphasis>: data
from previous date and older will be approximated to one day. If you save data
each 10 minutes 6*24 records will be compacted to one.</para></listitem>
		    <listitem><para><emphasis>Medium precision (medium)</emphasis>: data
older than month will be approximated to one day.</para></listitem>
		    <listitem><para><emphasis>High precision (high)</emphasis>: data
older than month will be approximated to one hour.</para></listitem>
		</itemizedlist>
	    <warning><para>Data approximation is irreversible.</para></warning>
	    </para>
	    <para>
	    It's possible to do database compacting with cron. Compacting page 
	    can be viewed (executed) directly by web browser in following way:
<screen>
links -dump \
"http://lms/?m=trafficdbcompact&amp;level=low&amp;removeold=1&amp;removedeleted=1&amp;loginform[login]=login&amp;loginform[pwd]=pass&amp;override=1"
</screen>
	    </para>
	</sect2>
	<sect2 id="menu-stats-reports">
		<title>Reports</title>
		<para>Here you can print statistics of given customer in selected
		month. Printout consist upload/download summary grouped by month days
		with average transfer speed.</para>
	</sect2>
</sect1>
<sect1 id="menu-helpdesk">
	<title>Helpdesk</title>
	    <para>Helpdesk (or Request Tracker) is customer request management
system. It's possible to keep history of all requests and questions here, both reported by
customers and users not registered in LMS database. Reports can be grouped in
queues (categories) and you're able to search them for a given criteria. It's possible to
define access rights for LMS users to each queue.</para>
	    <para>You have quick search box in left (menu) panel, which may be
used to jump to appropriate ticket giving ticket id or reporter name. Searching
by reporter name will give a list of all tickets available for this user.</para>
	    <para>Each ticket includes history built on messages sent by
administrators (LMS users) and customers. Administrator may send his message to
customer specifying recipient name and clicking 'Submit/Send', email will be
sent with queue address as sender, or - if it's empty - LMS user address. All
messages, including those sent, are recorder in ticket history. Each ticket may
be in one of the states: new, opened, resolved or dead.</para>
	    <para>Please look at <xref linkend="lms-rtparser"> script which has been developed to
support incoming requests and outgoing comments by your mail server.</para>
	<sect2 id="menu-helpdesk-list">
	<title>Queues List</title>
	    <para>Basic information and request statistics are available on
queues list. Select and click on chosen queue to display all tickets belonging
to it. You can also go to detailed view (including permissions) about queue or
remove given queue. Removing queue will also remove all belonging tickets from
database.</para>
	</sect2>
	<sect2 id="menu-helpdesk-newqueue">
	<title>New queue</title>
	    <para>Queue (category) contains a name, optional description and
optional email address, used in correspondence. 'Permissions' table defines LMS
users access to this queue, which overrides those set in 'Administration', which
means, that the user who has 'full access' permissions won't be able to see
queue and tickets placed in it until he's given access to that queue.
Enabling 'write' (tickets and comments edit ability) to user automatically gives
him 'read' access. 'Notices' privilege is used to notify users about new tickets.
If 'newticket_notify' option is enabled all users with this privilege will get 
notifications by email.</para>
	</sect2>
	<sect2 id="menu-helpdesk-search">
	<title>Searching</title>
	    <para>Tickets are searchable by all given criteria (AND not OR). You
can provide subject, owner, queue, status and reporter for your search.
Customers may be selected from drop-down list, unregistered users may be
searched by name or email address.</para>
	</sect2>
	<sect2 id="menu-helpdesk-newticket">
	<title>New ticket</title>
	    <para>For each new ticket you need to provide subject, content,
queue and reporter. Unregistered users (not in customers database) should be
recorded using 'Submitter' fields. You can provide email address (in both
registered/unregistered cases) if ticket will be running via email.</para>
	</sect2>
	<sect2 id="menu-helpdesk-reports">
		<title>Reports</title>
		<para>Here you can print requests list and helpdesk statistics:
		<itemizedlist>
		    <listitem>
			<para><emphasis>List of requests</emphasis> with queue, status, uptime 
			and customer filters,</para>
		    </listitem>
		    <listitem>
			<para><emphasis>Requests stats</emphasis> with queue filter</para>
		    </listitem>
		</itemizedlist>
		</para>
	</sect2>
    </sect1>
    <sect1 id="menu-timetable">
	<title>Timetable</title>
	<para>Timetable is your time scheduler, where each user may setup his own 
	calendar. Events or tasks being put here may be also visible for other
	users and consist a list of assigned clients, which make this tool usable
	for service crew management.</para>
	<para>There is an additional <filename>lms-reminder</filename> script,
	which may be executed periodically to remind users about their pending
	tasks.</para>
	<sect2 id="timetable-list">
	    <title>Timetable (Task list)</title>
	    <para>Main timetable shows list of days starting from day which is 
	    selected from calendar popup. A number of days displayed depends on
	    <filename>timetable_days_forward</filename> configuration option and
	    defaults to 7 days. From task list you might print a day plan or go to
	    event edit screen.</para>
	</sect2>
	<sect2 id="timetable-new">
	    <title>New event</title>
	    <para>You can add new task to the Timetable by selecting short title
	    and start date and time (or time span). All other fields are optional.
	    By selecting 'private' option you can hide current event from the
	    other users, so that it will be visible only for event creator. This
	    feature allows you to run your own, private calendar.</para>
	</sect2>
	<sect2 id="timetable-search">
	    <title>Search</title>
	    <para>You can search in Timetable by the following criteria: time span
	    (start and end date), client affected, client or fragment of text in
	    title, event description or its notes. List of results will include
	    events that match all entered criteria.</para>
	</sect2>
    </sect1>
    <sect1 id="menu-configuration">
	<title>Configuration</title>
	    <sect2 id="config-ui">
	    <title>User Interface</title>
		<sect3 id="config-basic">
		<title>Basics</title>
	        <para>Since LMS 1.5.3 you're able to configure all UI-related
    	        options directly via <emphasis>LMS-UI</emphasis>, instead of editing
        	<filename>lms.ini</filename>. Those options are stored in database and you first
                need to import them from your config file (even if you haven't edited anything
	        yet, default values will be imported). This can be done by clicking
    	        on the link presented on empty list.</para>
		<para><note><para>Options setup with <emphasis>LMS-UI</emphasis>
                have higher priority than those in configuration file. With options setup in UI,
	        the configuration will be still imported from file but values will be then
    	        overwritten by those found in DB.</para></note></para>
		<para><note><para>Daemon read some options other than its configuration from
    		database only, so it's preferred to store configuration in database.</para></note></para>
    		<para>In order to manually add new option click 'Add option' on the
	        bottom of the list. To edit option value, click on its record. You'll be given
    		with edit form, where you are also able to remove this option. Changing option
    		status allows you to turn it on and off instantly. When an option is off,
    	        default value will be used (if it posses any).</para>
	</sect3>
	<sect3 id="config-options">
    	    <title>Configuration Options List</title>
	    <para>Here we've got the list of UI configuration options. Those options
	    should be placed in <emphasis>[phpui]</emphasis> section. The rest of options
	    is described in appropriate chapters.
    	    <itemizedlist>
    	    <listitem>
            	<para>allow_from  (optional)</para>
	        <para>List of networks or IP addresses, which have access to LMS. If empty, every IP
    		address is permitted. You can write here list of addresses or address pools and LMS
            	will dismiss every unwanted user with HTTP 403 error.</para>
            	<para>Example:          <prompt>allow_from = 192.168.0.0/16, 213.25.209.224/27, 213.241.77.29</prompt></para>
    	    </listitem>
    	    <listitem>
    		<para>lang</para>
		<para>User interface language code (ISO). IF not set, language will be based on HTML
    		browser settings. Default: en</para>
    		<para>Example:     <prompt>lang = pl</prompt></para>
	    </listitem>
	    <listitem>
    		<para>timeout</para>
    		<para>Timeout for WWW session. User will be log out if he won't perform any action in such
    		number of seconds. Default: 600</para>
    		<para>Example:     <prompt>timeout = 900</prompt></para>
    		<para><warning><para>It's not possible to not to have any timeout. If you set this value to
    		zero, you won't be able to use LMS at all!</para></warning></para>
	    </listitem>
    	    <listitem>
    		<para>default_module</para>
		<para>Start-up module (filename from <filename>/modules</filename> without .php). 
		Default: welcome.</para>
    		<para>Example:     <prompt>default_module = copyrights</prompt></para>
	    </listitem>
	    <listitem>
        	<para>customerlist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of customers list. Default: 100</para>
    		<para>Example:     <prompt>customerlist_pagelimit = 10</prompt></para>
	    </listitem>
	    <listitem>
        	<para>nodelist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of nodes list. Default: 100</para>
    		<para>Example:     <prompt>nodelist_pagelimit = 10</prompt></para>
	    </listitem>
	    <listitem>
        	<para>balancelist_pagelimit</para>
    		<para>Limit of records that can be displayed on one page of customer balance. Default: 100.</para>
        	<para>Example:     <prompt>balancelist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>invoicelist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of invoices list. Default: 100</para>
        	<para>Example:     <prompt>invoicelist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>ticketlist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of ticket (requests) list. Default: 100</para>
        	<para>Example:     <prompt>ticketlist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>networkhosts_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of nodes with network information.
        	Default: 256</para>
        	<para>Example:     <prompt>networkhosts_pagelimit = 1024</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>accountlist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of customer accounts. Default: 100</para>
        	<para>Example:     <prompt>accountlist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>domainlist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of system domains. Default: 100</para>
        	<para>Example:     <prompt>domainlist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>aliaslist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of user aliases. Default: 100</para>
        	<para>Example:     <prompt>aliaslist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>configlist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of UI configuration list. Default: 100</para>
        	<para>Example:     <prompt>configlist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>taxratelist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of tax rates list. Default: 100</para>
        	<para>Example:     <prompt>taxratelist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>numberplanlist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of numbering plans list. Default: 100</para>
        	<para>Example:     <prompt>numberplanlist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>divisionlist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of divisions list. Default: 100</para>
        	<para>Example:     <prompt>divisionlist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>documentlist_pagelimit</para>
        	<para>Limit of records that can be displayed on one page of documents list. Default: 100</para>
        	<para>Example:     <prompt>documentlist_pagelimit = 50</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>reload_type</para>
        	<para>Reload type. Allowed values:</para>
        	<para>exec - execute some command (usually with sudo, script or something
        	else, configurable below)</para>
        	<para>sql  - doing SQL writes (can be also set to custom query)</para>
        	<para>Default: sql.</para>
        	<para>Example:     <prompt>reload_type = exec</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>reload_execcmd</para>
        	<para>Command to run during reload, if reload_type is set to 'exec'. By default
        	<filename>/bin/true</filename>. This string is send to system() command, so make sure that
        	you know what you're doing. :) Besides, semicolons should be parsed by bash, but LMS splits
        	that string and execute commands separately. In commands you can use
		'%host' variable, which is replaced by defined host name (Configuration -> Hosts).</para>
        	<para>Example:     <prompt>reload_execcmd = "sudo /usr/bin/reload_lms.sh %host"</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>reload_sqlquery</para>
        	<para>SQL query executed while reload, if <prompt>reload_type = sql</prompt>. By default,
        	query sets reload order for daemon <emphasis>lmsd</emphasis>. You can use '%TIME%'
        	template in your query which will be substituted with current UNIX timestamp and '%host'
		for host name. WARNING!	Semicolon is handled as query separator, which means 
		that you can enter couple of SQL queries separated by semicolon sign.</para>
        	<para>Example:     <prompt>reload_sqlquery = "INSERT INTO reload VALUES ('1','%TIME%')"</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>force_ssl</para>
        	<para>Enforce SSL for all connections. Setting this option to 1 will
        	turn LMS into enforcing SSL connections by applying redirect to
        	'https://'.$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI] at every access without SSL. Default:
        	0 (off).</para>
        	<para>Example:     <prompt>force_ssl = 1</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>allow_mac_sharing</para>
        	<para>Allows for node addition even if its MAC address is not unique (not checking that
        	some computer have that MAC yet). Default: 0 (off)</para>
        	<para>Example:     <prompt>allow_mac_sharing = 1</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>smarty_debug</para>
        	<para>Enable Smarty debug console. Useful for tracking values passed from PHP to Smarty.
        	Default: 0 (off).</para>
        	<para>Example:     <prompt>smarty_debug = 1</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>default_zip, default_city, default_address</para>
        	<para>Default zip code, city and street used on "new user" form. Useful when we have many
        	users on the same street.</para>
        	<para>Example:     <prompt>default_zip = 39-300</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>use_current_payday</para>
        	<para>Forces to use current day of month as a payment day.
        	Default: 0 (off).</para>
        	<para>Example:     <prompt>use_current_payday = 1</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>default_monthly_payday</para>
        	<para>Forces to use given day of month as a payment day.
		Default: 0 (undefined).</para>
		<para>Example:     <prompt>default_monthly_payday = 1</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>use_invoices</para>
        	<para>Makes option "with invoice" checked by default.
		Default: false.</para>
		<para>Example:     <prompt>use_invoices = true</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>lastonline_limit</para>
        	<para>Specify time (in seconds), after which node will be marked offline. It should match
        	frequency of execution for script responsible for checking nodes activity (i.e. lms-fping).
        	Default: 600.</para>
        	<para>Example:     <prompt>lastonline_limit = 300</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>timetable_days_forward</para>
        	<para>Specify number of days (including current day) visible on timetable.
        	Default: 7.</para>
        	<para>Example:     <prompt>timetable_days_forward = 2</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>arpd_servers</para>
        	<para>List of arpd servers for reading MAC addresses from remote networks.
        	That list should include IP[:port] items separated with spaces.
        	Default: empty.</para>
        	<para>Example:     <prompt>arpd_servers = 192.168.1.1 192.168.2.1</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>helpdesk_backend_mode</para>
        	<para>When enabled, all messages in helpdesk system (except those sent to ticket reporter)
        	will be sent to mail server to the appropriate queue address. Mail server should run
        	lms-rtparser script, which will write messages to database. Default: disabled.</para>
        	<para>Example:     <prompt>helpdesk_backend_mode = On</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>helpdesk_sender_name</para>
        	<para>Name of message sender or predefined values: 'queue' - ticket's queue name,
    		'user' - name of logged user (sender). Default: empty.</para>
        	<para>Example:     <prompt>helpdesk_sender_name = Helpdesk</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>newticket_notify</para>
        	<para>If enabled, after new ticket addition system will send notification
        	emails to all users with rights to the queue. Default: disabled.</para>
        	<para>Example:     <prompt>newticket_notify = On</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>helpdesk_stats</para>
        	<para>Adds requests causes stats on ticket view and print pages.
        	Default: enabled.</para>
        	<para>Example:     <prompt>helpdesk_stats = true</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>helpdesk_customerinfo</para>
        	<para>Adds customer basic information on ticket view and in notifications.
        	Default: enabled.</para>
        	<para>Example:     <prompt>helpdesk_customerinfo = false</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>ticketlist_status</para>
        	<para>Default status filter setting on tickets list. For allowed values
		see html source code. Default: not set.</para>
        	<para>Example:     <prompt>ticketlist_status = -1</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>ticket_template_file</para>
        	<para>Helpdesk ticket printout template file. Default: rtticketprint.html.</para>
        	<para>Example:     <prompt>ticket_template_file = ../mytemplates/ticket.html</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>to_words_short_version</para>
        	<para>Specify format of verbal amounts representation (on invoices). For value "1"
        	verbal expand of 123,15 will be "one two thr 15/100". Default: 0.</para>
        	<para>Example:     <prompt>to_words_short_version = 1</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>nodepassword_length</para>
        	<para>Length of (auto-generated) node password. Max.32. Default: 16.</para>
        	<para>Example:     <prompt>nodepassword_length = 8</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>gd_translate_to</para>
        	<para>Charset of data that GD library expects (useful if GD need ISO-8859-2 instead of UTF-8 to feed imagetext() function. Default: ISO-8859-2.</para>
        	<para>Example:     <prompt>gd_translate_to = </prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>check_for_updates_period</para>
        	<para>How often to check for LMS updates (in seconds). Default: 86400.</para>
        	<para>Example:     <prompt>check_for_updates_period = 604800</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>default_taxrate</para>
        	<para>Specify value (not label) of tax rate which will be selected 
		on drop-down lists by default. Default: 22.</para>
        	<para>Example:     <prompt>default_taxrate = 22.0</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>big_networks</para>
        	<para>Support for big ISPs e.g. hidding long selection dropdowns. 
		Default: false.</para>
        	<para>Example:     <prompt>big_networks = true</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>short_pagescroller</para>
        	<para>Enables page scroller designed for lists with very big number of pages. Default: false.</para>
        	<para>Example:     <prompt>short_pagescroller = true</prompt></para>
    	    </listitem>
    	    <listitem>
        	<para>ewx_support</para>
        	<para>Support for <ulink url="http://etherwerx.com">EtherWerX</ulink> devices. 
		Default: false.</para>
        	<para>Example:     <prompt>ewx_support = true</prompt></para>
    	    </listitem>
	    <listitem>
		    <para>default_assignment_period</para>
		    <para>Default period value for assignment.
			    Possible values:
			    
			    disposable - 0
			    daily      - 1
			    weekly     - 2
			    monthly    - 3 
			    quarterly  - 4
			    yearly     - 5			
			    Default: 0</para>
		    <para>Example:     <prompt>default_assignment_period = 3</prompt></para>
	</listitem>
    	    </itemizedlist>
	    </para>
        </sect3>
	</sect2> 
	<sect2 id="config-taxes">
	    <title>Tax Rates</title>
		<para>Before you have to begin with financial system you will need
		to define tax rates which you will use. On the list are place all 
		rates data. It's possible to edit tax rate, but system will not
		allow to change value of rate that was used in the past. Also isn't
		possible to delete that rate.</para>
		<para>Link 'Add tax rate' moves you to the form, where you can define 
		a new rate. Tax rate label is displayed on select lists and invoice
		printout. Value of tax rate is a number from 0 to 100 with two 
		decimal places precision. Taxing status is used for tax-free rate, that 
		means the rest of defined tax rates should have taxing enabled.</para>
		<para>Tax rate which will be selected by default on lists is defined
		by <filename>default_taxrate</filename> option in section 
		<emphasis>[phpui]</emphasis>.</para>
	</sect2>
	<sect2 id="config-numberplans">
	    <title>Number plans</title>
		<para>This feature allows you to add unique numbering plan
	        (numbering sequence) for each type of documents created in LMS.
		It's also possible to define different sequences within one type of 
		documents. For each document type you might define default
		sequence (important, ie. when you're issuing invoices
		automatically, as perl scripts or daemon will use this default
		scheme when creating new document).</para>
		<para>For each sequence you should also define time span, that is
		period in which sequence numbers will be unique. When time span
		selected will reach its end, sequence will be zeroed. You are able
		to set period to one of: daily, weekly (Monday to Sunday), monthly, 
		quarterly or annually.</para>
		<para>Numbering plans list consist of all its identifying
		information included, followed by example number generated using
		this plan plus number of documents created with this plan. You
		might select 'Add plan' to enter new sequence. Editing is possible by 
		clicking the field that you want to change. Deletion of plan is
		only possible when no documents has been created with that
		yet.</para>
		<para>Sequence template might be any string, which consist some of
		symbols (specifiers) known from PHP strftime function. Detailed
		information and list of all symbols can be find in <ulink 
                url="http://www.php.net/manual/pl/function.strftime.php">PHP
		Manual</ulink>. The most important and the only required symbol in
		sequence template is '%N', which will be substituted with
		incremented document number. All other symbols will expand to
		document's date of issue. Below you can find most popular ones:
		<itemizedlist>
		    <listitem>
			<para>%N - integer number, uniquely identifying document</para>
		    </listitem>
		    <listitem>
			<para>%[1-9]N - as above, but with leading zeroes, ie.  '%4N' will return '0012' for 12</para>
		    </listitem>
		    <listitem>
			<para>%I - additional part of number (works with cash documents only)</para>
		    </listitem>
		    <listitem>
			<para>%Y - year as a 4 digit number</para>
		    </listitem>
		    <listitem>
			<para>%y - year as a 2 digit number</para>
		    </listitem>
		    <listitem>
			<para>%m - month number with leading zero (01 to 12)</para>
		    </listitem>
		    <listitem>
			<para>%b - short month name (according to system locales)</para>
		    </listitem>
		</itemizedlist>
		</para>
		<para><note><para>If you have no numbering plans defined, each document will 
		take default number as of '%N/LMS/%Y' with annual time span.</para></note></para>
	</sect2>
	<sect2 id="config-divisions">
	    <title>Divisions</title>
	    <para>Divisions/Companies are used for customers grouping. You should create
	    at least one division. You can define division's short and long names, address
	    bank account (or mass-payments account prefix) and other data for invoices.
	    Locked division cannot be assigned to customer.
	    </para>
	</sect2>
	<sect2 id="config-hosts">
	    <title>Hosts</title>
	    <para>This section defines host names of those machines 
	    (routers, servers) that read its configuration from LMS database 
	    and where scripts or <emphasis>lmsd</emphasis> daemon will be 
	    setup. </para>
	    <para>Each host name should be unique and it's recommended to 
	    be machine's real name, which could be obtained by running 
	    <prompt>hostname</prompt> command on each of them 
	    (assuming they're all u*ix hosts).</para>
	</sect2>
	<sect2 id="config-daemon">
	    <title>Daemon</title>
	    <para>When you create hosts list, you will be able to configure
	    daemon <emphasis>lmsd</emphasis>. Daemon configuration is described
	    in appropriate chapter.</para>
	</sect2>
	<sect2 id="config-sources">
	    <title>Import sources</title>
	    <para>It's possible to import customer payments from many sources (banks).
	    Here you can define its names/description. Then you will able to
	    select source from the list to add/import payments or some create payments reports.</para>
	</sect2>
    </sect1>
</chapter>
