aboutsummaryrefslogtreecommitdiffstats
path: root/config/sarg
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-04-10 02:57:13 -0300
committermarcelloc <marcellocoutinho@gmail.com>2012-04-10 02:57:13 -0300
commit1a2be8cf92c27534675aff54e134b338dade1a63 (patch)
tree3227534563c0297057f139183d093c823722281b /config/sarg
parent210f73a354126d93d4e5cc7c6cdadaeafe9c4949 (diff)
downloadpfsense-packages-1a2be8cf92c27534675aff54e134b338dade1a63.tar.gz
pfsense-packages-1a2be8cf92c27534675aff54e134b338dade1a63.tar.bz2
pfsense-packages-1a2be8cf92c27534675aff54e134b338dade1a63.zip
sarg - package version 0.4 with user tab, ldap search and report limits
Diffstat (limited to 'config/sarg')
-rw-r--r--config/sarg/sarg.inc61
-rw-r--r--config/sarg/sarg.template21
-rw-r--r--config/sarg/sarg.xml112
-rwxr-xr-xconfig/sarg/sarg_about.php3
-rwxr-xr-xconfig/sarg/sarg_realtime.php3
-rwxr-xr-xconfig/sarg/sarg_reports.php3
-rw-r--r--config/sarg/sarg_schedule.xml12
-rwxr-xr-xconfig/sarg/sarg_sync.xml6
-rw-r--r--config/sarg/sarg_users.xml219
9 files changed, 380 insertions, 60 deletions
diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc
index a8749ef4..f8987ae7 100644
--- a/config/sarg/sarg.inc
+++ b/config/sarg/sarg.inc
@@ -130,11 +130,26 @@ function sync_package_sarg() {
conf_mount_rw();
if (!is_array($config['installedpackages']['sarg']['config']))
$config['installedpackages']['sarg']['config'][0]=array('report_options'=>'use_graphs,remove_temp_files,main_index,use_comma,date_time_by_bytes',
- 'user_sort_field'=>'BYTES',
'report_type'=>'topusers,topsites,sites_users,users_sites,date_time,denied,auth_failures,site_user_time_date,downloads',
'report_type'=>'u',
- 'report_charset'=>'UTF-8');
+ 'report_charset'=>'UTF-8',
+ 'topuser_num'=>'0',
+ 'authfail_report_limit'=>'0',
+ 'denied_report_limit'=>'0',
+ 'user_report_limit' =>'0',
+ 'lastlog'=> '0',
+ 'max_elapsed'=> '0');
$sarg=$config['installedpackages']['sarg']['config'][0];
+ if (!is_array($config['installedpackages']['sarguser']['config']))
+ $config['installedpackages']['sarguser']['config'][0]=array('user_sort_field'=>'BYTES',
+ 'exclude_userlist'=> $sarg['exclude_userlist'],
+ 'include_userlist'=> $sarg['include_userlist'],
+ 'usertab'=>$sarg['usertab'],
+ 'ldap_filter_search'=> '(uid=%s)',
+ 'ldap_target_attr'=> 'cn',
+ 'ldap_port'=> '389',
+ 'ntlm_user_format'=>'domainname+username');
+ $sarguser=$config['installedpackages']['sarguser']['config'][0];
switch ($sarg['proxy_server']){
case 'dansguardian':
$access_log= $sarg_proxy['dansguardian_log'];
@@ -158,7 +173,8 @@ function sync_package_sarg() {
log_error($error);
file_notice("Sarg", $error, "Sarg Settings", "");
}
-
+
+ #general tab
$graphs=(preg_match('/use_graphs/',$sarg['report_options'])?"yes":"no");
$anonymous_output_files=(preg_match('/anonymous_output_files/',$sarg['report_options'])?"yes":"no");
$resolve_ip=(preg_match('/resolve_ip/',$sarg['report_options'])?"yes":"no");
@@ -178,17 +194,43 @@ function sync_package_sarg() {
$date_format=(empty($sarg['report_date_format'])?"u":$sarg['report_date_format']);
$report_type=preg_replace('/,/',' ',$sarg['report_type']);
$report_charset=(empty($sarg['report_charset'])?"UTF-8":$sarg['report_charset']);
- if(!empty($sarg['include_userlist']))
- $include_users="$include_users ".$sarg['include_userlist'];
-
$exclude_string=(empty($sarg['exclude_string'])?"":'exclude_string"'.$sarg['exclude_string']."'");
- if(empty($sarg['usertab'])){
+
+ #limits
+ $max_elapsed=(empty($sarg['max_elapsed'])?"0":$sarg['max_elapsed']);
+ $lastlog=(empty($sarg['lastlog'])?"0":$sarg['lastlog']);
+ $topuser_num=(empty($sarg['topuser_num'])?"0":$sarg['topuser_num']);
+ $authfail_report_limit=(empty($sarg['authfail_report_limit'])?"0":$sarg['authfail_report_limit']);
+ $denied_report_limit=(empty($sarg['denied_report_limit'])?"0":$sarg['denied_report_limit']);
+ $report_limit=(empty($sarg['user_report_limit'])?"0":$sarg['user_report_limit']);
+ $user_report_limit = "siteusers_report_limit ".$report_limit."\n";
+ $user_report_limit .= "user_report_limit ".$report_limit."\n";
+ if(preg_match("/(squidguard|dansguardian)/",$sarg['proxy_server'])){
+ $user_report_limit .= $sarg['proxy_server']."_report_limit ".$report_limit."\n";
+ }
+
+ #user tab
+ $ntlm_user_format=(empty($sarguser['ntlm_user_format'])?'domainname+username':$sarguser['ntlm_user_format']);
+ if(!empty($sarguser['include_userlist']))
+ $include_users="$include_users ".$sarguser['include_userlist'];
+
+ if(empty($sarguser['usertab'])){
$usertab="none";
}
else{
$usertab="/usr/local/etc/sarg/usertab.conf";
- file_put_contents('/usr/local/etc/sarg/usertab.conf', sarg_text_area_decode($sarg['usertab']),LOCK_EX);
+ file_put_contents('/usr/local/etc/sarg/usertab.conf', sarg_text_area_decode($sarguser['usertab']),LOCK_EX);
}
+ if($sarguser['ldap_enable']){
+ $LDAPHost=(empty($sarguser['ldap_host'])?"":"LDAPHost ".$sarguser['ldap_host']);
+ $LDAPort=(empty($sarguser['ldap_port'])?"":"LDAPPort ".$sarguser['ldap_port']);
+ $LDAPBindDN=(empty($sarguser['ldap_bind_dn'])?"":"LDAPBindDN ".$sarguser['ldap_bind_dn']);
+ $LDAPBindPW=(empty($sarguser['ldap_bind_pw'])?"":"LDAPBindPW ".$sarguser['ldap_bind_pw']);
+ $LDAPBaseSearch=(empty($sarguser['ldap_base_search'])?"":"LDAPBaseSearch ".$sarguser['ldap_base_search']);
+ $LDAPTargetAttr=(empty($sarguser['ldap_target_Attr'])?"":"LDAPTargetAttr ".$sarguser['ldap_target_Attr']);
+ }
+
+ #dirs
$dirs=array("/usr/local/www/sarg-reports");
foreach ($dirs as $dir)
if (!is_dir($dir))
@@ -197,9 +239,10 @@ function sync_package_sarg() {
#create sarg config files
include("/usr/local/pkg/sarg.template");
file_put_contents("/usr/local/etc/sarg/sarg.conf", $sg, LOCK_EX);
- file_put_contents('/usr/local/etc/sarg/exclude_users.conf', sarg_text_area_decode($sarg['exclude_userlist']),LOCK_EX);
file_put_contents('/usr/local/etc/sarg/exclude_hosts.conf', sarg_text_area_decode($sarg['exclude_hostlist']),LOCK_EX);
file_put_contents('/usr/local/etc/sarg/exclude_codes.conf', sarg_text_area_decode($sarg['exclude_codelist']),LOCK_EX);
+ file_put_contents('/usr/local/etc/sarg/hostalias',sarg_text_area_decode($sarg['hostalias']),LOCK_EX);
+ file_put_contents('/usr/local/etc/sarg/exclude_users.conf', sarg_text_area_decode($sarguser['exclude_userlist']),LOCK_EX);
#check cron_tab
$new_cron=array();
diff --git a/config/sarg/sarg.template b/config/sarg/sarg.template
index 8f4a83f0..913dc892 100644
--- a/config/sarg/sarg.template
+++ b/config/sarg/sarg.template
@@ -182,13 +182,13 @@ user_ip {$user_ip}
# Sort field for the Topuser Report.
# Allowed fields: USER CONNECT BYTES TIME
#
-topuser_sort_field {$sarg['user_sort_field']} {$sort_order}
+topuser_sort_field {$sarguser['user_sort_field']} {$sort_order}
# TAG: user_sort_field field normal/reverse
# Sort field for the User Report.
# Allowed fields: SITE CONNECT BYTES TIME
#
-user_sort_field {$sarg['user_sort_field']} {$sort_order}
+user_sort_field {$sarguser['user_sort_field']} {$sort_order}
# TAG: exclude_users file
# users within the file will be excluded from reports.
@@ -216,6 +216,7 @@ exclude_hosts /usr/local/etc/sarg/exclude_hosts.conf
#
#date_format u
date_format {$date_format}
+
# TAG: per_user_limit file MB
# Saves userid on file if download exceed n MB.
# This option allow you to disable user access if user exceed a download limit.
@@ -228,6 +229,7 @@ date_format {$date_format}
# 0 - no limit.
#
#lastlog 0
+lastlog {$lastlog}
# TAG: remove_temp_files yes
# Remove temporary files: geral, usuarios, top, periodo from root report directory.
@@ -324,6 +326,7 @@ exclude_codes /usr/local/etc/sarg/exclude_codes
#
#max_elapsed 28800000
# 8 Hours
+max_elapsed {$max_elapsed}
# TAG: report_type type
# What kind of reports to generate.
@@ -368,26 +371,31 @@ usertab {$usertab}
# FQDN or IP address of host with LDAP service or AD DC
# default is '127.0.0.1'
#LDAPHost 127.0.0.1
+{$LDAPHost}
# TAG: LDAPPort port
# LDAP service port number
# default is '389'
#LDAPPort 389
+{$LDAPPort}
# TAG: LDAPBindDN CN=username,OU=group,DC=mydomain,DC=com
# DN of LDAP user, who is authorized to read user's names from LDAP base
# default is empty line
#LDAPBindDN cn=proxy,dc=mydomain,dc=local
+{$LDAPBindDN}
# TAG: LDAPBindPW secret
# Password of DN, who is authorized to read user's names from LDAP base
# default is empty line
#LDAPBindPW secret
+{$LDAPBindPW}
# TAG: LDAPBaseSearch OU=users,DC=mydomain,DC=com
# LDAP search base
# default is empty line
#LDAPBaseSearch ou=users,dc=mydomain,dc=local
+{$LDAPBaseSearch}
# TAG: LDAPFilterSearch (uid=%s)
# User search filter by user's logins in LDAP
@@ -396,11 +404,13 @@ usertab {$usertab}
# filter string can have up to 5 '%s' tags
# default value is '(uid=%s)'
#LDAPFilterSearch (uid=%s)
+{$LDAPFilterSearch}
# TAG: LDAPTargetAttr attributename
# Name of the attribute containing a name of the user
# default value is 'cn'
#LDAPTargetAttr cn
+{$LDAPTargetAttr}
# TAG: long_url yes|no
# If yes, the full url is showed in report.
@@ -495,6 +505,7 @@ bytes_in_sites_users_report {$bytes_in_sites_users_report}
# How many users in topsites report. 0 = no limit
#
#topuser_num 0
+topuser_num {$topuser_num}
# TAG: datafile file
# Save the report results in a file to populate some database
@@ -627,12 +638,15 @@ displayed_values {$displayed_values}
# '0' no limit
#
#authfail_report_limit 10
+authfail_report_limit {$authfail_report_limit}
#denied_report_limit 10
+denied_report_limit {$denied_report_limit}
#siteusers_report_limit 0
#squidguard_report_limit 10
#dansguardian_report_limit 10
#user_report_limit 10
#user_report_limit 50
+{$user_report_limit}
# TAG: www_document_root dir
# Where is your Web DocumentRoot
@@ -716,6 +730,7 @@ www_document_root /usr/local/www
# NTLM users format.
#
#ntlm_user_format domainname+username
+ntlm_user_format {$ntlm_user_format}
# TAG: realtime_refresh_time num sec
# How many time to auto refresh the realtime report
@@ -791,6 +806,6 @@ sorttable /sarg_sorttable.js
# *.freeav.net antivirus:freeav
# *.mail.live.com
# 65.52.00.00/14 *.mail.live.com
-#hostalias /usr/local/sarg/hostalias
+hostalias /usr/local/etc/sarg/hostalias
EOF;
?>
diff --git a/config/sarg/sarg.xml b/config/sarg/sarg.xml
index c1cf3fa2..f1ce5d93 100644
--- a/config/sarg/sarg.xml
+++ b/config/sarg/sarg.xml
@@ -68,6 +68,11 @@
<chmod>0755</chmod>
</additional_files_needed>
<additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/sarg/sarg_users.xml</item>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
<item>http://www.pfsense.org/packages/config/sarg/sarg_realtime.php</item>
<prefix>/usr/local/www/</prefix>
<chmod>0755</chmod>
@@ -109,11 +114,15 @@
</additional_files_needed>
<tabs>
<tab>
- <text>Settings</text>
+ <text>General</text>
<url>/pkg_edit.php?xml=sarg.xml&amp;id=0</url>
<active/>
</tab>
<tab>
+ <text>Users</text>
+ <url>/pkg_edit.php?xml=sarg_users.xml&amp;id=0</url>
+ </tab>
+ <tab>
<text>Schedule</text>
<url>/pkg.php?xml=sarg_schedule.xml&amp;id=0</url>
</tab>
@@ -136,7 +145,7 @@
</tabs>
<fields>
<field>
- <name>Log Settings</name>
+ <name>Report Settings</name>
<type>listtopic</type>
</field>
<field>
@@ -232,55 +241,74 @@
</options>
</field>
<field>
- <name>User Settings</name>
+ <fielddescr>Host Aliases</fielddescr>
+ <fieldname>hostalias</fieldname>
+ <description><![CDATA[The name of a text file containing the host names one per line and the optional alias to use in the report instead of that host name.<br>
+ Host names may contain up to one wildcard denoted by a *. The wildcard must not end the host name.<br>
+ The host name may be followed by an optional alias but if no alias is provided, the host name, including the wildcard, replaces any matching host name found in the log.<br>
+ Host names replaced by identical aliases are grouped together in the reports.<br>
+ IP addresses are supported and accept the CIDR notation both for IPv4 and IPv6 addresses.<br>
+ Sample:<br>
+ *.gstatic.com<br>
+ mt*.google.com<br>
+ *.myphone.microsoft.com<br>
+ *.myphone.microsoft.com:443 *.myphone.microsoft.com:secure<br>
+ *.freeav.net antivirus:freeav<br>
+ *.mail.live.com<br>
+ 65.52.00.00/14 *.mail.live.com]]></description>
+ <type>textarea</type>
+ <cols>70</cols>
+ <rows>10</rows>
+ <encoding>base64</encoding>
+ </field>
+ <field>
+ <name>Limit Settings</name>
<type>listtopic</type>
</field>
<field>
- <fielddescr>User Sort Field</fielddescr>
- <fieldname>user_sort_field</fieldname>
- <description><![CDATA[Sort field for the User Report.]]></description>
- <type>select</type>
- <options>
- <option><name>BYTES(default)</name><value>BYTES</value></option>
- <option><name>SITE normal</name><value>SITE</value></option>
- <option><name>CONNECT</name><value>CONNECT</value></option>
- <option><name>TIME</name><value>TIME</value></option>
- </options>
+ <fielddescr>Max Elapsed</fielddescr>
+ <fieldname>max_elapsed</fieldname>
+ <description><![CDATA[If elapsed time is recorded in log is greater than max_elapsed use 0 for elapsed time.<br>
+ Samples: 0 means no checking<br>
+ 28800000 means 08 hours ]]></description>
+ <type>input</type>
+ <size>10</size>
</field>
<field>
- <fielddescr>Exclude users</fielddescr>
- <fieldname>exclude_userlist</fieldname>
- <description><![CDATA[Users within the file will be excluded from reports.<br>
- You can use indexonly to have only index.html file.<br>
- <strong>Format: one user per line.</strong>]]></description>
- <type>textarea</type>
- <cols>70</cols>
- <rows>10</rows>
- <encoding>base64</encoding>
+ <fielddescr>Reports limits</fielddescr>
+ <fieldname>lastlog</fieldname>
+ <description><![CDATA[How many reports files must be keept in reports directory.<br>
+ The oldest report file will be automatically removed.0 means no limit.]]></description>
+ <type>input</type>
+ <size>10</size>
</field>
<field>
- <fielddescr>Include users</fielddescr>
- <fieldname>include_userlist</fieldname>
- <description><![CDATA[Reports will be generated only for listed users.<br>
- <strong>Format: user1:user2:...:usern</strong>]]></description>
- <type>input</type>
- <size>70</size>
+ <fielddescr>Top Users Limit</fielddescr>
+ <fieldname>topuser_num</fieldname>
+ <description><![CDATA[How many users in topsites report. 0 = no limit]]></description>
+ <type>input</type>
+ <size>10</size>
</field>
<field>
- <fielddescr>Users association</fielddescr>
- <fieldname>usertab</fieldname>
- <description><![CDATA[You can change the "userid" or the "ip address" to be a real user name on the reports.<br>
- If resolve_ip is active, the ip address is resolved before being looked up into this file.<br>
- That is, if you want to map the ip address, be sure to set resolv_ip to no or the resolved name will be looked into the file instead of the ip address.<br>
- Note that it can be used to resolve any ip address known to the dns and then map the unresolved ip addresses to a name found in the usertab file.<br>
- <strong>Table syntax: userid name or ip address name</strong><br>
- Eg:<br>SirIsaac Isaac Newton<br>
- vinci Leonardo da Vinci<br>
- 192.168.10.1 Karol Wojtyla]]></description>
- <type>textarea</type>
- <cols>70</cols>
- <rows>10</rows>
- <encoding>base64</encoding>
+ <fielddescr>Denied Limit</fielddescr>
+ <fieldname>denied_report_limit</fieldname>
+ <description><![CDATA[0 means no limit.]]></description>
+ <type>input</type>
+ <size>10</size>
+ </field>
+ <field>
+ <fielddescr>AuthFail Limit</fielddescr>
+ <fieldname>authfail_report_limit</fieldname>
+ <description><![CDATA[0 means no limit.]]></description>
+ <type>input</type>
+ <size>10</size>
+ </field>
+ <field>
+ <fielddescr>User_report_limit</fielddescr>
+ <fieldname>user_report_limit</fieldname>
+ <description><![CDATA[0 means no limit.]]></description>
+ <type>input</type>
+ <size>10</size>
</field>
<field>
<name>Exclude Settings</name>
diff --git a/config/sarg/sarg_about.php b/config/sarg/sarg_about.php
index 5b728a17..1321adf6 100755
--- a/config/sarg/sarg_about.php
+++ b/config/sarg/sarg_about.php
@@ -52,7 +52,8 @@ include("head.inc");
<tr><td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=sarg.xml&id=0");
+ $tab_array[] = array(gettext("General"), false, "/pkg_edit.php?xml=sarg.xml&id=0");
+ $tab_array[] = array(gettext("Users"), false, "/pkg_edit.php?xml=sarg_users.xml&id=0");
$tab_array[] = array(gettext("Schedule"), false, "/pkg.php?xml=sarg_schedule.xml");
$tab_array[] = array(gettext("View Report"), false, "/sarg_reports.php");
$tab_array[] = array(gettext("Realtime"), false, "/sarg_realtime.php");
diff --git a/config/sarg/sarg_realtime.php b/config/sarg/sarg_realtime.php
index ced24376..0b8b2cc5 100755
--- a/config/sarg/sarg_realtime.php
+++ b/config/sarg/sarg_realtime.php
@@ -111,7 +111,8 @@ else{
<tr><td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=sarg.xml&id=0");
+ $tab_array[] = array(gettext("General"), false, "/pkg_edit.php?xml=sarg.xml&id=0");
+ $tab_array[] = array(gettext("Users"), false, "/pkg_edit.php?xml=sarg_users.xml&id=0");
$tab_array[] = array(gettext("Schedule"), false, "/pkg.php?xml=sarg_schedule.xml");
$tab_array[] = array(gettext("View Report"), false, "/sarg_reports.php");
$tab_array[] = array(gettext("Realtime"), true, "/sarg_realtime.php");
diff --git a/config/sarg/sarg_reports.php b/config/sarg/sarg_reports.php
index bad7ba05..7348ebcf 100755
--- a/config/sarg/sarg_reports.php
+++ b/config/sarg/sarg_reports.php
@@ -53,7 +53,8 @@ require("guiconfig.inc");
<tr><td>
<?php
$tab_array = array();
- $tab_array[] = array(gettext("Settings"), false, "/pkg_edit.php?xml=sarg.xml&id=0");
+ $tab_array[] = array(gettext("General"), false, "/pkg_edit.php?xml=sarg.xml&id=0");
+ $tab_array[] = array(gettext("Users"), false, "/pkg_edit.php?xml=sarg_users.xml&id=0");
$tab_array[] = array(gettext("Schedule"), false, "/pkg.php?xml=sarg_schedule.xml");
$tab_array[] = array(gettext("View Report"), true, "/sarg_reports.php");
$tab_array[] = array(gettext("Realtime"), false, "/sarg_realtime.php");
diff --git a/config/sarg/sarg_schedule.xml b/config/sarg/sarg_schedule.xml
index e6d06b9c..32d43b77 100644
--- a/config/sarg/sarg_schedule.xml
+++ b/config/sarg/sarg_schedule.xml
@@ -62,10 +62,14 @@
</menu>
<tabs>
<tab>
- <text>Settings</text>
+ <text>General</text>
<url>/pkg_edit.php?xml=sarg.xml&amp;id=0</url>
</tab>
<tab>
+ <text>Users</text>
+ <url>/pkg_edit.php?xml=sarg_users.xml&amp;id=0</url>
+ </tab>
+ <tab>
<text>Schedule</text>
<url>/pkg.php?xml=sarg_schedule.xml&amp;id=0</url>
<active/>
@@ -97,10 +101,14 @@
<fieldname>frequency</fieldname>
</columnitem>
<columnitem>
- <fielddescr>args</fielddescr>
+ <fielddescr>Aditional Args</fielddescr>
<fieldname>mod</fieldname>
</columnitem>
<columnitem>
+ <fielddescr>Post Action</fielddescr>
+ <fieldname>action</fieldname>
+ </columnitem>
+ <columnitem>
<fielddescr>Description</fielddescr>
<fieldname>description</fieldname>
</columnitem>
diff --git a/config/sarg/sarg_sync.xml b/config/sarg/sarg_sync.xml
index f3d2ac79..6c81b3f8 100755
--- a/config/sarg/sarg_sync.xml
+++ b/config/sarg/sarg_sync.xml
@@ -47,10 +47,14 @@
<include_file>/usr/local/pkg/sarg.inc</include_file>
<tabs>
<tab>
- <text>Settings</text>
+ <text>General</text>
<url>/pkg_edit.php?xml=sarg.xml&amp;id=0</url>
</tab>
<tab>
+ <text>Users</text>
+ <url>/pkg_edit.php?xml=sarg_users.xml&amp;id=0</url>
+ </tab>
+ <tab>
<text>Schedule</text>
<url>/pkg.php?xml=sarg_schedule.xml&amp;id=0</url>
</tab>
diff --git a/config/sarg/sarg_users.xml b/config/sarg/sarg_users.xml
new file mode 100644
index 00000000..7019af43
--- /dev/null
+++ b/config/sarg/sarg_users.xml
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ sarg_users.xml
+ part of the sarg for pfSense
+ Copyright (C) 2012 Marcello Coutinho
+
+ All rights reserved.
+ */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>Describe your package here</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>sarguser</name>
+ <version>1.0</version>
+ <title>Status: Sarg User Settings</title>
+ <include_file>/usr/local/pkg/sarg.inc</include_file>
+ <tabs>
+ <tab>
+ <text>General</text>
+ <url>/pkg_edit.php?xml=sarg.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Users</text>
+ <url>/pkg_edit.php?xml=sarg_users.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ <tab>
+ <text>Schedule</text>
+ <url>/pkg.php?xml=sarg_schedule.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>View Report</text>
+ <url>/sarg_reports.php</url>
+ </tab>
+ <tab>
+ <text>Realtime</text>
+ <url>/sarg_realtime.php</url>
+ </tab>
+ <tab>
+ <text>XMLRPC Sync</text>
+ <url>/pkg_edit.php?xml=sarg_sync.xml&amp;id=0</url>
+ </tab>
+ <tab>
+ <text>Help</text>
+ <url>/sarg_about.php</url>
+ </tab>
+</tabs>
+ <fields>
+ <field>
+ <name>User Settings</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>User Sort Field</fielddescr>
+ <fieldname>user_sort_field</fieldname>
+ <description><![CDATA[Sort field for the User Report.]]></description>
+ <type>select</type>
+ <options>
+ <option><name>BYTES(default)</name><value>BYTES</value></option>
+ <option><name>SITE normal</name><value>SITE</value></option>
+ <option><name>CONNECT</name><value>CONNECT</value></option>
+ <option><name>TIME</name><value>TIME</value></option>
+ </options>
+ </field>
+ <field>
+ <fielddescr>Ntlm User Format</fielddescr>
+ <fieldname>ntlm_user_format</fieldname>
+ <description><![CDATA[NTLM users format]]></description>
+ <type>select</type>
+ <options>
+ <option><name>domainname+username (default)</name><value>domainname+username</value></option>
+ <option><name>username</name><value>username</value></option>
+ </options>
+ </field>
+ <field>
+ <fielddescr>Exclude users</fielddescr>
+ <fieldname>exclude_userlist</fieldname>
+ <description><![CDATA[Users within the file will be excluded from reports.<br>
+ You can use indexonly to have only index.html file.<br>
+ <strong>Format: one user per line.</strong>]]></description>
+ <type>textarea</type>
+ <cols>70</cols>
+ <rows>10</rows>
+ <encoding>base64</encoding>
+ </field>
+ <field>
+ <fielddescr>Include users</fielddescr>
+ <fieldname>include_userlist</fieldname>
+ <description><![CDATA[Reports will be generated only for listed users.<br>
+ <strong>Format: user1:user2:...:usern</strong>]]></description>
+ <type>input</type>
+ <size>70</size>
+ </field>
+ <field>
+ <fielddescr>Users association</fielddescr>
+ <fieldname>usertab</fieldname>
+ <description><![CDATA[You can change the "userid" or the "ip address" to be a real user name on the reports.<br>
+ If resolve_ip is active, the ip address is resolved before being looked up into this file.<br>
+ That is, if you want to map the ip address, be sure to set resolv_ip to no or the resolved name will be looked into the file instead of the ip address.<br>
+ Note that it can be used to resolve any ip address known to the dns and then map the unresolved ip addresses to a name found in the usertab file.<br>
+ <strong>Table syntax: userid name or ip address name</strong><br>
+ Eg:<br>SirIsaac Isaac Newton<br>
+ vinci Leonardo da Vinci<br>
+ 192.168.10.1 Karol Wojtyla]]></description>
+ <type>textarea</type>
+ <cols>70</cols>
+ <rows>10</rows>
+ <encoding>base64</encoding>
+ </field>
+ <field>
+ <name>Ldap Settings</name>
+ <type>listtopic</type>
+ </field>
+ <field>
+ <fielddescr>Enable LDAP search</fielddescr>
+ <fieldname>ldap_enable</fieldname>
+ <description><![CDATA[Enable LDAP search for username replacement based on active directory info.<br>
+ This option is usefull to show full usernames in sarg reports instead of user logins.]]></description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>LDAP Hostname</fielddescr>
+ <fieldname>ldap_host</fieldname>
+ <description><![CDATA[FQDN or IP address of host with LDAP service or AD DC]]></description>
+ <type>input</type>
+ <size>60</size>
+ </field>
+ <field>
+ <fielddescr>LDAP Port</fielddescr>
+ <fieldname>ldap_port</fieldname>
+ <description><![CDATA[LDAP service port number.<br>Default is 389]]></description>
+ <type>input</type>
+ <size>10</size>
+ </field>
+ <field>
+ <fielddescr>LDAP Bind DN</fielddescr>
+ <fieldname>ldap_bind_dn</fieldname>
+ <description><![CDATA[DN of LDAP user, who is authorized to read user's names from LDAP base.<br>
+ Sample: CN=username,OU=group,DC=mydomain,DC=com<br>]]></description>
+ <type>input</type>
+ <size>60</size>
+ </field>
+ <field>
+ <fielddescr>LDAP Bind Password</fielddescr>
+ <fieldname>ldap_bind_pw</fieldname>
+ <description><![CDATA[LDAPBindPW secret Password of DN, who is authorized to read user's names from LDAP base.]]></description>
+ <type>password</type>
+ <size>10</size>
+ </field>
+ <field>
+ <fielddescr>LDAP Base Search</fielddescr>
+ <fieldname>ldap_base_search</fieldname>
+ <description><![CDATA[LDAP search base.<br>
+ Sample: OU=users,DC=mydomain,DC=com]]></description>
+ <type>input</type>
+ <size>60</size>
+ </field>
+ <field>
+ <fielddescr>LDAP filter Search</fielddescr>
+ <fieldname>ldap_filter_search</fieldname>
+ <description><![CDATA[LDAPFilterSearch (uid=%s)<br>
+ User search filter by user's logins in LDAP. First founded record will be used.<br>
+ %s - will be changed to userlogins from access.log file filter string can have up to 5 '%s' tags.<br>
+ Default value is '(uid=%s)']]></description>
+ <type>input</type>
+ <size>60</size>
+ </field>
+ <field>
+ <fielddescr>LDAP Target Attribute</fielddescr>
+ <fieldname>ldap_target_attr</fieldname>
+ <description><![CDATA[Name of the attribute containing a name of the user<br>
+ Default value is 'cn']]></description>
+ <type>input</type>
+ <size>60</size>
+ </field>
+ </fields>
+ <custom_php_install_command>
+ </custom_php_install_command>
+ <custom_php_deinstall_command>
+ </custom_php_deinstall_command>
+ <custom_php_validation_command>
+ sarg_validate_input($_POST, &amp;$input_errors);
+ </custom_php_validation_command>
+ <custom_php_resync_config_command>
+ sync_package_sarg();
+ </custom_php_resync_config_command>
+</packagegui>