diff --git a/RELEASE b/RELEASE
index 3a4078425..1cddf8ee0 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-0.4.6 rev 2939
+0.4.7 rev 3042
diff --git a/api/apiloader.php b/api/apiloader.php
index 492d7f5bc..8186d418a 100644
--- a/api/apiloader.php
+++ b/api/apiloader.php
@@ -34,6 +34,7 @@
include('api/libs/api.ubim.php');
include('api/libs/api.snmp.php');
include('api/libs/api.mikrotik.php');
+include('api/libs/api.watchdog.php');
/*
* Initial class creation
diff --git a/api/libs/api.address.php b/api/libs/api.address.php
index 5036fb650..36557ae28 100644
--- a/api/libs/api.address.php
+++ b/api/libs/api.address.php
@@ -388,7 +388,7 @@ function web_CitySelectorAc() {
$selector.=''.$eachcity['cityname'].' ';
}
}
- $selector.=' '. web_city_icon().' ';
+ $selector.=' '. web_city_icon().' ';
return ($selector);
}
@@ -414,7 +414,7 @@ function web_StreetSelectorAc($cityid) {
$selector.=''.$eachstreet['streetname'].' ';
}
}
- $selector.=' '. web_street_icon().' ';
+ $selector.=' '. web_street_icon().' ';
return ($selector);
}
@@ -439,7 +439,7 @@ function web_BuildSelectorAc($streetid) {
$selector.=''.$eachbuild['buildnum'].' ';
}
}
- $selector.=' '. web_build_icon().' ';
+ $selector.=' '. web_build_icon().' ';
return ($selector);
}
diff --git a/api/libs/api.cess.php b/api/libs/api.cess.php
index 6611b9c03..40dc05422 100644
--- a/api/libs/api.cess.php
+++ b/api/libs/api.cess.php
@@ -779,4 +779,19 @@ function web_NdsPaymentsShowYear($year) {
show_window(__('Payments by').' '.$year, $result);
}
+ function zb_RegContrAhentSelect($name,$selected='') {
+ $allagents=zb_ContrAhentGetAllData();
+ $agentArr=array();
+
+ $select='';
+ if (!empty ($allagents)) {
+ foreach ($allagents as $io=>$eachagent) {
+ $agentArr[$eachagent['id']]=$eachagent['contrname'];
+ }
+
+ }
+ $select= wf_Selector($name, $agentArr, '', $selected, false);
+ return($select);
+ }
+
?>
\ No newline at end of file
diff --git a/api/libs/api.compat.php b/api/libs/api.compat.php
index 07cda58d4..5a8714054 100755
--- a/api/libs/api.compat.php
+++ b/api/libs/api.compat.php
@@ -68,6 +68,12 @@ function curmonth() {
return($currentmonth);
}
+//returns previous month in mysql DATETIME view
+function prevmonth() {
+ $result=date("Y-m", strtotime("-1 months"));
+ return ($result);
+}
+
//returns current year
function curyear() {
$currentyear=date("Y");
diff --git a/api/libs/api.networking.php b/api/libs/api.networking.php
index 66bfbd67b..1549e88d5 100755
--- a/api/libs/api.networking.php
+++ b/api/libs/api.networking.php
@@ -493,16 +493,30 @@ function handle_dhcp_rebuild_option82($netid,$confname) {
foreach ($allhosts as $io=>$eachhost) {
$dhcphostname='m'. str_replace('.', 'x', $eachhost['ip']);
$options=explode('|',$eachhost['option']);
- $result.='
- class "'.$dhcphostname.'" {
- match if binary-to-ascii (10, 8, "", option agent.remote-id) = "'.$options[0].'" and binary-to-ascii (10, 8, "", option agent.circuit-id) = "'.$options[1].' ";
- }
+ $customTemplate= file_get_contents(CONFIG_PATH."dhcp/option82.template");
+ if (empty($customTemplate)) {
+ $customTemplate='
+ class "{HOSTNAME}" {
+ match if binary-to-ascii (16, 8, "", option agent.remote-id) = "{REMOTEID}" and binary-to-ascii (10, 8, "", option agent.circuit-id) = "{CIRCUITID}";
+ }
+
+ pool {
+ range {IP};
+ allow members of "{HOSTNAME}";
+ }
+ '."\n";
+ }
+
+ if (isset($options[1])) {
+ $parseTemplate=$customTemplate;
+ $parseTemplate=str_ireplace('{HOSTNAME}', $dhcphostname, $parseTemplate);
+ $parseTemplate=str_ireplace('{REMOTEID}', $options[0], $parseTemplate);
+ $parseTemplate=str_ireplace('{CIRCUITID}', $options[1], $parseTemplate);
+ $parseTemplate=str_ireplace('{IP}', $eachhost['ip'], $parseTemplate);
- pool {
- range '.$eachhost['ip'].';
- allow members of "'.$dhcphostname.'";
- }
- '."\n";
+ $result.=$parseTemplate;
+ }
+
}
file_put_contents($confpath, $result);
@@ -567,6 +581,16 @@ function multinet_rebuild_globalconf() {
$subnets_template=file_get_contents("config/dhcp/subnets.template");
$alldhcpsubnets_q="SELECT `id`,`netid` from `dhcp` ORDER BY `id` ASC";
$alldhcpsubnets=simple_queryall($alldhcpsubnets_q);
+ $allMembers_q="SELECT `ip` from `nethosts` WHERE `option` != 'NULL'";
+ $allMembers= simple_queryall($allMembers_q);
+ $membersMacroContent='';
+ if (!empty($allMembers)) {
+ foreach ($allMembers as $ix=>$eachMember) {
+ $memberClass='m'.str_replace('.', 'x', $eachMember['ip']);;
+ $membersMacroContent.='deny members of "'.$memberClass.'";'."\n";
+ }
+ }
+
$subnets='';
if (!empty ($alldhcpsubnets)) {
foreach ($alldhcpsubnets as $io=>$eachnet) {
@@ -593,6 +617,7 @@ function multinet_rebuild_globalconf() {
}
$globdata['{SUBNETS}']=$subnets;
+ $globdata['{DENYMEMBERS}']=$membersMacroContent;
$globconf=multinet_ParseTemplate($global_template,$globdata);
file_write_contents("multinet/dhcpd.conf", $globconf);
}
diff --git a/api/libs/api.userreg.php b/api/libs/api.userreg.php
index b6444a67f..1c786b250 100755
--- a/api/libs/api.userreg.php
+++ b/api/libs/api.userreg.php
@@ -10,6 +10,7 @@ function zb_rand_string($size=4) {
return ($string);
}
+
function zb_rand_digits($size=4) {
$characters = '0123456789';
$string = "";
@@ -74,6 +75,7 @@ function checkapt()
return ($result);
}
+
function web_UserRegFormLocation() {
$aptsel='';
@@ -97,11 +99,22 @@ function web_UserRegFormLocation() {
}
if (isset($_POST['buildsel'])) {
+ $submit_btn='';
$builddata=zb_AddressGetBuildData($_POST['buildsel']);
$buildsel=$builddata['buildnum'].' ';
$aptsel=web_AddressBuildShowAptsCheck($builddata['id']).web_AptCreateForm();
$servicesel=multinet_service_selector();
- $submit_btn='
+ //contrahens user diff
+ $alter_conf= rcms_parse_ini_file(CONFIG_PATH."alter.ini");
+ if (isset($alter_conf['LOGIN_GENERATION'])) {
+ if ($alter_conf['LOGIN_GENERATION']=='DEREBAN') {
+ $agentCells=wf_TableCell(zb_RegContrAhentSelect('regagent', $alter_conf['DEFAULT_ASSIGN_AGENT']));
+ $agentCells.=wf_TableCell(__('Contrahent name'));
+ $submit_btn.=wf_TableRow($agentCells, 'row2');
+
+ }
+ }
+ $submit_btn.='
@@ -130,6 +143,7 @@ function web_UserRegFormLocation() {
'.$servicesel.' '.__('Service').'
+
'.$submit_btn.'
@@ -150,7 +164,7 @@ function zb_AllBusyLogins() {
return ($result);
}
-function zb_RegLoginProposal($cityalias,$streetalias,$buildnum,$apt,$ip_proposal) {
+function zb_RegLoginProposal($cityalias,$streetalias,$buildnum,$apt,$ip_proposal,$agentid='') {
$alterconf=rcms_parse_ini_file(CONFIG_PATH."alter.ini");
$result='';
if (isset($alterconf['LOGIN_GENERATION'])) {
@@ -185,24 +199,29 @@ function zb_RegLoginProposal($cityalias,$streetalias,$buildnum,$apt,$ip_proposal
}
}
}
-
- //use five five digits increment
+
+ //use five five digits increment with zero prefix
if ($type=='INCREMENTFIVE') {
$busylogins=zb_AllBusyLogins();
- $prefix='';
-
+ $prefixSize=5;
for ($i=1;$i<100000;$i++) {
-
- if ($i<10000) { $prefix='0'; }
-
- if ($i<1000) { $prefix='00'; }
-
- if ($i<100) { $prefix='000'; }
-
- if ($i<10) { $prefix='0000'; }
-
- if (!isset($busylogins[$prefix.$i])) {
- $result=$prefix.$i;
+ $nextIncrementFiveProposal=sprintf('%0'.$prefixSize.'d', $i);
+ if (!isset($busylogins[$nextIncrementFiveProposal])) {
+ $result=$nextIncrementFiveProposal;
+ break;
+ }
+ }
+
+ }
+
+ //use five six digits increment with zero prefix
+ if ($type=='INCREMENTSIX') {
+ $busylogins=zb_AllBusyLogins();
+ $prefixSize=6;
+ for ($i=1;$i<1000000;$i++) {
+ $nextIncrementFiveProposal=sprintf('%0'.$prefixSize.'d', $i);
+ if (!isset($busylogins[$nextIncrementFiveProposal])) {
+ $result=$nextIncrementFiveProposal;
break;
}
}
@@ -212,21 +231,13 @@ function zb_RegLoginProposal($cityalias,$streetalias,$buildnum,$apt,$ip_proposal
//use five five digits increment
if ($type=='INCREMENTFIVEREV') {
$busylogins=zb_AllBusyLogins();
- $prefix='';
-
+ $prefixSize=5;
for ($i=1;$i<100000;$i++) {
- if ($i<10000) { $prefix='0'; }
-
- if ($i<1000) { $prefix='00'; }
-
- if ($i<100) { $prefix='000'; }
-
- if ($i<10) { $prefix='0000'; }
-
- if (!isset($busylogins[$i.$prefix])) {
- $result=$prefix.$i;
- $result= strrev($result);
+ $nextIncrementFiveRevProposal=sprintf('%0'.$prefixSize.'d', $i);
+ $nextIncrementFiveRevProposal= strrev($nextIncrementFiveRevProposal);
+ if (!isset($busylogins[$nextIncrementFiveRevProposal])) {
+ $result=$nextIncrementFiveRevProposal;
break;
}
}
@@ -255,6 +266,20 @@ function zb_RegLoginProposal($cityalias,$streetalias,$buildnum,$apt,$ip_proposal
$result=zb_rand_string(10);
}
+ //contrahent based model
+ if ($type=='DEREBAN') {
+ $busylogins=zb_AllBusyLogins();
+ $agentPrefix=$agentid;
+ $prefixSize=6;
+ for ($i=1;$i<1000000;$i++) {
+ $nextIncrementDerProposal=$agentPrefix.sprintf('%0'.$prefixSize.'d', $i);
+ if (!isset($busylogins[$nextIncrementDerProposal])) {
+ $result=$nextIncrementDerProposal;
+ break;
+ }
+ }
+ }
+
///// if wrong option - use DEFAULT
if (empty($result)) {
@@ -298,9 +323,19 @@ function web_UserRegFormNetData($newuser_data) {
$newuser_data['apt']=0;
}
$apt=zb_TranslitString($newuser_data['apt']);
+//assign some agent from previously selected form
+if (isset($alterconf['LOGIN_GENERATION'])) {
+ if ($alterconf['LOGIN_GENERATION']=='DEREBAN') {
+ $agentPrefixID=$newuser_data['contrahent'];
+ } else {
+ $agentPrefixID='';
+ }
+} else {
+ $agentPrefixID='';
+}
$ip_proposal=multinet_get_next_freeip('nethosts', 'ip', multinet_get_service_networkid($newuser_data['service']));
-$login_proposal= zb_RegLoginProposal($cityalias, $streetalias, $buildnum, $apt, $ip_proposal);
+$login_proposal= zb_RegLoginProposal($cityalias, $streetalias, $buildnum, $apt, $ip_proposal,$agentPrefixID);
$password_proposal= zb_RegPasswordProposal();
@@ -472,6 +507,7 @@ function zb_UserRegister($user_data,$goprofile=true) {
zb_UserRegisterLog($login);
// if random mac needed
$billingconf=rcms_parse_ini_file(CONFIG_PATH.'/billing.ini');
+ $alterconf= rcms_parse_ini_file(CONFIG_PATH."alter.ini");
if ($billingconf['REGRANDOM_MAC']) {
// funny random mac, yeah? :)
$mac='14:'.'88'.':'.rand(10,99).':'.rand(10,99).':'.rand(10,99).':'.rand(10,99);
@@ -491,6 +527,14 @@ function zb_UserRegister($user_data,$goprofile=true) {
$billing->setdstat($login,$dstat);
log_register('CHANGE dstat ('.$login.') ON '.$dstat);
}
+
+ //set contract same as login for this user
+ if (isset($alterconf['CONTRACT_SAME_AS_LOGIN'])) {
+ if ($alterconf['CONTRACT_SAME_AS_LOGIN']) {
+ $newUserContract=$login;
+ zb_UserChangeContract($login, $newUserContract);
+ }
+ }
///////////////////////////////////
if ($goprofile) {
diff --git a/api/libs/api.watchdog.php b/api/libs/api.watchdog.php
new file mode 100644
index 000000000..d20471b1a
--- /dev/null
+++ b/api/libs/api.watchdog.php
@@ -0,0 +1,1013 @@
+loadTasks();
+
+ //get all previous polling results
+ $this->loadOldResults();
+
+ //load watchdog settings from database
+ $this->loadSettings();
+ }
+
+ /*
+ * Returns current watchdog settings
+ *
+ * @return array
+ */
+
+ public function getSettings() {
+ $result = $this->settings;
+ return ($result);
+ }
+
+ /*
+ * Loads all previous tasks execution results into private property oldResults
+ *
+ * @return void
+ */
+
+ private function loadOldResults() {
+ if (!empty($this->taskData)) {
+ foreach ($this->taskData as $iy => $eachPrevResult) {
+ $this->oldResults[$eachPrevResult['id']] = $eachPrevResult['oldresult'];
+ }
+ }
+ }
+
+ /*
+ * Loads an active task list from database and pushes it into private property taskData
+ *
+ * @return void
+ */
+
+ private function loadTasks() {
+ $taskQuery = "SELECT * from `watchdog` WHERE `active`='1';";
+ $alltasks = simple_queryall($taskQuery);
+ if (!empty($alltasks)) {
+ foreach ($alltasks as $iz => $eachTask) {
+ $this->taskData[$eachTask['id']]['id'] = $eachTask['id'];
+ $this->taskData[$eachTask['id']]['active'] = $eachTask['active'];
+ $this->taskData[$eachTask['id']]['name'] = $eachTask['name'];
+ $this->taskData[$eachTask['id']]['checktype'] = $eachTask['checktype'];
+ $this->taskData[$eachTask['id']]['param'] = $eachTask['param'];
+ $this->taskData[$eachTask['id']]['operator'] = $eachTask['operator'];
+ $this->taskData[$eachTask['id']]['condition'] = $eachTask['condition'];
+ $this->taskData[$eachTask['id']]['action'] = $eachTask['action'];
+ $this->taskData[$eachTask['id']]['oldresult'] = $eachTask['oldresult'];
+ }
+ }
+ }
+
+ /*
+ * Gets watchdog settings from database and load it into settings property
+ *
+ * @return void
+ */
+
+ private function loadSettings() {
+ $alert = zb_StorageGet('WATCHDOG_ALERT');
+ $phones = zb_StorageGet('WATCHDOG_PHONES');
+ $emails = zb_StorageGet('WATCHDOG_EMAILS');
+ $smsgateway = zb_StorageGet('WATCHDOG_TSMS_GATEWAY');
+ $smslogin = zb_StorageGet('WATCHDOG_TSMS_LOGIN');
+ $smspassword = zb_StorageGet('WATCHDOG_TSMS_PASSWORD');
+ $smssign=zb_StorageGet('WATCHDOG_TSMS_SIGN');
+
+ $this->settings['WATCHDOG_ALERT'] = $alert;
+ $this->settings['WATCHDOG_PHONES'] = $phones;
+ $this->settings['WATCHDOG_EMAILS'] = $emails;
+ $this->settings['WATCHDOG_TSMS_GATEWAY'] = $smsgateway;
+ $this->settings['WATCHDOG_TSMS_LOGIN'] = $smslogin;
+ $this->settings['WATCHDOG_TSMS_PASSWORD'] = $smspassword;
+ $this->settings['WATCHDOG_TSMS_SIGN'] = $smssign;
+
+ if (empty($this->settings['WATCHDOG_ALERT'])) {
+ throw new Exception (self::SETTINGS_EX);
+ }
+ }
+
+ /*
+ * stores sms for deffered sending via TurboSMS
+ *
+ * @param number - number to send sms in internaitional format
+ * @message - text message in utf8 encoding
+ *
+ * @return array
+ */
+ public function sendSMS($number,$message) {
+ $filename='content/tsms/wd_'.zb_rand_string(8);
+ $storedata='NUMBER="'.$this->safeEscapeString($number).'"'."\n";
+ $storedata.='MESSAGE="'.$this->safeEscapeString($message).'"'."\n";
+ file_put_contents($filename, $storedata);
+ log_register("WATCHDOG SEND SMS `".$number."`");
+ }
+
+ /*
+ * sends all sms from local storage
+ *
+ * @return void
+ */
+ public function backgroundSMSProcessing() {
+ $smsPath='content/tsms/';
+ $tsms_host = $this->settings['WATCHDOG_TSMS_GATEWAY'];
+ $tsms_db = 'users';
+ $tsms_login = $this->settings['WATCHDOG_TSMS_LOGIN'];
+ $tsms_password = $this->settings['WATCHDOG_TSMS_PASSWORD'];
+ $tsms_table = $this->settings['WATCHDOG_TSMS_LOGIN'];
+ $sign= $this->safeEscapeString($this->settings['WATCHDOG_TSMS_SIGN']);
+ $result = array();
+ //time shift settings
+ $timezone='2';
+ $tz_offset=(2-$timezone)*3600;
+ $date=date("Y-m-d H:i:s",time()+$tz_offset);
+
+ $allSmsStore= rcms_scandir($smsPath);
+ if (!empty($allSmsStore)) {
+ //open new database connection
+ $TsmsDB = new DbConnect($tsms_host, $tsms_login, $tsms_password, $tsms_db, $error_reporting = true, $persistent = false);
+ $TsmsDB->open() or die($TsmsDB->error());
+ $TsmsDB->query('SET NAMES utf8;');
+ foreach ($allSmsStore as $eachfile) {
+ $fileData= rcms_parse_ini_file($smsPath.$eachfile);
+ if ((isset($fileData['NUMBER'])) AND (isset($fileData['MESSAGE']))) {
+ $query="
+ INSERT INTO `".$tsms_table."`
+ ( `number`, `sign`, `message`, `wappush`, `send_time`)
+ VALUES
+ ('".$fileData['NUMBER']."', '".$sign."', '".$fileData['MESSAGE']."', '', '".$date."');
+ ";
+
+ //push new sms to database
+ $TsmsDB->query($query);
+
+ while ($row = $TsmsDB->fetchassoc()) {
+ $result[] = $row;
+ }
+ }
+ //remove old send task
+ unlink($smsPath.$eachfile);
+ }
+ //close old datalink
+ $TsmsDB->close();
+ }
+ return ($result);
+ }
+
+ /*
+ * sends email notification
+ *
+ * @param $email - target email
+ * @param $message - message
+ *
+ * @return void
+ */
+ private function sendEmail($email,$message) {
+ $sender=__('Watchdog');
+ $subj='Ubilling '.__('Watchdog');
+ $message.=' '.date("Y-m-d H:i:s");
+ $headers = 'From: =?UTF-8?B?' . base64_encode($sender) . '?= <' . $email . ">\n";
+ $headers .= "MIME-Version: 1.0\n";
+ $headers .= 'Message-ID: <' . md5(uniqid(time())) . "@" . $sender . ">\n";
+ $headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\n";
+ $headers .= "Content-type: text/plain; charset=UTF-8\n";
+ $headers .= "Content-transfer-encoding: 8bit\n";
+ $headers .= "X-Mailer: Ubilling\n";
+ $headers .= "X-MimeOLE: Ubilling\n";
+ mail($email, '=?UTF-8?B?' . base64_encode($subj). '?=', $message, $headers);
+ log_register("WATCHDOG SEND EMAIL `".$email."`");
+ }
+
+ /*
+ * ugly hack to dirty input data filtering in php 5.4 with multiple DB links
+ *
+ * @param $string - string to filter
+ *
+ * @return string
+ */
+ private function safeEscapeString($string) {
+ @$result=preg_replace("#[~@\?\%\/\;=\*\>\<\"\']#Uis",'',$string);;
+ return ($result);
+ }
+
+ /*
+ * Updates previous poll data in database
+ *
+ * @param $taskID - watchdog task id
+ * @param $value - data to set as oldresult
+ *
+ * @return void
+ */
+
+ private function setOldValue($taskID, $value) {
+ simple_update_field('watchdog', 'oldresult', $value, "WHERE `id`='" . $taskID . "'");
+ }
+
+ /*
+ * Execute some action for task
+ *
+ * @param $taskID - id of existing monitoring task to run
+ *
+ * @return mixed
+ */
+
+ private function doAction($taskID = NULL) {
+ if (!empty($taskID)) {
+ switch ($this->taskData[$taskID]['checktype']) {
+ //do the system icmp ping
+ case 'icmpping':
+ if (!empty($this->taskData[$taskID]['param'])) {
+ $result = zb_PingICMP($this->taskData[$taskID]['param']);
+ $storeValue = ($result) ? 'true' : 'false';
+ $this->setOldValue($taskID, $storeValue);
+ } else {
+ throw new Exception(self::PARAM_EX . "ICMPPING");
+ }
+
+ break;
+ //run some script
+ case 'script':
+ if (!empty($this->taskData[$taskID]['param'])) {
+ $command = $this->taskData[$taskID]['param'];
+ $result = shell_exec($command);
+ $this->setOldValue($taskID, $result);
+ } else {
+ throw new Exception(self::PARAM_EX . "SCRIPT");
+ }
+ break;
+ //do the tcp ping via some port
+ case 'tcpping':
+ if (!empty($this->taskData[$taskID]['param'])) {
+ if (ispos($this->taskData[$taskID]['param'], ':')) {
+ $tcpPingData = explode(':', $this->taskData[$taskID]['param']);
+ $tcpPingHost = $tcpPingData[0];
+ $tcpPingPort = $tcpPingData[1];
+ $tcpPingTimeout = 2;
+ @$connection = fsockopen($tcpPingHost, $tcpPingPort, $tcperrno, $tcperrstr, $tcpPingTimeout);
+ if (!$connection) {
+ $result = false;
+ } else {
+ $result = true;
+ }
+ $storeValue = ($result) ? 'true' : 'false';
+ $this->setOldValue($taskID, $storeValue);
+ } else {
+ throw new Exception(self::PARAMFMT_EX . "TCPPING");
+ }
+ } else {
+ throw new Exception(self::PARAM_EX . "TCPPING");
+ }
+ break;
+ // gets some user traffic by his login
+ case 'getusertraff':
+ if (!empty($this->taskData[$taskID]['param'])) {
+ $userLoging = mysql_real_escape_string($this->taskData[$taskID]['param']);
+ $traffQuery = "SELECT SUM(`D0`+`U0`) from `users` WHERE login='" . $userLogin . "'";
+ $traffData = simple_query($traffQuery);
+ $result = $traffData['SUM(`D0`+`U0`)'];
+ $this->setOldValue($taskID, $result);
+ } else {
+ throw new Exception(self::PARAM_EX . "GETUSERTRAFF");
+ }
+ break;
+ //check is some file exist?
+ case 'fileexists':
+ if (!empty($this->taskData[$taskID]['param'])) {
+ $result = file_exists($this->taskData[$taskID]['param']);
+ $storeValue = ($result) ? 'true' : 'false';
+ $this->setOldValue($taskID, $storeValue);
+ } else {
+ throw new Exception(self::PARAM_EX . "FILEEXISTS");
+ }
+ break;
+ }
+ } else {
+ $result = 0;
+ }
+ return ($result);
+ }
+
+ /*
+ * gets oldresult from some task id
+ *
+ * @param $taskID - existing task id
+ *
+ * @return string
+ */
+
+ private function getOldValue($taskID = NULL) {
+ $result = $this->oldResults[$taskID];
+ return ($result);
+ }
+
+ /*
+ * Checks condition for selected task
+ *
+ * @param $taskID - existing task id
+ *
+ * @return string
+ */
+
+ private function checkCondition($taskID = NULL) {
+ if (!empty($taskID)) {
+ switch ($this->taskData[$taskID]['operator']) {
+ //boolean true
+ case '=true':
+ if ($this->doAction($taskID)) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //boolean false
+ case '=false':
+ if (!$this->doAction($taskID)) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //boolean equals
+ case '==':
+ $cond=trim($this->taskData[$taskID]['condition']);
+ $actres=trim($this->doAction($taskID));
+ if ($actres == $cond) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //boolean not equals
+ case '!=':
+ $cond=trim($this->taskData[$taskID]['condition']);
+ $actres=trim($this->doAction($taskID));
+ if ($actres != $cond) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //boolean gt
+ case '>':
+ $currentValue = $this->doAction($taskID);
+ $currentValue = trim($currentValue);
+ if ($currentValue > $this->taskData[$taskID]['condition']) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //boolean lt
+ case '<':
+ $currentValue = $this->doAction($taskID);
+ $currentValue = trim($currentValue);
+ if ($currentValue < $this->taskData[$taskID]['condition']) {
+ return (false);
+ } else {
+ return (false);
+ }
+
+ break;
+ //changes against previous results
+ case 'changed':
+ $oldValue = $this->oldResults[$taskID];
+ $currentValue = $this->doAction($taskID);
+ if ($currentValue != $oldValue) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //any changes against previois results
+ case 'notchanged':
+ $oldValue = $this->oldResults[$taskID];
+ $currentValue = $this->doAction($taskID);
+ if ($currentValue == $oldValue) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //empty check
+ case 'empty':
+ $emptyCheck = $this->doAction($taskID);
+ $emptyCheck = trim($emptyCheck);
+ if (empty($emptyCheck)) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //like substring check
+ case 'like':
+ $currentResult = $this->doAction($taskID);
+ $needCondition = $this->taskData[$taskID]['condition'];
+ if (ispos($currentResult, $needCondition)) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ //not like substring check
+ case 'notlike':
+ $currentResult = $this->doAction($taskID);
+ $needCondition = $this->taskData[$taskID]['condition'];
+ if (!ispos($currentResult, $needCondition)) {
+ return (true);
+ } else {
+ return (false);
+ }
+ break;
+ }
+ } else
+ return (0);
+ }
+
+ /*
+ * Main task processing subroutine
+ *
+ * @return void
+ */
+
+ public function processTask() {
+ foreach ($this->taskData as $taskID => $eachProcessTask) {
+
+ if ($this->checkCondition($taskID)) {
+ //task details collecting
+ $alertTaskName = $this->taskData[$taskID]['name'];
+
+
+ //if condition happens - do some task actions
+ $taskActions = $this->taskData[$taskID]['action'];
+ if (!empty($taskActions)) {
+ /* different actions handling */
+ // system log write
+ if (ispos($taskActions, 'log')) {
+ log_register("WATCHDOG NOTIFY THAT `" . $alertTaskName . "`");
+ }
+ //send emails with alerts
+ if (ispos($taskActions, 'email')) {
+ if (!empty($this->settings['WATCHDOG_EMAILS'])) {
+ $allNotifyEmails= explode(',', $this->settings['WATCHDOG_EMAILS']);
+ if (!empty($allNotifyEmails)) {
+ $notifyMessageMail=$this->settings['WATCHDOG_ALERT'].' '.$alertTaskName;
+ foreach ($allNotifyEmails as $im=>$eachmail) {
+ $this->sendEmail($eachmail, $notifyMessageMail);
+ }
+ }
+ }
+ }
+ //run some script with path like [path]
+ if (ispos($taskActions, 'script')) {
+ if (preg_match('!\[(.*?)\]!si', $taskActions, $tmpArr)) {
+ $runScriptPath = $tmpArr[1];
+ } else {
+ $runScriptPath='';
+ }
+ if (!empty($runScriptPath)) {
+ shell_exec($runScriptPath);
+ log_register("WATCHDOG RUN SCRIPT `".$runScriptPath."`");
+ }
+ }
+
+ //send sms via turboSMS
+ if (ispos($taskActions, 'sms')) {
+ if (!empty($this->settings['WATCHDOG_PHONES'])) {
+ $allNotifyPhones=explode(',', $this->settings['WATCHDOG_PHONES']);
+ if (!empty($allNotifyPhones)) {
+ $notifyMessage=$this->settings['WATCHDOG_ALERT'].' '.$alertTaskName;
+ foreach ($allNotifyPhones as $iu=>$eachmobile) {
+ $this->sendSMS($eachmobile, $notifyMessage);
+ }
+ }
+ }
+
+ }
+
+ } else {
+ throw new Exception("NO_AVAILABLE_TASK_ACTIONS");
+ }
+ }
+ }
+
+ $this->backgroundSMSProcessing();
+ }
+
+}
+
+/*
+ *
+ * Watchdog view controls class
+ *
+ */
+
+class WatchDogInterface {
+
+ private $allTasks = array();
+ private $settings = array();
+
+ const TASKID_EX = 'NO_REQUIRED_TASK_ID';
+ const TASKADD_EX = 'MISSING_REQUIRED_OPTION';
+
+
+ /*
+ * load all watchdog tasks intoo private prop allTasks
+ *
+ * @return void
+ */
+
+ public function loadAllTasks() {
+ $taskQuery = "SELECT * from `watchdog`;";
+ $alltasks = simple_queryall($taskQuery);
+ if (!empty($alltasks)) {
+ foreach ($alltasks as $iz => $eachTask) {
+ $this->allTasks[$eachTask['id']]['id'] = $eachTask['id'];
+ $this->allTasks[$eachTask['id']]['active'] = $eachTask['active'];
+ $this->allTasks[$eachTask['id']]['name'] = $eachTask['name'];
+ $this->allTasks[$eachTask['id']]['checktype'] = $eachTask['checktype'];
+ $this->allTasks[$eachTask['id']]['param'] = $eachTask['param'];
+ $this->allTasks[$eachTask['id']]['operator'] = $eachTask['operator'];
+ $this->allTasks[$eachTask['id']]['condition'] = $eachTask['condition'];
+ $this->allTasks[$eachTask['id']]['action'] = $eachTask['action'];
+ $this->allTasks[$eachTask['id']]['oldresult'] = $eachTask['oldresult'];
+ }
+ }
+ }
+
+ /*
+ * private property allTasks getter
+ *
+ * @return array
+ */
+
+ public function getAllTasks() {
+ $result = $this->allTasks;
+ return ($result);
+ }
+
+ /*
+ * Gets watchdog settings from database and load it into settings property
+ * Also it sets default values into the database
+ *
+ * @return void
+ */
+
+ public function loadSettings() {
+ $alert = zb_StorageGet('WATCHDOG_ALERT');
+ if (empty($alert)) {
+ $alert = __('Watchdog notifies that');
+ zb_StorageSet('WATCHDOG_ALERT', $alert);
+ }
+ $phones = zb_StorageGet('WATCHDOG_PHONES');
+ if (empty($phones)) {
+ zb_StorageSet('WATCHDOG_PHONES', '');
+ }
+ $emails = zb_StorageGet('WATCHDOG_EMAILS');
+ if (empty($emails)) {
+ zb_StorageSet('WATCHDOG_EMAILS', '');
+ }
+ $smsgateway = zb_StorageGet('WATCHDOG_TSMS_GATEWAY');
+ if (empty($smsgateway)) {
+ $altcfg = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
+ $smsgateway = $altcfg['TSMS_GATEWAY'];
+ zb_StorageSet('WATCHDOG_TSMS_GATEWAY', $smsgateway);
+ }
+ $smslogin = zb_StorageGet('WATCHDOG_TSMS_LOGIN');
+ if (empty($smslogin)) {
+ $smslogin = $altcfg['TSMS_LOGIN'];
+ zb_StorageSet('WATCHDOG_TSMS_LOGIN', $smslogin);
+ }
+ $smspassword = zb_StorageGet('WATCHDOG_TSMS_PASSWORD');
+ if (empty($smspassword)) {
+ $smspassword = $altcfg['TSMS_PASSWORD'];
+ zb_StorageSet('WATCHDOG_TSMS_PASSWORD', $smspassword);
+ }
+ $smssign= zb_StorageGet('WATCHDOG_TSMS_SIGN');
+ if (empty($smssign)) {
+ $smssign='Ubilling';
+ zb_StorageSet('WATCHDOG_TSMS_SIGN', $smssign);
+ }
+
+ $this->settings['WATCHDOG_ALERT'] = $alert;
+ $this->settings['WATCHDOG_PHONES'] = $phones;
+ $this->settings['WATCHDOG_EMAILS'] = $emails;
+ $this->settings['WATCHDOG_TSMS_GATEWAY'] = $smsgateway;
+ $this->settings['WATCHDOG_TSMS_LOGIN'] = $smslogin;
+ $this->settings['WATCHDOG_TSMS_PASSWORD'] = $smspassword;
+ $this->settings['WATCHDOG_TSMS_SIGN'] = $smssign;
+ }
+
+ /*
+ * Returns current watchdog settings
+ *
+ * @return array
+ */
+
+ public function getSettings() {
+ $result = $this->settings;
+ return ($result);
+ }
+
+ /*
+ * shows all available tasks list
+ *
+ * @return string
+ */
+
+ public function listAllTasks() {
+ $cells= wf_TableCell(__('ID'));
+ $cells.= wf_TableCell(__('Active'));
+ $cells.= wf_TableCell(__('Name'));
+ $cells.= wf_TableCell(__('Check type'));
+ $cells.= wf_TableCell(__('Parameter'));
+ $cells.= wf_TableCell(__('Operator'));
+ $cells.= wf_TableCell(__('Condition'));
+ $cells.= wf_TableCell(__('Actions'));
+ $cells.= wf_TableCell(__('Manage'));
+ $rows= wf_TableRow($cells, 'row1');
+
+ if (!empty($this->allTasks)) {
+ foreach ($this->allTasks as $io=>$eachtask) {
+ $details=wf_tag('pre').print_r($eachtask,true).wf_tag('pre',true);
+ $detailLink= wf_modal($eachtask['id'], $eachtask['name'], $details, '', '600', '400');
+ $cells= wf_TableCell($detailLink);
+ $cells.= wf_TableCell(web_bool_led($eachtask['active']));
+ $cells.= wf_TableCell($eachtask['name']);
+ $cells.= wf_TableCell($eachtask['checktype']);
+ $cells.= wf_TableCell($eachtask['param']);
+ $cells.= wf_TableCell($eachtask['operator']);
+ $cells.= wf_TableCell($eachtask['condition']);
+ $cells.= wf_TableCell($eachtask['action']);
+
+ $controls= wf_JSAlert('?module=watchdog&delete='.$eachtask['id'], web_delete_icon(),__('Removing this may lead to irreparable results'));
+ $controls.= wf_JSAlert('?module=watchdog&edit='.$eachtask['id'], web_edit_icon(),__('Are you serious'));
+
+ $cells.= wf_TableCell($controls);
+ $rows.= wf_TableRow($cells, 'row3');
+ }
+ }
+
+ $result= wf_TableBody($rows, '100%', '0', 'sortable');
+ return ($result);
+ }
+
+
+ /*
+ * shows new task creation form
+ *
+ * @return string
+ */
+
+ public function newTaskForm() {
+
+ $checktypes=array(
+ 'icmpping'=>'icmpping',
+ 'tcpping'=>'tcpping',
+ 'script'=>'script',
+ 'getusertraff'=>'getusertraff',
+ 'fileexists'=>'fileexists'
+ );
+
+ $operators=array(
+ '=true'=>'=true',
+ '=false'=>'=false',
+ '=='=>'==',
+ '!='=>'!=',
+ '>'=>'>',
+ '<'=>'<',
+ 'empty'=>'empty',
+ 'changed'=>'changed',
+ 'notchanged'=>'notchanged',
+ 'like'=>'like',
+ 'notlike'=>'notlike',
+ );
+
+ $inputs= wf_TextInput('newname', __('Name'), '', true);
+ $inputs.= wf_Selector('newchecktype', $checktypes, __('Check type'), '', true);
+ $inputs.= wf_TextInput('newparam', __('Parameter'), '',true);
+ $inputs.= wf_Selector('newoperator', $operators, __('Operator'), '', true);
+ $inputs.= wf_TextInput('newcondition', __('Condition'), '', true);
+ $inputs.= wf_TextInput('newaction', __('Actions'), '', true);
+ $inputs.=wf_CheckInput('newactive', __('Active'), true, true);
+ $inputs.= wf_Submit(__('Create'));
+
+ $form= wf_Form("", 'POST', $inputs, 'glamour');
+ return ($form);
+
+ }
+
+ /*
+ * shows modify form for some existing task
+ *
+ * @param $taskID existing task id
+ *
+ * @return string
+ */
+ public function editTaskForm($taskID) {
+
+ $taskID=vf($taskID,3);
+ if (empty($taskID)) {
+ throw new Exception (self::TASKID_EX);
+ }
+
+ $checktypes=array(
+ 'icmpping'=>'icmpping',
+ 'tcpping'=>'tcpping',
+ 'script'=>'script',
+ 'getusertraff'=>'getusertraff',
+ 'fileexists'=>'fileexists'
+ );
+
+ $operators=array(
+ '=true'=>'=true',
+ '=false'=>'=false',
+ '=='=>'==',
+ '!='=>'!=',
+ '>'=>'>',
+ '<'=>'<',
+ 'empty'=>'empty',
+ 'changed'=>'changed',
+ 'notchanged'=>'notchanged',
+ 'like'=>'like',
+ 'notlike'=>'notlike'
+ );
+
+ $inputs= wf_TextInput('editname', __('Name'), $this->allTasks[$taskID]['name'], true);
+ $inputs.= wf_Selector('editchecktype', $checktypes, __('Check type'), $this->allTasks[$taskID]['checktype'], true);
+ $inputs.= wf_TextInput('editparam', __('Parameter'), $this->allTasks[$taskID]['param'],true);
+ $inputs.= wf_Selector('editoperator', $operators, __('Operator'), $this->allTasks[$taskID]['operator'], true);
+ $inputs.= wf_TextInput('editcondition', __('Condition'), $this->allTasks[$taskID]['condition'], true);
+ $inputs.= wf_TextInput('editaction', __('Actions'), $this->allTasks[$taskID]['action'], true);
+ $inputs.= wf_CheckInput('editactive', __('Active'), true, $this->allTasks[$taskID]['active']);
+ $inputs.= wf_Submit(__('Save'));
+
+ $form= wf_Form("", 'POST', $inputs, 'glamour');
+ $form.= wf_Link("?module=watchdog", __('Back'), true, 'ubButton');
+ return ($form);
+
+ }
+ /*
+ * saves changes in the watchdog task as selected in editTaskForm
+ *
+ * @return void
+ */
+ public function changeTask() {
+ $taskID=vf($_GET['edit'],3);
+ if (wf_CheckPost(array('editname','editaction','editparam'))) {
+ if (!empty($taskID)) {
+ if (isset($_POST['editactive'])) {
+ $actFlag=1;
+ } else {
+ $actFlag=0;
+ }
+ simple_update_field('watchdog', 'name', $_POST['editname'], "WHERE `id`='".$taskID."'");
+ simple_update_field('watchdog', 'checktype', $_POST['editchecktype'], "WHERE `id`='".$taskID."'");
+ simple_update_field('watchdog', 'param', $_POST['editparam'], "WHERE `id`='".$taskID."'");
+ simple_update_field('watchdog', 'operator', $_POST['editoperator'], "WHERE `id`='".$taskID."'");
+ simple_update_field('watchdog', 'condition', $_POST['editcondition'], "WHERE `id`='".$taskID."'");
+ simple_update_field('watchdog', 'action', $_POST['editaction'], "WHERE `id`='".$taskID."'");
+ simple_update_field('watchdog', 'active', $actFlag, "WHERE `id`='".$taskID."'");
+
+ log_register("WATCHDOG CHANGE TASK [".$taskID."] `".$_POST['editname']."`");
+
+ } else {
+ throw new Exception(self::TASKID_EX);
+ }
+ } else {
+ throw new Exception(self::TASKADD_EX);
+ }
+
+ }
+
+ /*
+ * delete some existing watchdog task
+ *
+ * @param $taskID - existing task id
+ *
+ * @return void
+ */
+ public function deleteTask($taskID) {
+ $taskID=vf($taskID,3);
+ if (empty($taskID)) {
+ throw new Exception(self::TASKID_EX);
+ }
+ $query="DELETE from `watchdog` WHERE `id`='".$taskID."'";
+ nr_query($query);
+ log_register("WATCHDOG DELETE TASK [".$taskID."]");
+ }
+
+ /*
+ * creates new watchdog task
+ *
+ * @param $name - task name
+ * @param $checktype - task check type
+ * @param $param - parameter
+ * @param $operator - operator
+ * @param $condition - condition for action
+ * @param $action - actions list
+ * @param $active - activity tinyint flag
+ *
+ * @return void
+ */
+ public function createTask($name,$checktype,$param,$operator,$condition,$action,$active=0) {
+ $active= mysql_real_escape_string($active);
+ $name= mysql_real_escape_string($name);
+ $checktype= mysql_real_escape_string($checktype);
+ $param= mysql_real_escape_string($param);
+ $operator= mysql_real_escape_string($operator);
+ $condition= mysql_real_escape_string($condition);
+ $action= mysql_real_escape_string($action);
+
+ if ((empty($name)) OR (empty($param)) OR (empty($action))) {
+ throw new Exception(self::TASKADD_EX);
+ }
+
+
+ $query="INSERT INTO `watchdog` (
+ `id` ,
+ `active` ,
+ `name` ,
+ `checktype` ,
+ `param` ,
+ `operator` ,
+ `condition` ,
+ `action` ,
+ `oldresult`
+ )
+ VALUES (
+ NULL , '".$active."', '".$name."', '".$checktype."', '".$param."', '".$operator."', '".$condition."', '".$action."', NULL
+ );";
+ nr_query($query);
+ log_register("WATCHDOG CREATE TASK `".$name."`");
+ }
+
+ /*
+ * Shows watchdog control panel
+ *
+ * @return string
+ */
+ public function panel() {
+ $createWindow=$this->newTaskForm();
+ $settingsWindow=$this->settingsForm();
+ $result= wf_modal(__('Create new task'), __('Create new task'), $createWindow, 'ubButton', '400', '300');
+ $result.= wf_Link("?module=watchdog", __('Show all tasks'), false, 'ubButton');
+ $result.= wf_Link("?module=watchdog&manual=true", __('Manual run'), false, 'ubButton');
+ $result.= wf_Link("?module=watchdog&showsmsqueue=true", __('View SMS sending queue'), false, 'ubButton');
+ $result.= wf_modal(__('Settings'), __('Settings'), $settingsWindow, 'ubButton', '750', '350');
+
+ return ($result);
+ }
+
+ /*
+ * returns watchdog settings edit form
+ *
+ * @return string
+ */
+ public function settingsForm() {
+
+ $inputs= wf_TextInput('changealert', __('Watchdog alert text'), $this->settings['WATCHDOG_ALERT'], true,'30');
+ $inputs.= wf_TextInput('changephones', __('Phone numbers to send alerts'), $this->settings['WATCHDOG_PHONES'], true,'30');
+ $inputs.= wf_TextInput('changeemails', __('Emails to send alerts'), $this->settings['WATCHDOG_EMAILS'], true,'30');
+ $inputs.= wf_TextInput('changetsmsgateway', __('TurboSMS gateway address'), $this->settings['WATCHDOG_TSMS_GATEWAY'], true);
+ $inputs.= wf_TextInput('changetsmslogin', __('User login to access TurboSMS gateway'), $this->settings['WATCHDOG_TSMS_LOGIN'], true);
+ $inputs.= wf_TextInput('changetsmspassword', __('User password for access TurboSMS gateway'), $this->settings['WATCHDOG_TSMS_PASSWORD'], true);
+ $inputs.= wf_TextInput('changetsmssign', __('TurboSMS').' '. __('Sign'), $this->settings['WATCHDOG_TSMS_SIGN'], true);
+ $inputs.= wf_Submit(__('Save'));
+ $form= wf_Form("", 'POST', $inputs, 'glamour');
+ return ($form);
+
+ }
+
+ /*
+ * save the current settings of watchdog as it posted in settingsForm
+ *
+ * @return void
+ */
+ public function saveSettings() {
+ if (wf_CheckPost(array('changealert'))) {
+
+ zb_StorageSet('WATCHDOG_ALERT',$_POST['changealert']);
+ zb_StorageSet('WATCHDOG_PHONES', $_POST['changephones']);
+ zb_StorageSet('WATCHDOG_EMAILS', $_POST['changeemails']);
+ zb_StorageSet('WATCHDOG_TSMS_GATEWAY',$_POST['changetsmsgateway']);
+ zb_StorageSet('WATCHDOG_TSMS_LOGIN',$_POST['changetsmslogin']);
+ zb_StorageSet('WATCHDOG_TSMS_PASSWORD',$_POST['changetsmspassword']);
+ zb_StorageSet('WATCHDOG_TSMS_SIGN',$_POST['changetsmssign']);
+
+ log_register("WATCHDOG SETTINGS CHANGED");
+ }
+ }
+
+ /*
+ * Shows Turbo SMS sending queue
+ *
+ * @return string
+ */
+ public function showSMSqueue() {
+ $smsPath='content/tsms/';
+ $tsms_host = $this->settings['WATCHDOG_TSMS_GATEWAY'];
+ $tsms_db = 'users';
+ $tsms_login = $this->settings['WATCHDOG_TSMS_LOGIN'];
+ $tsms_password = $this->settings['WATCHDOG_TSMS_PASSWORD'];
+ $tsms_table = $this->settings['WATCHDOG_TSMS_LOGIN'];
+ $smsArray=array();
+
+ $TsmsDB = new DbConnect($tsms_host, $tsms_login, $tsms_password, $tsms_db, $error_reporting = true, $persistent = false);
+ $TsmsDB->open() or die($TsmsDB->error());
+ $TsmsDB->query('SET NAMES utf8;');
+
+ if (wf_CheckPost(array('showdate'))) {
+ $date= mysql_real_escape_string($_POST['showdate']);
+ } else {
+ $date='';
+ }
+
+ if (!empty($date)) {
+ $where=" WHERE `send_time` LIKE '".$date."%' ORDER BY `id` DESC;";
+ } else {
+ $where=' ORDER BY `id` DESC LIMIT 50;';
+ }
+
+ $query="SELECT * from `".$tsms_table."`".$where;
+ $TsmsDB->query($query);
+
+ while ($row = $TsmsDB->fetchassoc()) {
+ $smsArray[] = $row;
+ }
+
+
+ //close old datalink
+ $TsmsDB->close();
+
+ //rendering result
+ $inputs= wf_DatePickerPreset('showdate', curdate());
+ $inputs.= wf_Submit(__('Show'));
+ $dateform= wf_Form("", 'POST', $inputs, 'glamour');
+
+ $lighter='onmouseover="this.className = \'row2\';" onmouseout="this.className = \'row3\';" ';
+
+ $cells= wf_TableCell(__('ID'));
+ $cells.= wf_TableCell(__('Msg ID'));
+ $cells.= wf_TableCell(__('Mobile'));
+ $cells.= wf_TableCell(__('Sign'));
+ $cells.= wf_TableCell(__('Message'));
+ $cells.= wf_TableCell(__('WAP'));
+ $cells.= wf_TableCell(__('Cost'));
+ $cells.= wf_TableCell(__('Credits'));
+ $cells.= wf_TableCell(__('Send time'));
+ $cells.= wf_TableCell(__('Sended'));
+ $cells.= wf_TableCell(__('Updated'));
+ $cells.= wf_TableCell(__('Status'));
+ $cells.= wf_TableCell(__('SMPP'));
+ $rows=wf_TableRow($cells, 'row1');
+
+ if (!empty($smsArray)) {
+ foreach ($smsArray as $io=>$each) {
+ $cells= wf_TableCell($each['id']);
+ $cells.= wf_TableCell($each['msg_id']);
+ $cells.= wf_TableCell($each['number']);
+ $cells.= wf_TableCell($each['sign']);
+ $msg= wf_modal(__('Show'), __('SMS'), $each['message'], '', '300', '200');
+ $cells.= wf_TableCell($msg);
+ $cells.= wf_TableCell($each['wappush']);
+ $cells.= wf_TableCell($each['cost']);
+ $cells.= wf_TableCell($each['credits']);
+ $cells.= wf_TableCell($each['send_time']);
+ $cells.= wf_TableCell($each['sended']);
+ $cells.= wf_TableCell($each['updated']);
+ $status=wf_modal(__('Show'), __('Status'), $each['status'], '', '400', '150');
+ $cells.= wf_TableCell($status);
+ $cells.= wf_TableCell($each['dlr_status']);
+ $rows.=wf_tag('tr', false, 'row3', $lighter);
+ $rows.=$cells;
+ $rows.=wf_tag('tr', true);
+ }
+ }
+
+ $result= $dateform;
+ $result.= wf_TableBody($rows, '100%', '0', 'sortable');
+ return ($result);
+
+ }
+
+
+}
+
+?>
\ No newline at end of file
diff --git a/api/libs/api.workaround.php b/api/libs/api.workaround.php
index 5a520f9b6..6a9b56e7f 100755
--- a/api/libs/api.workaround.php
+++ b/api/libs/api.workaround.php
@@ -241,9 +241,9 @@ function web_EditorStringDataFormPassword($fieldnames,$fieldkey,$useraddress,$ol
if (isset($alterconf['PASSWORD_GENERATION_LENGHT'])) {
if ($alterconf['PASSWORD_TYPE']) {
- $password_proposal= zb_rand_string($alterconf['PASSWORD_GENERATION_LENGHT']);
+ $password_proposal= zb_rand_string($alterconf['PASSWORD_GENERATION_LENGHT']);
} else {
- $password_proposal= zb_rand_digits($alterconf['PASSWORD_GENERATION_LENGHT']);
+ $password_proposal= zb_rand_digits($alterconf['PASSWORD_GENERATION_LENGHT']);
}
} else {
@@ -957,7 +957,7 @@ function web_ProfilePluginsShow($login) {
foreach ($plugins as $io=>$eachplugin) {
if (isset($eachplugin['overlay'])) {
$overlaydata=web_ProfilePluginsShowOverlay($login, $eachplugin['overlaydata']).' ';
- $result.=wf_modal(' ', __($eachplugin['name']), $overlaydata, '', 800, 400);
+ $result.=wf_modal(' ', __($eachplugin['name']), $overlaydata, '', 800, 450);
} else {
$result.=' ';
}
@@ -983,7 +983,8 @@ function web_ProfileSwitchControlForm($login) {
//control form construct
$inputs= wf_HiddenInput('swassignlogin', $login);
$inputs.= wf_Selector('swassignswid', $switcharr, __('Switch'), @$assignData['switchid'], true);
- $inputs.= wf_TextInput('swassignswport', __('Port'), @$assignData['port'], true, '2');
+ $inputs.= wf_TextInput('swassignswport', __('Port'), @$assignData['port'], false, '2');
+ $inputs.= wf_CheckInput('swassigndelete', __('Delete'), true, false);
$inputs.= wf_Submit('Save');
$controlForm= wf_Form('', "POST", $inputs, 'glamour');
//form end
@@ -1011,6 +1012,12 @@ function web_ProfileSwitchControlForm($login) {
log_register("CHANGE SWITCHPORT (".$login.") ON SWITCHID [".$newswid."] PORT [".$newport."]");
rcms_redirect("?module=userprofile&username=".$login);
}
+ //delete subroutine
+ if (isset($_POST['swassigndelete'])) {
+ nr_query("DELETE from `switchportassign` WHERE `login`='".$_POST['swassignlogin']."'");
+ log_register("DELETE SWITCHPORT (".$login.")");
+ rcms_redirect("?module=userprofile&username=".$login);
+ }
return ($result);
}
@@ -2007,7 +2014,20 @@ function zb_backup_tables($tables = '*',$silent=false) {
}
//save file
- $backname=DATA_PATH.'backups/sql/billing-db-backup-'.time().'.sql';
+ if (ispos($alter_conf['NOBACKUPTABLESLIKE'], 'weblogs')) {
+ $return.="
+ CREATE TABLE IF NOT EXISTS `weblogs` (
+ `id` int(11) NOT NULL auto_increment,
+ `date` datetime NOT NULL,
+ `admin` varchar(45) default NULL,
+ `ip` varchar(64) default NULL,
+ `event` varchar(255) default NULL,
+ PRIMARY KEY (`id`),
+ KEY `date` (`date`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+ ";
+ }
+ $backname=DATA_PATH.'backups/sql/ubilling-db-backup-'.time().'.sql';
$handle = fopen($backname,'w+');
fwrite($handle,$return);
fclose($handle);
@@ -2016,7 +2036,7 @@ function zb_backup_tables($tables = '*',$silent=false) {
show_window(__('Backup saved'),$backname);
}
- log_register("CREATE Backup ".$backname);
+ log_register("CREATE Backup `".$backname."`");
return ($backname);
}
@@ -2599,7 +2619,12 @@ function web_UserArrayShower($usersarr) {
$tablecells.=wf_TableCell(@$alluserips[$eachlogin],'','','sorttable_customkey="'. ip2int(@$alluserips[$eachlogin]).'"');
$tablecells.=wf_TableCell(@$alltariffs[$eachlogin]);
if ($alterconf['ONLINE_LAT']) {
- $tablecells.=wf_TableCell(date("Y-m-d H:i:s",$alluserlat[$eachlogin]));
+ if (isset($alluserlat[$eachlogin])) {
+ $cUserLat=date("Y-m-d H:i:s",$alluserlat[$eachlogin]);
+ } else {
+ $cUserLat=__('No');
+ }
+ $tablecells.=wf_TableCell($cUserLat);
}
$tablecells.=wf_TableCell($activity,'','','sorttable_customkey="'.$activity_flag.'"');
if ($alterconf['DN_ONLINE_DETECT']) {
@@ -2772,11 +2797,26 @@ function crc16($string) {
return $crc;
}
+function zb_MacVendorSearchmac($mac) {
+ // searchmac.com API request
+ $url='http://searchmac.com/api/raw/'.$mac;
+ $rawdata=file_get_contents($url);
+ if (!empty($rawdata)) {
+ $result=$rawdata;
+ } else {
+ $result='EMPTY';
+ }
+
+ return ($result);
+}
+
//lookups vendor by mac
function zb_MacVendorLookup($mac) {
$altcfg= rcms_parse_ini_file(CONFIG_PATH."alter.ini");
$result='';
-
+ //use old macvendorlookup.com API
+ if (isset($altcfg['MACVEN_OLD'])) {
+ if ($altcfg['MACVEN_OLD']) {
if (!empty($altcfg['MACVENAPI_KEY'])) {
$apikey=$altcfg['MACVENAPI_KEY'];
$url='http://www.macvendorlookup.com/api/'.$apikey.'/';
@@ -2793,7 +2833,12 @@ function zb_MacVendorLookup($mac) {
} else {
$result=__('No macvendorlookup.com API key set');
}
-
+ } else {
+ $result= zb_MacVendorSearchmac($mac);
+ }
+ } else {
+ $result= zb_MacVendorSearchmac($mac);
+ }
return ($result);
}
@@ -2840,13 +2885,25 @@ function zb_DiscountsGetMonthPayments($month) {
function zb_DiscountProcessPayments($debug=false) {
- $alldiscountusers= zb_DiscountsGetAllUsers();
- $monthpayments= zb_DiscountsGetMonthPayments(curmonth());
$alterconf= rcms_parse_ini_file(CONFIG_PATH."alter.ini");
$cashtype=$alterconf['DISCOUNT_CASHTYPEID'];
$operation=$alterconf['DISCOUNT_OPERATION'];
+ if (isset($alterconf['DISCOUNT_PREVMONTH'])) {
+ if ($alterconf['DISCOUNT_PREVMONTH']) {
+ $targetMonth= prevmonth();
+ } else {
+ $targetMonth= curmonth();
+ }
+ } else {
+ $targetMonth= curmonth();
+ }
+
+
+ $alldiscountusers= zb_DiscountsGetAllUsers();
+ $monthpayments= zb_DiscountsGetMonthPayments($targetMonth);
+
if ((!empty($alldiscountusers) AND (!empty($monthpayments)))) {
foreach ($monthpayments as $login=>$eachpayment) {
//have this user discount?
@@ -3406,5 +3463,23 @@ function web_AnalyticsTaskmanMonthGraph($year) {
return ($result);
}
+ function zb_DownloadFile($filePath) {
+ if (!empty($filePath)) {
+ if (file_exists($filePath)) {
+ $fileContent= file_get_contents($filePath);
+ log_register("DOWNLOAD FILE `".$filePath."`");
+ header('Content-Type: application/octet-stream');
+ header("Content-Transfer-Encoding: Binary");
+ header("Content-disposition: attachment; filename=\"" . basename($filePath) . "\"");
+ die($fileContent);
+
+ } else {
+ throw new Exception('DOWNLOAD_FILEPATH_NOT_EXISTS');
+ }
+ } else {
+ throw new Exception('DOWNLOAD_FILEPATH_EMPTY');
+
+ }
+}
?>
\ No newline at end of file
diff --git a/api/libs/api.ymaps.php b/api/libs/api.ymaps.php
index fc9ad5a95..215d8b299 100644
--- a/api/libs/api.ymaps.php
+++ b/api/libs/api.ymaps.php
@@ -433,7 +433,11 @@ function sm_MapDrawSwitches() {
}
//dead mark labels
if ($ym_conf['DEAD_LABEL']) {
- $iconlabel=$each['location'];
+ if (!empty($each['location'])) {
+ $iconlabel=$each['location'];
+ } else {
+ $iconlabel=__('No location set');
+ }
} else {
$iconlabel='';
}
diff --git a/config/alter.ini b/config/alter.ini
index be7756567..9d346f6b5 100644
--- a/config/alter.ini
+++ b/config/alter.ini
@@ -22,10 +22,10 @@ docsis_cm_source=multinet/cm_source/
docsis_cm_bin=multinet/cm_bin/
; agents streets assigning
AGENTS_ASSIGN=1
-; payments export enabling
-EXPORT_ENABLED=0
;default agent ID
DEFAULT_ASSIGN_AGENT=1
+; payments export enabling
+EXPORT_ENABLED=0
;don't touch this even you live on Mars ;)
EXPORT_FROM_TIME=00:00:00
EXPORT_TO_TIME=23:59:59
@@ -109,7 +109,7 @@ ARPDIAG_ENABLED=0
;arpwatch log file
ARPDIAG_LOG=/var/log/messages
;dont backup tables with this patterns, comma delimiter
-NOBACKUPTABLESLIKE=logs_,detailstat,weblogs
+NOBACKUPTABLESLIKE="logs_,detailstat,weblogs"
;can user customize taskbar icons size?
TB_ICONCUSTOMSIZE=1
;put random MAC into manual mac change dialogue by default?
@@ -156,7 +156,9 @@ REMOTEAPI_ENABLED=1
;Is mass reset module enabled?
MASSRESET_ENABLED=0
;mac vendor lookup enabled
-MACVEN_ENABLED=0
+MACVEN_ENABLED=1
+;uncomment following option and set in "1" to use old macvendorlookup.com API instead searchmac.com
+;MACVEN_OLD=0
;macvendorlookup.com API key (Pipe type needed)
MACVENAPI_KEY=""
;show task create interface in user profile
@@ -175,6 +177,8 @@ DISCOUNT_PERCENT_CFID=32
DISCOUNT_OPERATION="CORR"
;discount payment cash type id
DISCOUNT_CASHTYPEID=1
+;uncomment following option to process discounts by previous month payments
+;DISCOUNT_PREVMONTH=1
;login generation options.
LOGIN_GENERATION=DEFAULT
;password generation size
@@ -253,3 +257,11 @@ NMAP_PATH="/usr/local/bin/nmap"
FREERADIUS_ENABLED=0
;only users with root rights can use set cash option
SETCASH_ONLY_ROOT=0
+;dynamic shaper is enabled?
+DSHAPER_ENABLED=0
+;is watchdog enabled?
+WATCHDOG_ENABLED=0
+;auto freezing cash limit
+AUTOFREEZE_CASH_LIMIT="-20"
+;set contract same as login by default after user register
+CONTRACT_SAME_AS_LOGIN=0
diff --git a/config/bmagic.ini b/config/bmagic.ini
index 3771b4f08..09a8bc39c 100755
--- a/config/bmagic.ini
+++ b/config/bmagic.ini
@@ -34,6 +34,11 @@ icon = icon_documents.gif
name = "Userstats permissions"
icon = icon_hammer_big.gif
+[pl_option82]
+name = "DHCP option 82"
+icon = opt82.png
+
+
[mtsigmon]
name = "Mikrotik signal monitor"
icon = icon_mikrotik.gif
\ No newline at end of file
diff --git a/config/custom_menu_3.dat b/config/custom_menu_3.dat
index e2ad9e336..086305e2a 100755
--- a/config/custom_menu_3.dat
+++ b/config/custom_menu_3.dat
@@ -1 +1 @@
-a:16:{i:0;a:1:{s:5:"title";s:24:"Events:?module=eventview";}i:1;a:1:{s:5:"title";s:37:"Finance report:?module=report_finance";}i:2;a:1:{s:5:"title";s:35:"Signup report:?module=report_signup";}i:3;a:1:{s:5:"title";s:37:"Tariffs report:?module=report_tariffs";}i:4;a:1:{s:5:"title";s:37:"Streets report:?module=report_streets";}i:5;a:1:{s:5:"title";s:37:"Traffic report:?module=report_traffic";}i:6;a:1:{s:5:"title";s:42:"Credits report:?module=report_creditexpire";}i:7;a:1:{s:5:"title";s:35:"Detailed stats:?module=report_dstat";}i:8;a:1:{s:5:"title";s:34:"Report master:?module=reportmaster";}i:9;a:1:{s:5:"title";s:28:"Job report:?module=jobreport";}i:10;a:1:{s:5:"title";s:25:"Genocide:?module=genocide";}i:11;a:1:{s:5:"title";s:40:"Users speed control:?module=speedcontrol";}i:12;a:1:{s:5:"title";s:26:"Tag cloud:?module=tagcloud";}i:13;a:1:{s:5:"title";s:34:"Unknown MAC address:?module=newmac";}i:14;a:1:{s:5:"title";s:15:"UHW:?module=uhw";}i:15;a:1:{s:5:"title";s:36:"System health:?module=report_sysload";}}
\ No newline at end of file
+a:18:{i:0;a:1:{s:5:"title";s:24:"Events:?module=eventview";}i:1;a:1:{s:5:"title";s:37:"Finance report:?module=report_finance";}i:2;a:1:{s:5:"title";s:35:"Signup report:?module=report_signup";}i:3;a:1:{s:5:"title";s:37:"Tariffs report:?module=report_tariffs";}i:4;a:1:{s:5:"title";s:37:"Streets report:?module=report_streets";}i:5;a:1:{s:5:"title";s:37:"Traffic report:?module=report_traffic";}i:6;a:1:{s:5:"title";s:42:"Credits report:?module=report_creditexpire";}i:7;a:1:{s:5:"title";s:35:"Detailed stats:?module=report_dstat";}i:8;a:1:{s:5:"title";s:34:"Report master:?module=reportmaster";}i:9;a:1:{s:5:"title";s:28:"Job report:?module=jobreport";}i:10;a:1:{s:5:"title";s:25:"Genocide:?module=genocide";}i:11;a:1:{s:5:"title";s:40:"Users speed control:?module=speedcontrol";}i:12;a:1:{s:5:"title";s:26:"Tag cloud:?module=tagcloud";}i:13;a:1:{s:5:"title";s:34:"Unknown MAC address:?module=newmac";}i:14;a:1:{s:5:"title";s:43:"Autofreeze report:?module=report_autofreeze";}i:15;a:1:{s:5:"title";s:15:"UHW:?module=uhw";}i:16;a:1:{s:5:"title";s:31:"System settings:?module=sysconf";}i:17;a:1:{s:5:"title";s:36:"System health:?module=report_sysload";}}
\ No newline at end of file
diff --git a/config/dhcp/option82.template b/config/dhcp/option82.template
new file mode 100644
index 000000000..6f3807658
--- /dev/null
+++ b/config/dhcp/option82.template
@@ -0,0 +1,12 @@
+class "{HOSTNAME}" {
+ match if binary-to-ascii (16, 8, "", option agent.remote-id) = "{REMOTEID}" and binary-to-ascii (10, 8, "", option agent.circuit-id) = "{CIRCUITID}";
+ }
+
+ pool {
+ range {IP};
+ allow members of "{HOSTNAME}";
+ }
+
+ host {HOSTNAME} {
+ fixed-address {IP};
+ }
diff --git a/config/modules.d/directories/dshaper.php b/config/modules.d/directories/dshaper.php
index bb82a4977..a15b4c1f6 100755
--- a/config/modules.d/directories/dshaper.php
+++ b/config/modules.d/directories/dshaper.php
@@ -1 +1,5 @@
-$taskbar.=build_task('DSHAPER','?module=dshaper','dshaper.jpg',__('Dynamic shaper'));
\ No newline at end of file
+if (isset($alter_conf['DSHAPER_ENABLED'])) {
+if ($alter_conf['DSHAPER_ENABLED']) {
+$taskbar.=build_task('DSHAPER','?module=dshaper','dshaper.jpg',__('Dynamic shaper'));
+}
+}
\ No newline at end of file
diff --git a/config/modules.d/reports/report_sautofreeze.php b/config/modules.d/reports/report_sautofreeze.php
new file mode 100644
index 000000000..f9fe6b2cc
--- /dev/null
+++ b/config/modules.d/reports/report_sautofreeze.php
@@ -0,0 +1 @@
+$taskbar.=build_task('REPORTAUTOFREEZE','?module=report_autofreeze','autofreeze.png',__('Autofreeze report'));
\ No newline at end of file
diff --git a/config/modules.d/reports/report_snoswitchport.php b/config/modules.d/reports/report_snoswitchport.php
new file mode 100644
index 000000000..62655c653
--- /dev/null
+++ b/config/modules.d/reports/report_snoswitchport.php
@@ -0,0 +1,3 @@
+if ($alter_conf['SWITCHPORT_IN_PROFILE']) {
+$taskbar.=build_task('REPORTAUTOFREEZE','?module=report_noswitchport','noswitchport.png',__('Users without port assigned'));
+}
\ No newline at end of file
diff --git a/config/modules.d/system/watchdog.php b/config/modules.d/system/watchdog.php
new file mode 100755
index 000000000..860f1711d
--- /dev/null
+++ b/config/modules.d/system/watchdog.php
@@ -0,0 +1,5 @@
+if (isset($alter_conf['WATCHDOG_ENABLED'])) {
+if ($alter_conf['WATCHDOG_ENABLED']) {
+$taskbar.=build_task('WATCHDOG','?module=watchdog','watchdog.jpg',__('Watchdog'));
+}
+}
\ No newline at end of file
diff --git a/config/optsaltcfg b/config/optsaltcfg
index 44b45327f..d881f3b9d 100755
--- a/config/optsaltcfg
+++ b/config/optsaltcfg
@@ -3,6 +3,7 @@ SAFE_REGMODE=TRIGGER|Safe user register mode
LOGIN_GENERATION=VARCHAR|Login generation mode
PASSWORD_GENERATION_LENGHT=VARCHAR|Password generation lenght
PASSWORD_TYPE=TRIGGER|Password security type
+CONTRACT_SAME_AS_LOGIN=TRIGGER|Set contract same as login after user register
CHAPTER_TB=Taskbar features
TB_NEWTICKETNOTIFY=TRIGGER|Taskbar notify for new tickets
@@ -102,6 +103,9 @@ NMAP_PATH=VARCHAR|Path to installed nmap
CONTRACT_GENERATION_DEFAULT=TRIGGER|Contracts default generation mode
PAYMENTCARDS_ENABLED=TRIGGER|Payment cards functionality enabled
SETCASH_ONLY_ROOT=TRIGGER|Only users with root rights can use set cash option
+DSHAPER_ENABLED=TRIGGER|Dynamic shaper is enabled
+WATCHDOG_ENABLED=TRIGGER|Watchdog enabled
+AUTOFREEZE_CASH_LIMIT=VARCHAR|Autofreezing cash limit
CHAPTER_OPAYZ=OpenPayz
OPENPAYZ_SUPPORT=TRIGGER|OpenPayz support
diff --git a/config/permgroups.ini b/config/permgroups.ini
index 3abd087dc..eb21a5747 100755
--- a/config/permgroups.ini
+++ b/config/permgroups.ini
@@ -1,6 +1,6 @@
-USERREG=TASKBAR,USERSEARCH,WINBOX,TAGS,USERPROFILE,USEREDIT,USERREG,CASH,ANNIHILATION,ALWAYSONLINE,BINDER,CONTRACT,CORPORATE,CREDIT,CREDITEXPIRE,DOWN,LIFESTORY,MAC,EMAIL,MOBILE,NOTES,ONLINE,PASSIVE,PASSWORD,PHONE,PLARPING,PLCHECKER,PLDHCP,PLDOCS,PLFEES,PLIPCHANGE,PLPINGER,RADIUS,PLSENDMESSAGE,PLDETAILS,PLVCASH,PRINTCHECK,REALNAME,RESET,USERSPEED,TARIFFEDIT,TRAFFSTATS,PDATA
+USERREG=TASKBAR,USERSEARCH,WINBOX,TAGS,USERPROFILE,USEREDIT,USERREG,CASH,ANNIHILATION,ALWAYSONLINE,BINDER,CONTRACT,CORPORATE,CREDIT,CREDITEXPIRE,DOWN,LIFESTORY,MAC,EMAIL,MOBILE,NOTES,ONLINE,PASSIVE,PASSWORD,PHONE,PLARPING,PLCHECKER,PLDHCP,PLDOCS,PLFEES,PLIPCHANGE,PLPINGER,RADIUS,PLSENDMESSAGE,PLDETAILS,PLVCASH,PRINTCHECK,REALNAME,RESET,USERSPEED,TARIFFEDIT,TRAFFSTATS,PDATA,OPTION82
GEO=BUILDS,CITY,STREETS
-SYSTEM=TARIFFSPEED,VSERVICES,SWITCHES,SWITCHESEDIT,SWITCHM,TARIFFS,STGNEWADMIN,ARPDIAG,BACKUP,CASHTYPES,CFTYPES,DHCP,STGDOCSIS,DSHAPER,DSTAT,EVENTVIEW,LOUSYTARIFFS,MASSSEND,MULTINET,NAS,PERMISSIONS,REPORTMASTERADM,RULES,SQLCONSOLE,SYSCONF,MTSIGMON,MASSRESET,UHW,SWITCHMAP,EXPRESSCARD,EXPRESSCARDREG,DOCSIS,ZBSMAN,SWITCHPOLL,MTEXTCONF,USERSMAP,FREERADIUS
+SYSTEM=TARIFFSPEED,VSERVICES,SWITCHES,SWITCHESEDIT,SWITCHM,TARIFFS,STGNEWADMIN,ARPDIAG,BACKUP,CASHTYPES,CFTYPES,DHCP,STGDOCSIS,DSHAPER,DSTAT,EVENTVIEW,LOUSYTARIFFS,MASSSEND,MULTINET,NAS,PERMISSIONS,REPORTMASTERADM,RULES,SQLCONSOLE,SYSCONF,MTSIGMON,MASSRESET,UHW,SWITCHMAP,EXPRESSCARD,EXPRESSCARDREG,DOCSIS,ZBSMAN,SWITCHPOLL,MTEXTCONF,USERSMAP,FREERADIUS,WATCHDOG
FINANCE=BANKSTA,CARDS,AGENTS,EMPLOYEE,OPENPAYZ,PAYEXPORT,PAYFIND,TASKMAN,TICKETING,SIGREQ
-REPORTS=GENOCIDE,NDS,CARDREPORT,NEWMAC,REPORTCREXP,REPORTDSTAT,REPORTFINANCE,REPORTSIGNUP,STREETEPORT,SYSLOAD,REPORTTARIFFS,REPORTTRAFFIC,REPORTMASTER,SPEEDCONTROL,PLFUNDS,ASKOZIA,ASTERISK
+REPORTS=GENOCIDE,NDS,CARDREPORT,NEWMAC,REPORTCREXP,REPORTDSTAT,REPORTFINANCE,REPORTSIGNUP,STREETEPORT,SYSLOAD,REPORTTARIFFS,REPORTTRAFFIC,REPORTMASTER,SPEEDCONTROL,PLFUNDS,ASKOZIA,ASTERISK,REPORTAUTOFREEZE,REPORTNOSWPORT
CATV=CATV,CATVCASH,CATVDECODEREDIT,CATVPROFILE,CATVSTATS,CATVTARIFFEDIT,CATVACT,CATVUSEREDIT,CATVBS
\ No newline at end of file
diff --git a/docs/freeradius/raddb/clients.conf b/docs/freeradius/raddb/clients.conf
new file mode 100644
index 000000000..8c31cd4f8
--- /dev/null
+++ b/docs/freeradius/raddb/clients.conf
@@ -0,0 +1,173 @@
+# -*- text -*-
+##
+## clients.conf -- client configuration directives
+##
+## $Id$
+
+#######################################################################
+#
+# Define RADIUS clients (usually a NAS, Access Point, etc.).
+
+#
+# Defines a RADIUS client.
+#
+# '127.0.0.1' is another name for 'localhost'. It is enabled by default,
+# to allow testing of the server after an initial installation. If you
+# are not going to be permitting RADIUS queries from localhost, we suggest
+# that you delete, or comment out, this entry.
+#
+#
+
+#
+# Each client has a "short name" that is used to distinguish it from
+# other clients.
+#
+# In version 1.x, the string after the word "client" was the IP
+# address of the client. In 2.0, the IP address is configured via
+# the "ipaddr" or "ipv6addr" fields. For compatibility, the 1.x
+# format is still accepted.
+#
+client localhost {
+ # Allowed values are:
+ # dotted quad (1.2.3.4)
+ # hostname (radius.example.com)
+ ipaddr = 127.0.0.1
+
+ # OR, you can use an IPv6 address, but not both
+ # at the same time.
+# ipv6addr = :: # any. ::1 == localhost
+
+ #
+ # A note on DNS: We STRONGLY recommend using IP addresses
+ # rather than host names. Using host names means that the
+ # server will do DNS lookups when it starts, making it
+ # dependent on DNS. i.e. If anything goes wrong with DNS,
+ # the server won't start!
+ #
+ # The server also looks up the IP address from DNS once, and
+ # only once, when it starts. If the DNS record is later
+ # updated, the server WILL NOT see that update.
+ #
+
+ # One client definition can be applied to an entire network.
+ # e.g. 127/8 should be defined with "ipaddr = 127.0.0.0" and
+ # "netmask = 8"
+ #
+ # If not specified, the default netmask is 32 (i.e. /32)
+ #
+ # We do NOT recommend using anything other than 32. There
+ # are usually other, better ways to achieve the same goal.
+ # Using netmasks of other than 32 can cause security issues.
+ #
+ # You can specify overlapping networks (127/8 and 127.0/16)
+ # In that case, the smallest possible network will be used
+ # as the "best match" for the client.
+ #
+ # Clients can also be defined dynamically at run time, based
+ # on any criteria. e.g. SQL lookups, keying off of NAS-Identifier,
+ # etc.
+ # See raddb/sites-available/dynamic-clients for details.
+ #
+
+# netmask = 32
+
+ #
+ # The shared secret use to "encrypt" and "sign" packets between
+ # the NAS and FreeRADIUS. You MUST change this secret from the
+ # default, otherwise it's not a secret any more!
+ #
+ # The secret can be any string, up to 8k characters in length.
+ #
+ # Control codes can be entered vi octal encoding,
+ # e.g. "\101\102" == "AB"
+ # Quotation marks can be entered by escaping them,
+ # e.g. "foo\"bar"
+ #
+ # A note on security: The security of the RADIUS protocol
+ # depends COMPLETELY on this secret! We recommend using a
+ # shared secret that is composed of:
+ #
+ # upper case letters
+ # lower case letters
+ # numbers
+ #
+ # And is at LEAST 8 characters long, preferably 16 characters in
+ # length. The secret MUST be random, and should not be words,
+ # phrase, or anything else that is recognizable.
+ #
+ # The default secret below is only for testing, and should
+ # not be used in any real environment.
+ #
+ secret = dec0071981b1
+
+ #
+ # Old-style clients do not send a Message-Authenticator
+ # in an Access-Request. RFC 5080 suggests that all clients
+ # SHOULD include it in an Access-Request. The configuration
+ # item below allows the server to require it. If a client
+ # is required to include a Message-Authenticator and it does
+ # not, then the packet will be silently discarded.
+ #
+ # allowed values: yes, no
+ require_message_authenticator = no
+
+ #
+ # The short name is used as an alias for the fully qualified
+ # domain name, or the IP address.
+ #
+ # It is accepted for compatibility with 1.x, but it is no
+ # longer necessary in 2.0
+ #
+# shortname = localhost
+
+ #
+ # the following three fields are optional, but may be used by
+ # checkrad.pl for simultaneous use checks
+ #
+
+ #
+ # The nastype tells 'checkrad.pl' which NAS-specific method to
+ # use to query the NAS for simultaneous use.
+ #
+ # Permitted NAS types are:
+ #
+ # cisco
+ # computone
+ # livingston
+ # juniper
+ # max40xx
+ # multitech
+ # netserver
+ # pathras
+ # patton
+ # portslave
+ # tc
+ # usrhiper
+ # other # for all other types
+
+ #
+ nastype = other # localhost isn't usually a NAS...
+
+ #
+ # The following two configurations are for future use.
+ # The 'naspasswd' file is currently used to store the NAS
+ # login name and password, which is used by checkrad.pl
+ # when querying the NAS for simultaneous use.
+ #
+# login = !root
+# password = someadminpas
+
+ #
+ # As of 2.0, clients can also be tied to a virtual server.
+ # This is done by setting the "virtual_server" configuration
+ # item, as in the example below.
+ #
+# virtual_server = home1
+
+ #
+ # A pointer to the "home_server_pool" OR a "home_server"
+ # section that contains the CoA configuration for this
+ # client. For an example of a coa home server or pool,
+ # see raddb/sites-available/originate-coa
+# coa_server = coa
+}
diff --git a/docs/freeradius/raddb/radiusd.conf b/docs/freeradius/raddb/radiusd.conf
new file mode 100644
index 000000000..d34aae69b
--- /dev/null
+++ b/docs/freeradius/raddb/radiusd.conf
@@ -0,0 +1,818 @@
+# -*- text -*-
+##
+## radiusd.conf -- FreeRADIUS server configuration file.
+##
+## http://www.freeradius.org/
+## $Id$
+##
+
+######################################################################
+#
+# Read "man radiusd" before editing this file. See the section
+# titled DEBUGGING. It outlines a method where you can quickly
+# obtain the configuration you want, without running into
+# trouble.
+#
+# Run the server in debugging mode, and READ the output.
+#
+# $ radiusd -X
+#
+# We cannot emphasize this point strongly enough. The vast
+# majority of problems can be solved by carefully reading the
+# debugging output, which includes warnings about common issues,
+# and suggestions for how they may be fixed.
+#
+# There may be a lot of output, but look carefully for words like:
+# "warning", "error", "reject", or "failure". The messages there
+# will usually be enough to guide you to a solution.
+#
+# If you are going to ask a question on the mailing list, then
+# explain what you are trying to do, and include the output from
+# debugging mode (radiusd -X). Failure to do so means that all
+# of the responses to your question will be people telling you
+# to "post the output of radiusd -X".
+
+######################################################################
+#
+# The location of other config files and logfiles are declared
+# in this file.
+#
+# Also general configuration for modules can be done in this
+# file, it is exported through the API to modules that ask for
+# it.
+#
+# See "man radiusd.conf" for documentation on the format of this
+# file. Note that the individual configuration items are NOT
+# documented in that "man" page. They are only documented here,
+# in the comments.
+#
+# As of 2.0.0, FreeRADIUS supports a simple processing language
+# in the "authorize", "authenticate", "accounting", etc. sections.
+# See "man unlang" for details.
+#
+
+prefix = /usr/local
+exec_prefix = ${prefix}
+sysconfdir = ${prefix}/etc
+localstatedir = /var
+sbindir = ${exec_prefix}/sbin
+logdir = /var/log
+raddbdir = ${sysconfdir}/raddb
+radacctdir = ${logdir}/radacct
+
+#
+# name of the running server. See also the "-n" command-line option.
+name = radiusd
+
+# Location of config and logfiles.
+confdir = ${raddbdir}
+run_dir = ${localstatedir}/run/${name}
+
+# Should likely be ${localstatedir}/lib/radiusd
+db_dir = ${raddbdir}
+
+#
+# libdir: Where to find the rlm_* modules.
+#
+# This should be automatically set at configuration time.
+#
+# If the server builds and installs, but fails at execution time
+# with an 'undefined symbol' error, then you can use the libdir
+# directive to work around the problem.
+#
+# The cause is usually that a library has been installed on your
+# system in a place where the dynamic linker CANNOT find it. When
+# executing as root (or another user), your personal environment MAY
+# be set up to allow the dynamic linker to find the library. When
+# executing as a daemon, FreeRADIUS MAY NOT have the same
+# personalized configuration.
+#
+# To work around the problem, find out which library contains that symbol,
+# and add the directory containing that library to the end of 'libdir',
+# with a colon separating the directory names. NO spaces are allowed.
+#
+# e.g. libdir = /usr/local/lib:/opt/package/lib
+#
+# You can also try setting the LD_LIBRARY_PATH environment variable
+# in a script which starts the server.
+#
+# If that does not work, then you can re-configure and re-build the
+# server to NOT use shared libraries, via:
+#
+# ./configure --disable-shared
+# make
+# make install
+#
+libdir = /usr/local/lib/freeradius-2.2.0
+
+# pidfile: Where to place the PID of the RADIUS server.
+#
+# The server may be signalled while it's running by using this
+# file.
+#
+# This file is written when ONLY running in daemon mode.
+#
+# e.g.: kill -HUP `cat /var/run/radiusd/radiusd.pid`
+#
+pidfile = ${run_dir}/${name}.pid
+
+# chroot: directory where the server does "chroot".
+#
+# The chroot is done very early in the process of starting the server.
+# After the chroot has been performed it switches to the "user" listed
+# below (which MUST be specified). If "group" is specified, it switchs
+# to that group, too. Any other groups listed for the specified "user"
+# in "/etc/group" are also added as part of this process.
+#
+# The current working directory (chdir / cd) is left *outside* of the
+# chroot until all of the modules have been initialized. This allows
+# the "raddb" directory to be left outside of the chroot. Once the
+# modules have been initialized, it does a "chdir" to ${logdir}. This
+# means that it should be impossible to break out of the chroot.
+#
+# If you are worried about security issues related to this use of chdir,
+# then simply ensure that the "raddb" directory is inside of the chroot,
+# end be sure to do "cd raddb" BEFORE starting the server.
+#
+# If the server is statically linked, then the only files that have
+# to exist in the chroot are ${run_dir} and ${logdir}. If you do the
+# "cd raddb" as discussed above, then the "raddb" directory has to be
+# inside of the chroot directory, too.
+#
+#chroot = /path/to/chroot/directory
+
+# user/group: The name (or #number) of the user/group to run radiusd as.
+#
+# If these are commented out, the server will run as the user/group
+# that started it. In order to change to a different user/group, you
+# MUST be root ( or have root privleges ) to start the server.
+#
+# We STRONGLY recommend that you run the server with as few permissions
+# as possible. That is, if you're not using shadow passwords, the
+# user and group items below should be set to radius'.
+#
+# NOTE that some kernels refuse to setgid(group) when the value of
+# (unsigned)group is above 60000; don't use group nobody on these systems!
+#
+# On systems with shadow passwords, you might have to set 'group = shadow'
+# for the server to be able to read the shadow password file. If you can
+# authenticate users while in debug mode, but not in daemon mode, it may be
+# that the debugging mode server is running as a user that can read the
+# shadow info, and the user listed below can not.
+#
+# The server will also try to use "initgroups" to read /etc/groups.
+# It will join all groups where "user" is a member. This can allow
+# for some finer-grained access controls.
+#
+user = freeradius
+group = freeradius
+
+# max_request_time: The maximum time (in seconds) to handle a request.
+#
+# Requests which take more time than this to process may be killed, and
+# a REJECT message is returned.
+#
+# WARNING: If you notice that requests take a long time to be handled,
+# then this MAY INDICATE a bug in the server, in one of the modules
+# used to handle a request, OR in your local configuration.
+#
+# This problem is most often seen when using an SQL database. If it takes
+# more than a second or two to receive an answer from the SQL database,
+# then it probably means that you haven't indexed the database. See your
+# SQL server documentation for more information.
+#
+# Useful range of values: 5 to 120
+#
+max_request_time = 30
+
+# cleanup_delay: The time to wait (in seconds) before cleaning up
+# a reply which was sent to the NAS.
+#
+# The RADIUS request is normally cached internally for a short period
+# of time, after the reply is sent to the NAS. The reply packet may be
+# lost in the network, and the NAS will not see it. The NAS will then
+# re-send the request, and the server will respond quickly with the
+# cached reply.
+#
+# If this value is set too low, then duplicate requests from the NAS
+# MAY NOT be detected, and will instead be handled as seperate requests.
+#
+# If this value is set too high, then the server will cache too many
+# requests, and some new requests may get blocked. (See 'max_requests'.)
+#
+# Useful range of values: 2 to 10
+#
+cleanup_delay = 5
+
+# max_requests: The maximum number of requests which the server keeps
+# track of. This should be 256 multiplied by the number of clients.
+# e.g. With 4 clients, this number should be 1024.
+#
+# If this number is too low, then when the server becomes busy,
+# it will not respond to any new requests, until the 'cleanup_delay'
+# time has passed, and it has removed the old requests.
+#
+# If this number is set too high, then the server will use a bit more
+# memory for no real benefit.
+#
+# If you aren't sure what it should be set to, it's better to set it
+# too high than too low. Setting it to 1000 per client is probably
+# the highest it should be.
+#
+# Useful range of values: 256 to infinity
+#
+max_requests = 1024
+
+# listen: Make the server listen on a particular IP address, and send
+# replies out from that address. This directive is most useful for
+# hosts with multiple IP addresses on one interface.
+#
+# If you want the server to listen on additional addresses, or on
+# additionnal ports, you can use multiple "listen" sections.
+#
+# Each section make the server listen for only one type of packet,
+# therefore authentication and accounting have to be configured in
+# different sections.
+#
+# The server ignore all "listen" section if you are using '-i' and '-p'
+# on the command line.
+#
+listen {
+ # Type of packets to listen for.
+ # Allowed values are:
+ # auth listen for authentication packets
+ # acct listen for accounting packets
+ # proxy IP to use for sending proxied packets
+ # detail Read from the detail file. For examples, see
+ # raddb/sites-available/copy-acct-to-home-server
+ # status listen for Status-Server packets. For examples,
+ # see raddb/sites-available/status
+ # coa listen for CoA-Request and Disconnect-Request
+ # packets. For examples, see the file
+ # raddb/sites-available/coa
+ #
+ type = auth
+
+ # Note: "type = proxy" lets you control the source IP used for
+ # proxying packets, with some limitations:
+ #
+ # * A proxy listener CANNOT be used in a virtual server section.
+ # * You should probably set "port = 0".
+ # * Any "clients" configuration will be ignored.
+ #
+ # See also proxy.conf, and the "src_ipaddr" configuration entry
+ # in the sample "home_server" section. When you specify the
+ # source IP address for packets sent to a home server, the
+ # proxy listeners are automatically created.
+
+ # IP address on which to listen.
+ # Allowed values are:
+ # dotted quad (1.2.3.4)
+ # hostname (radius.example.com)
+ # wildcard (*)
+ ipaddr = *
+
+ # OR, you can use an IPv6 address, but not both
+ # at the same time.
+# ipv6addr = :: # any. ::1 == localhost
+
+ # Port on which to listen.
+ # Allowed values are:
+ # integer port number (1812)
+ # 0 means "use /etc/services for the proper port"
+ port = 0
+
+ # Some systems support binding to an interface, in addition
+ # to the IP address. This feature isn't strictly necessary,
+ # but for sites with many IP addresses on one interface,
+ # it's useful to say "listen on all addresses for eth0".
+ #
+ # If your system does not support this feature, you will
+ # get an error if you try to use it.
+ #
+# interface = eth0
+
+ # Per-socket lists of clients. This is a very useful feature.
+ #
+ # The name here is a reference to a section elsewhere in
+ # radiusd.conf, or clients.conf. Having the name as
+ # a reference allows multiple sockets to use the same
+ # set of clients.
+ #
+ # If this configuration is used, then the global list of clients
+ # is IGNORED for this "listen" section. Take care configuring
+ # this feature, to ensure you don't accidentally disable a
+ # client you need.
+ #
+ # See clients.conf for the configuration of "per_socket_clients".
+ #
+# clients = per_socket_clients
+}
+
+# This second "listen" section is for listening on the accounting
+# port, too.
+#
+listen {
+ ipaddr = *
+# ipv6addr = ::
+ port = 0
+ type = acct
+# interface = eth0
+# clients = per_socket_clients
+}
+
+# hostname_lookups: Log the names of clients or just their IP addresses
+# e.g., www.freeradius.org (on) or 206.47.27.232 (off).
+#
+# The default is 'off' because it would be overall better for the net
+# if people had to knowingly turn this feature on, since enabling it
+# means that each client request will result in AT LEAST one lookup
+# request to the nameserver. Enabling hostname_lookups will also
+# mean that your server may stop randomly for 30 seconds from time
+# to time, if the DNS requests take too long.
+#
+# Turning hostname lookups off also means that the server won't block
+# for 30 seconds, if it sees an IP address which has no name associated
+# with it.
+#
+# allowed values: {no, yes}
+#
+hostname_lookups = no
+
+# Core dumps are a bad thing. This should only be set to 'yes'
+# if you're debugging a problem with the server.
+#
+# allowed values: {no, yes}
+#
+allow_core_dumps = no
+
+# Regular expressions
+#
+# These items are set at configure time. If they're set to "yes",
+# then setting them to "no" turns off regular expression support.
+#
+# If they're set to "no" at configure time, then setting them to "yes"
+# WILL NOT WORK. It will give you an error.
+#
+regular_expressions = yes
+extended_expressions = yes
+
+#
+# Logging section. The various "log_*" configuration items
+# will eventually be moved here.
+#
+log {
+ #
+ # Destination for log messages. This can be one of:
+ #
+ # files - log to "file", as defined below.
+ # syslog - to syslog (see also the "syslog_facility", below.
+ # stdout - standard output
+ # stderr - standard error.
+ #
+ # The command-line option "-X" over-rides this option, and forces
+ # logging to go to stdout.
+ #
+ destination = files
+
+ #
+ # The logging messages for the server are appended to the
+ # tail of this file if destination == "files"
+ #
+ # If the server is running in debugging mode, this file is
+ # NOT used.
+ #
+ file = ${logdir}/radius.log
+
+ #
+ # If this configuration parameter is set, then log messages for
+ # a *request* go to this file, rather than to radius.log.
+ #
+ # i.e. This is a log file per request, once the server has accepted
+ # the request as being from a valid client. Messages that are
+ # not associated with a request still go to radius.log.
+ #
+ # Not all log messages in the server core have been updated to use
+ # this new internal API. As a result, some messages will still
+ # go to radius.log. Please submit patches to fix this behavior.
+ #
+ # The file name is expanded dynamically. You should ONLY user
+ # server-side attributes for the filename (e.g. things you control).
+ # Using this feature MAY also slow down the server substantially,
+ # especially if you do thinks like SQL calls as part of the
+ # expansion of the filename.
+ #
+ # The name of the log file should use attributes that don't change
+ # over the lifetime of a request, such as User-Name,
+ # Virtual-Server or Packet-Src-IP-Address. Otherwise, the log
+ # messages will be distributed over multiple files.
+ #
+ # Logging can be enabled for an individual request by a special
+ # dynamic expansion macro: %{debug: 1}, where the debug level
+ # for this request is set to '1' (or 2, 3, etc.). e.g.
+ #
+ # ...
+ # update control {
+ # Tmp-String-0 = "%{debug:1}"
+ # }
+ # ...
+ #
+ # The attribute that the value is assigned to is unimportant,
+ # and should be a "throw-away" attribute with no side effects.
+ #
+ #requests = ${logdir}/radiusd-%{%{Virtual-Server}:-DEFAULT}-%Y%m%d.log
+
+ #
+ # Which syslog facility to use, if ${destination} == "syslog"
+ #
+ # The exact values permitted here are OS-dependent. You probably
+ # don't want to change this.
+ #
+ syslog_facility = daemon
+
+ # Log the full User-Name attribute, as it was found in the request.
+ #
+ # allowed values: {no, yes}
+ #
+ stripped_names = no
+
+ # Log authentication requests to the log file.
+ #
+ # allowed values: {no, yes}
+ #
+ auth = yes
+
+ # Log passwords with the authentication requests.
+ # auth_badpass - logs password if it's rejected
+ # auth_goodpass - logs password if it's correct
+ #
+ # allowed values: {no, yes}
+ #
+ auth_badpass = yes
+ auth_goodpass = no
+
+ # Log additional text at the end of the "Login OK" messages.
+ # for these to work, the "auth" and "auth_goopass" or "auth_badpass"
+ # configurations above have to be set to "yes".
+ #
+ # The strings below are dynamically expanded, which means that
+ # you can put anything you want in them. However, note that
+ # this expansion can be slow, and can negatively impact server
+ # performance.
+ #
+# msg_goodpass = ""
+# msg_badpass = ""
+}
+
+# The program to execute to do concurrency checks.
+checkrad = ${sbindir}/checkrad
+
+# SECURITY CONFIGURATION
+#
+# There may be multiple methods of attacking on the server. This
+# section holds the configuration items which minimize the impact
+# of those attacks
+#
+security {
+ #
+ # max_attributes: The maximum number of attributes
+ # permitted in a RADIUS packet. Packets which have MORE
+ # than this number of attributes in them will be dropped.
+ #
+ # If this number is set too low, then no RADIUS packets
+ # will be accepted.
+ #
+ # If this number is set too high, then an attacker may be
+ # able to send a small number of packets which will cause
+ # the server to use all available memory on the machine.
+ #
+ # Setting this number to 0 means "allow any number of attributes"
+ max_attributes = 200
+
+ #
+ # reject_delay: When sending an Access-Reject, it can be
+ # delayed for a few seconds. This may help slow down a DoS
+ # attack. It also helps to slow down people trying to brute-force
+ # crack a users password.
+ #
+ # Setting this number to 0 means "send rejects immediately"
+ #
+ # If this number is set higher than 'cleanup_delay', then the
+ # rejects will be sent at 'cleanup_delay' time, when the request
+ # is deleted from the internal cache of requests.
+ #
+ # Useful ranges: 1 to 5
+ reject_delay = 1
+
+ #
+ # status_server: Whether or not the server will respond
+ # to Status-Server requests.
+ #
+ # When sent a Status-Server message, the server responds with
+ # an Access-Accept or Accounting-Response packet.
+ #
+ # This is mainly useful for administrators who want to "ping"
+ # the server, without adding test users, or creating fake
+ # accounting packets.
+ #
+ # It's also useful when a NAS marks a RADIUS server "dead".
+ # The NAS can periodically "ping" the server with a Status-Server
+ # packet. If the server responds, it must be alive, and the
+ # NAS can start using it for real requests.
+ #
+ # See also raddb/sites-available/status
+ #
+ status_server = yes
+}
+
+# PROXY CONFIGURATION
+#
+# proxy_requests: Turns proxying of RADIUS requests on or off.
+#
+# The server has proxying turned on by default. If your system is NOT
+# set up to proxy requests to another server, then you can turn proxying
+# off here. This will save a small amount of resources on the server.
+#
+# If you have proxying turned off, and your configuration files say
+# to proxy a request, then an error message will be logged.
+#
+# To disable proxying, change the "yes" to "no", and comment the
+# $INCLUDE line.
+#
+# allowed values: {no, yes}
+#
+proxy_requests = yes
+$INCLUDE proxy.conf
+
+
+# CLIENTS CONFIGURATION
+#
+# Client configuration is defined in "clients.conf".
+#
+
+# The 'clients.conf' file contains all of the information from the old
+# 'clients' and 'naslist' configuration files. We recommend that you
+# do NOT use 'client's or 'naslist', although they are still
+# supported.
+#
+# Anything listed in 'clients.conf' will take precedence over the
+# information from the old-style configuration files.
+#
+$INCLUDE clients.conf
+
+
+# THREAD POOL CONFIGURATION
+#
+# The thread pool is a long-lived group of threads which
+# take turns (round-robin) handling any incoming requests.
+#
+# You probably want to have a few spare threads around,
+# so that high-load situations can be handled immediately. If you
+# don't have any spare threads, then the request handling will
+# be delayed while a new thread is created, and added to the pool.
+#
+# You probably don't want too many spare threads around,
+# otherwise they'll be sitting there taking up resources, and
+# not doing anything productive.
+#
+# The numbers given below should be adequate for most situations.
+#
+thread pool {
+ # Number of servers to start initially --- should be a reasonable
+ # ballpark figure.
+ start_servers = 5
+
+ # Limit on the total number of servers running.
+ #
+ # If this limit is ever reached, clients will be LOCKED OUT, so it
+ # should NOT BE SET TOO LOW. It is intended mainly as a brake to
+ # keep a runaway server from taking the system with it as it spirals
+ # down...
+ #
+ # You may find that the server is regularly reaching the
+ # 'max_servers' number of threads, and that increasing
+ # 'max_servers' doesn't seem to make much difference.
+ #
+ # If this is the case, then the problem is MOST LIKELY that
+ # your back-end databases are taking too long to respond, and
+ # are preventing the server from responding in a timely manner.
+ #
+ # The solution is NOT do keep increasing the 'max_servers'
+ # value, but instead to fix the underlying cause of the
+ # problem: slow database, or 'hostname_lookups=yes'.
+ #
+ # For more information, see 'max_request_time', above.
+ #
+ max_servers = 32
+
+ # Server-pool size regulation. Rather than making you guess
+ # how many servers you need, FreeRADIUS dynamically adapts to
+ # the load it sees, that is, it tries to maintain enough
+ # servers to handle the current load, plus a few spare
+ # servers to handle transient load spikes.
+ #
+ # It does this by periodically checking how many servers are
+ # waiting for a request. If there are fewer than
+ # min_spare_servers, it creates a new spare. If there are
+ # more than max_spare_servers, some of the spares die off.
+ # The default values are probably OK for most sites.
+ #
+ min_spare_servers = 3
+ max_spare_servers = 10
+
+ # When the server receives a packet, it places it onto an
+ # internal queue, where the worker threads (configured above)
+ # pick it up for processing. The maximum size of that queue
+ # is given here.
+ #
+ # When the queue is full, any new packets will be silently
+ # discarded.
+ #
+ # The most common cause of the queue being full is that the
+ # server is dependent on a slow database, and it has received
+ # a large "spike" of traffic. When that happens, there is
+ # very little you can do other than make sure the server
+ # receives less traffic, or make sure that the database can
+ # handle the load.
+ #
+# max_queue_size = 65536
+
+ # There may be memory leaks or resource allocation problems with
+ # the server. If so, set this value to 300 or so, so that the
+ # resources will be cleaned up periodically.
+ #
+ # This should only be necessary if there are serious bugs in the
+ # server which have not yet been fixed.
+ #
+ # '0' is a special value meaning 'infinity', or 'the servers never
+ # exit'
+ max_requests_per_server = 0
+}
+
+# MODULE CONFIGURATION
+#
+# The names and configuration of each module is located in this section.
+#
+# After the modules are defined here, they may be referred to by name,
+# in other sections of this configuration file.
+#
+modules {
+ #
+ # Each module has a configuration as follows:
+ #
+ # name [ instance ] {
+ # config_item = value
+ # ...
+ # }
+ #
+ # The 'name' is used to load the 'rlm_name' library
+ # which implements the functionality of the module.
+ #
+ # The 'instance' is optional. To have two different instances
+ # of a module, it first must be referred to by 'name'.
+ # The different copies of the module are then created by
+ # inventing two 'instance' names, e.g. 'instance1' and 'instance2'
+ #
+ # The instance names can then be used in later configuration
+ # INSTEAD of the original 'name'. See the 'radutmp' configuration
+ # for an example.
+ #
+
+ #
+ # As of 2.0.5, most of the module configurations are in a
+ # sub-directory. Files matching the regex /[a-zA-Z0-9_.]+/
+ # are loaded. The modules are initialized ONLY if they are
+ # referenced in a processing section, such as authorize,
+ # authenticate, accounting, pre/post-proxy, etc.
+ #
+ $INCLUDE ${confdir}/modules/
+
+ # Extensible Authentication Protocol
+ #
+ # For all EAP related authentications.
+ # Now in another file, because it is very large.
+ #
+ $INCLUDE eap.conf
+
+ # Include another file that has the SQL-related configuration.
+ # This is another file only because it tends to be big.
+ #
+ $INCLUDE sql.conf
+
+ #
+ # This module is an SQL enabled version of the counter module.
+ #
+ # Rather than maintaining seperate (GDBM) databases of
+ # accounting info for each counter, this module uses the data
+ # stored in the raddacct table by the sql modules. This
+ # module NEVER does any database INSERTs or UPDATEs. It is
+ # totally dependent on the SQL module to process Accounting
+ # packets.
+ #
+# $INCLUDE sql/mysql/counter.conf
+
+ #
+ # IP addresses managed in an SQL table.
+ #
+# $INCLUDE sqlippool.conf
+}
+
+# Instantiation
+#
+# This section orders the loading of the modules. Modules
+# listed here will get loaded BEFORE the later sections like
+# authorize, authenticate, etc. get examined.
+#
+# This section is not strictly needed. When a section like
+# authorize refers to a module, it's automatically loaded and
+# initialized. However, some modules may not be listed in any
+# of the following sections, so they can be listed here.
+#
+# Also, listing modules here ensures that you have control over
+# the order in which they are initalized. If one module needs
+# something defined by another module, you can list them in order
+# here, and ensure that the configuration will be OK.
+#
+instantiate {
+ #
+ # Allows the execution of external scripts.
+ # The entire command line (and output) must fit into 253 bytes.
+ #
+ # e.g. Framed-Pool = `%{exec:/bin/echo foo}`
+# exec
+
+ #
+ # The expression module doesn't do authorization,
+ # authentication, or accounting. It only does dynamic
+ # translation, of the form:
+ #
+ # Session-Timeout = `%{expr:2 + 3}`
+ #
+ # So the module needs to be instantiated, but CANNOT be
+ # listed in any other section. See 'doc/rlm_expr' for
+ # more information.
+ #
+# expr
+
+ #
+ # We add the counter module here so that it registers
+ # the check-name attribute before any module which sets
+ # it
+# daily
+# expiration
+# logintime
+
+ # subsections here can be thought of as "virtual" modules.
+ #
+ # e.g. If you have two redundant SQL servers, and you want to
+ # use them in the authorize and accounting sections, you could
+ # place a "redundant" block in each section, containing the
+ # exact same text. Or, you could uncomment the following
+ # lines, and list "redundant_sql" in the authorize and
+ # accounting sections.
+ #
+ #redundant redundant_sql {
+ # sql1
+ # sql2
+ #}
+}
+
+######################################################################
+#
+# Policies that can be applied in multiple places are listed
+# globally. That way, they can be defined once, and referred
+# to multiple times.
+#
+######################################################################
+$INCLUDE policy.conf
+
+######################################################################
+#
+# Load virtual servers.
+#
+# This next $INCLUDE line loads files in the directory that
+# match the regular expression: /[a-zA-Z0-9_.]+/
+#
+# It allows you to define new virtual servers simply by placing
+# a file into the raddb/sites-enabled/ directory.
+#
+$INCLUDE sites-enabled/
+
+######################################################################
+#
+# All of the other configuration sections like "authorize {}",
+# "authenticate {}", "accounting {}", have been moved to the
+# the file:
+#
+# raddb/sites-available/default
+#
+# This is the "default" virtual server that has the same
+# configuration as in version 1.0.x and 1.1.x. The default
+# installation enables this virtual server. You should
+# edit it to create policies for your local site.
+#
+# For more documentation on virtual servers, see:
+#
+# raddb/sites-available/README
+#
+######################################################################
diff --git a/docs/freeradius/raddb/sites-avaliable/default b/docs/freeradius/raddb/sites-avaliable/default
new file mode 100644
index 000000000..573bf3800
--- /dev/null
+++ b/docs/freeradius/raddb/sites-avaliable/default
@@ -0,0 +1,648 @@
+######################################################################
+#
+# As of 2.0.0, FreeRADIUS supports virtual hosts using the
+# "server" section, and configuration directives.
+#
+# Virtual hosts should be put into the "sites-available"
+# directory. Soft links should be created in the "sites-enabled"
+# directory to these files. This is done in a normal installation.
+#
+# If you are using 802.1X (EAP) authentication, please see also
+# the "inner-tunnel" virtual server. You wll likely have to edit
+# that, too, for authentication to work.
+#
+# $Id$
+#
+######################################################################
+#
+# Read "man radiusd" before editing this file. See the section
+# titled DEBUGGING. It outlines a method where you can quickly
+# obtain the configuration you want, without running into
+# trouble. See also "man unlang", which documents the format
+# of this file.
+#
+# This configuration is designed to work in the widest possible
+# set of circumstances, with the widest possible number of
+# authentication methods. This means that in general, you should
+# need to make very few changes to this file.
+#
+# The best way to configure the server for your local system
+# is to CAREFULLY edit this file. Most attempts to make large
+# edits to this file will BREAK THE SERVER. Any edits should
+# be small, and tested by running the server with "radiusd -X".
+# Once the edits have been verified to work, save a copy of these
+# configuration files somewhere. (e.g. as a "tar" file). Then,
+# make more edits, and test, as above.
+#
+# There are many "commented out" references to modules such
+# as ldap, sql, etc. These references serve as place-holders.
+# If you need the functionality of that module, then configure
+# it in radiusd.conf, and un-comment the references to it in
+# this file. In most cases, those small changes will result
+# in the server being able to connect to the DB, and to
+# authenticate users.
+#
+######################################################################
+
+#
+# In 1.x, the "authorize", etc. sections were global in
+# radiusd.conf. As of 2.0, they SHOULD be in a server section.
+#
+# The server section with no virtual server name is the "default"
+# section. It is used when no server name is specified.
+#
+# We don't indent the rest of this file, because doing so
+# would make it harder to read.
+#
+
+# Authorization. First preprocess (hints and huntgroups files),
+# then realms, and finally look in the "users" file.
+#
+# Any changes made here should also be made to the "inner-tunnel"
+# virtual server.
+#
+# The order of the realm modules will determine the order that
+# we try to find a matching realm.
+#
+# Make *sure* that 'preprocess' comes before any realm if you
+# need to setup hints for the remote radius server
+authorize {
+ #
+ # Security settings. Take a User-Name, and do some simple
+ # checks on it, for spaces and other invalid characters. If
+ # it looks like the user is trying to play games, reject it.
+ #
+ # This should probably be enabled by default.
+ #
+ # See policy.conf for the definition of the filter_username policy.
+ #
+# filter_username
+
+ #
+ # The preprocess module takes care of sanitizing some bizarre
+ # attributes in the request, and turning them into attributes
+ # which are more standard.
+ #
+ # It takes care of processing the 'raddb/hints' and the
+ # 'raddb/huntgroups' files.
+ preprocess
+
+ #
+ # If you want to have a log of authentication requests,
+ # un-comment the following line, and the 'detail auth_log'
+ # section, above.
+# auth_log
+
+ #
+ # The chap module will set 'Auth-Type := CHAP' if we are
+ # handling a CHAP request and Auth-Type has not already been set
+ chap
+
+ #
+ # If the users are logging in with an MS-CHAP-Challenge
+ # attribute for authentication, the mschap module will find
+ # the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
+ # to the request, which will cause the server to then use
+ # the mschap module for authentication.
+ mschap
+
+ #
+ # If you have a Cisco SIP server authenticating against
+ # FreeRADIUS, uncomment the following line, and the 'digest'
+ # line in the 'authenticate' section.
+ digest
+
+ #
+ # The WiMAX specification says that the Calling-Station-Id
+ # is 6 octets of the MAC. This definition conflicts with
+ # RFC 3580, and all common RADIUS practices. Un-commenting
+ # the "wimax" module here means that it will fix the
+ # Calling-Station-Id attribute to the normal format as
+ # specified in RFC 3580 Section 3.21
+# wimax
+
+ #
+ # Look for IPASS style 'realm/', and if not found, look for
+ # '@realm', and decide whether or not to proxy, based on
+ # that.
+# IPASS
+
+ #
+ # If you are using multiple kinds of realms, you probably
+ # want to set "ignore_null = yes" for all of them.
+ # Otherwise, when the first style of realm doesn't match,
+ # the other styles won't be checked.
+ #
+ suffix
+# ntdomain
+
+ #
+ # This module takes care of EAP-MD5, EAP-TLS, and EAP-LEAP
+ # authentication.
+ #
+ # It also sets the EAP-Type attribute in the request
+ # attribute list to the EAP type from the packet.
+ #
+ # As of 2.0, the EAP module returns "ok" in the authorize stage
+ # for TTLS and PEAP. In 1.x, it never returned "ok" here, so
+ # this change is compatible with older configurations.
+ #
+ # The example below uses module failover to avoid querying all
+ # of the following modules if the EAP module returns "ok".
+ # Therefore, your LDAP and/or SQL servers will not be queried
+ # for the many packets that go back and forth to set up TTLS
+ # or PEAP. The load on those servers will therefore be reduced.
+ #
+ eap {
+ ok = return
+ }
+
+ #
+ # Pull crypt'd passwords from /etc/passwd or /etc/shadow,
+ # using the system API's to get the password. If you want
+ # to read /etc/passwd or /etc/shadow directly, see the
+ # passwd module in radiusd.conf.
+ #
+# unix
+
+ #
+ # Read the 'users' file
+ files
+
+ #
+ # Look in an SQL database. The schema of the database
+ # is meant to mirror the "users" file.
+ #
+ # See "Authorization Queries" in sql.conf
+ sql
+
+ #
+ # If you are using /etc/smbpasswd, and are also doing
+ # mschap authentication, the un-comment this line, and
+ # configure the 'etc_smbpasswd' module, above.
+# etc_smbpasswd
+
+ #
+ # The ldap module will set Auth-Type to LDAP if it has not
+ # already been set
+# ldap
+
+ #
+ # Enforce daily limits on time spent logged in.
+# daily
+
+ #
+ # Use the checkval module
+# checkval
+
+ expiration
+ logintime
+
+ #
+ # If no other module has claimed responsibility for
+ # authentication, then try to use PAP. This allows the
+ # other modules listed above to add a "known good" password
+ # to the request, and to do nothing else. The PAP module
+ # will then see that password, and use it to do PAP
+ # authentication.
+ #
+ # This module should be listed last, so that the other modules
+ # get a chance to set Auth-Type for themselves.
+ #
+ pap
+
+ #
+ # If "status_server = yes", then Status-Server messages are passed
+ # through the following section, and ONLY the following section.
+ # This permits you to do DB queries, for example. If the modules
+ # listed here return "fail", then NO response is sent.
+ #
+# Autz-Type Status-Server {
+#
+# }
+}
+
+
+# Authentication.
+#
+#
+# This section lists which modules are available for authentication.
+# Note that it does NOT mean 'try each module in order'. It means
+# that a module from the 'authorize' section adds a configuration
+# attribute 'Auth-Type := FOO'. That authentication type is then
+# used to pick the apropriate module from the list below.
+#
+
+# In general, you SHOULD NOT set the Auth-Type attribute. The server
+# will figure it out on its own, and will do the right thing. The
+# most common side effect of erroneously setting the Auth-Type
+# attribute is that one authentication method will work, but the
+# others will not.
+#
+# The common reasons to set the Auth-Type attribute by hand
+# is to either forcibly reject the user (Auth-Type := Reject),
+# or to or forcibly accept the user (Auth-Type := Accept).
+#
+# Note that Auth-Type := Accept will NOT work with EAP.
+#
+# Please do not put "unlang" configurations into the "authenticate"
+# section. Put them in the "post-auth" section instead. That's what
+# the post-auth section is for.
+#
+authenticate {
+ #
+ # PAP authentication, when a back-end database listed
+ # in the 'authorize' section supplies a password. The
+ # password can be clear-text, or encrypted.
+ Auth-Type PAP {
+ pap
+ }
+
+ #
+ # Most people want CHAP authentication
+ # A back-end database listed in the 'authorize' section
+ # MUST supply a CLEAR TEXT password. Encrypted passwords
+ # won't work.
+ Auth-Type CHAP {
+ chap
+ }
+
+ #
+ # MSCHAP authentication.
+ Auth-Type MS-CHAP {
+ mschap
+ }
+
+ #
+ # If you have a Cisco SIP server authenticating against
+ # FreeRADIUS, uncomment the following line, and the 'digest'
+ # line in the 'authorize' section.
+ digest
+
+ #
+ # Pluggable Authentication Modules.
+# pam
+
+ #
+ # See 'man getpwent' for information on how the 'unix'
+ # module checks the users password. Note that packets
+ # containing CHAP-Password attributes CANNOT be authenticated
+ # against /etc/passwd! See the FAQ for details.
+ #
+ # For normal "crypt" authentication, the "pap" module should
+ # be used instead of the "unix" module. The "unix" module should
+ # be used for authentication ONLY for compatibility with legacy
+ # FreeRADIUS configurations.
+ #
+ unix
+
+ # Uncomment it if you want to use ldap for authentication
+ #
+ # Note that this means "check plain-text password against
+ # the ldap database", which means that EAP won't work,
+ # as it does not supply a plain-text password.
+# Auth-Type LDAP {
+# ldap
+# }
+
+ #
+ # Allow EAP authentication.
+ eap
+
+ #
+ # The older configurations sent a number of attributes in
+ # Access-Challenge packets, which wasn't strictly correct.
+ # If you want to filter out these attributes, uncomment
+ # the following lines.
+ #
+# Auth-Type eap {
+# eap {
+# handled = 1
+# }
+# if (handled && (Response-Packet-Type == Access-Challenge)) {
+# attr_filter.access_challenge.post-auth
+# handled # override the "updated" code from attr_filter
+# }
+# }
+}
+
+
+#
+# Pre-accounting. Decide which accounting type to use.
+#
+preacct {
+ preprocess
+
+ #
+ # Session start times are *implied* in RADIUS.
+ # The NAS never sends a "start time". Instead, it sends
+ # a start packet, *possibly* with an Acct-Delay-Time.
+ # The server is supposed to conclude that the start time
+ # was "Acct-Delay-Time" seconds in the past.
+ #
+ # The code below creates an explicit start time, which can
+ # then be used in other modules.
+ #
+ # The start time is: NOW - delay - session_length
+ #
+
+# update request {
+# FreeRADIUS-Acct-Session-Start-Time = "%{expr: %l - %{%{Acct-Session-Time}:-0} - %{%{Acct-Delay-Time}:-0}}"
+# }
+
+
+ #
+ # Ensure that we have a semi-unique identifier for every
+ # request, and many NAS boxes are broken.
+ acct_unique
+
+ #
+ # Look for IPASS-style 'realm/', and if not found, look for
+ # '@realm', and decide whether or not to proxy, based on
+ # that.
+ #
+ # Accounting requests are generally proxied to the same
+ # home server as authentication requests.
+# IPASS
+ suffix
+# ntdomain
+
+ #
+ # Read the 'acct_users' file
+ files
+}
+
+#
+# Accounting. Log the accounting data.
+#
+accounting {
+ #
+ # Create a 'detail'ed log of the packets.
+ # Note that accounting requests which are proxied
+ # are also logged in the detail file.
+ detail
+# daily
+
+ # Update the wtmp file
+ #
+ # If you don't use "radlast", you can delete this line.
+# unix
+
+ #
+ # For Simultaneous-Use tracking.
+ #
+ # Due to packet losses in the network, the data here
+ # may be incorrect. There is little we can do about it.
+# radutmp
+# sradutmp
+
+ # Return an address to the IP Pool when we see a stop record.
+# main_pool
+
+ #
+ # Log traffic to an SQL database.
+ #
+ # See "Accounting queries" in sql.conf
+ sql
+
+ #
+ # If you receive stop packets with zero session length,
+ # they will NOT be logged in the database. The SQL module
+ # will print a message (only in debugging mode), and will
+ # return "noop".
+ #
+ # You can ignore these packets by uncommenting the following
+ # three lines. Otherwise, the server will not respond to the
+ # accounting request, and the NAS will retransmit.
+ #
+# if (noop) {
+# ok
+# }
+
+ #
+ # Instead of sending the query to the SQL server,
+ # write it into a log file.
+ #
+# sql_log
+
+ # Cisco VoIP specific bulk accounting
+# pgsql-voip
+
+ # For Exec-Program and Exec-Program-Wait
+ exec
+
+ # Filter attributes from the accounting response.
+ attr_filter.accounting_response
+
+ #
+ # See "Autz-Type Status-Server" for how this works.
+ #
+# Acct-Type Status-Server {
+#
+# }
+}
+
+
+# Session database, used for checking Simultaneous-Use. Either the radutmp
+# or rlm_sql module can handle this.
+# The rlm_sql module is *much* faster
+session {
+ radutmp
+
+ #
+ # See "Simultaneous Use Checking Queries" in sql.conf
+ sql
+}
+
+
+# Post-Authentication
+# Once we KNOW that the user has been authenticated, there are
+# additional steps we can take.
+post-auth {
+ # Get an address from the IP Pool.
+# main_pool
+
+ #
+ # If you want to have a log of authentication replies,
+ # un-comment the following line, and the 'detail reply_log'
+ # section, above.
+# reply_log
+
+ #
+ # After authenticating the user, do another SQL query.
+ #
+ # See "Authentication Logging Queries" in sql.conf
+# sql
+
+ #
+ # Instead of sending the query to the SQL server,
+ # write it into a log file.
+ #
+# sql_log
+
+ #
+ # Un-comment the following if you have set
+ # 'edir_account_policy_check = yes' in the ldap module sub-section of
+ # the 'modules' section.
+ #
+# ldap
+
+ # For Exec-Program and Exec-Program-Wait
+ exec
+
+ #
+ # Calculate the various WiMAX keys. In order for this to work,
+ # you will need to define the WiMAX NAI, usually via
+ #
+ # update request {
+ # WiMAX-MN-NAI = "%{User-Name}"
+ # }
+ #
+ # If you want various keys to be calculated, you will need to
+ # update the reply with "template" values. The module will see
+ # this, and replace the template values with the correct ones
+ # taken from the cryptographic calculations. e.g.
+ #
+ # update reply {
+ # WiMAX-FA-RK-Key = 0x00
+ # WiMAX-MSK = "%{EAP-MSK}"
+ # }
+ #
+ # You may want to delete the MS-MPPE-*-Keys from the reply,
+ # as some WiMAX clients behave badly when those attributes
+ # are included. See "raddb/modules/wimax", configuration
+ # entry "delete_mppe_keys" for more information.
+ #
+# wimax
+
+ # If there is a client certificate (EAP-TLS, sometimes PEAP
+ # and TTLS), then some attributes are filled out after the
+ # certificate verification has been performed. These fields
+ # MAY be available during the authentication, or they may be
+ # available only in the "post-auth" section.
+ #
+ # The first set of attributes contains information about the
+ # issuing certificate which is being used. The second
+ # contains information about the client certificate (if
+ # available).
+#
+# update reply {
+# Reply-Message += "%{TLS-Cert-Serial}"
+# Reply-Message += "%{TLS-Cert-Expiration}"
+# Reply-Message += "%{TLS-Cert-Subject}"
+# Reply-Message += "%{TLS-Cert-Issuer}"
+# Reply-Message += "%{TLS-Cert-Common-Name}"
+# Reply-Message += "%{TLS-Cert-Subject-Alt-Name-Email}"
+#
+# Reply-Message += "%{TLS-Client-Cert-Serial}"
+# Reply-Message += "%{TLS-Client-Cert-Expiration}"
+# Reply-Message += "%{TLS-Client-Cert-Subject}"
+# Reply-Message += "%{TLS-Client-Cert-Issuer}"
+# Reply-Message += "%{TLS-Client-Cert-Common-Name}"
+# Reply-Message += "%{TLS-Client-Cert-Subject-Alt-Name-Email}"
+# }
+
+
+ # If the WiMAX module did it's work, you may want to do more
+ # things here, like delete the MS-MPPE-*-Key attributes.
+ #
+ # if (updated) {
+ # update reply {
+ # MS-MPPE-Recv-Key !* 0x00
+ # MS-MPPE-Send-Key !* 0x00
+ # }
+ # }
+
+ #
+ # Access-Reject packets are sent through the REJECT sub-section of the
+ # post-auth section.
+ #
+ # Add the ldap module name (or instance) if you have set
+ # 'edir_account_policy_check = yes' in the ldap module configuration
+ #
+ Post-Auth-Type REJECT {
+ # log failed authentications in SQL, too.
+ sql
+ attr_filter.access_reject
+ }
+}
+
+#
+# When the server decides to proxy a request to a home server,
+# the proxied request is first passed through the pre-proxy
+# stage. This stage can re-write the request, or decide to
+# cancel the proxy.
+#
+# Only a few modules currently have this method.
+#
+pre-proxy {
+# attr_rewrite
+
+ # Uncomment the following line if you want to change attributes
+ # as defined in the preproxy_users file.
+# files
+
+ # Uncomment the following line if you want to filter requests
+ # sent to remote servers based on the rules defined in the
+ # 'attrs.pre-proxy' file.
+# attr_filter.pre-proxy
+
+ # If you want to have a log of packets proxied to a home
+ # server, un-comment the following line, and the
+ # 'detail pre_proxy_log' section, above.
+# pre_proxy_log
+}
+
+#
+# When the server receives a reply to a request it proxied
+# to a home server, the request may be massaged here, in the
+# post-proxy stage.
+#
+post-proxy {
+
+ # If you want to have a log of replies from a home server,
+ # un-comment the following line, and the 'detail post_proxy_log'
+ # section, above.
+# post_proxy_log
+
+# attr_rewrite
+
+ # Uncomment the following line if you want to filter replies from
+ # remote proxies based on the rules defined in the 'attrs' file.
+# attr_filter.post-proxy
+
+ #
+ # If you are proxying LEAP, you MUST configure the EAP
+ # module, and you MUST list it here, in the post-proxy
+ # stage.
+ #
+ # You MUST also use the 'nostrip' option in the 'realm'
+ # configuration. Otherwise, the User-Name attribute
+ # in the proxied request will not match the user name
+ # hidden inside of the EAP packet, and the end server will
+ # reject the EAP request.
+ #
+ eap
+
+ #
+ # If the server tries to proxy a request and fails, then the
+ # request is processed through the modules in this section.
+ #
+ # The main use of this section is to permit robust proxying
+ # of accounting packets. The server can be configured to
+ # proxy accounting packets as part of normal processing.
+ # Then, if the home server goes down, accounting packets can
+ # be logged to a local "detail" file, for processing with
+ # radrelay. When the home server comes back up, radrelay
+ # will read the detail file, and send the packets to the
+ # home server.
+ #
+ # With this configuration, the server always responds to
+ # Accounting-Requests from the NAS, but only writes
+ # accounting packets to disk if the home server is down.
+ #
+# Post-Proxy-Type Fail {
+# detail
+# }
+}
+
diff --git a/docs/freeradius/raddb/sql.conf b/docs/freeradius/raddb/sql.conf
new file mode 100644
index 000000000..457ee5aab
--- /dev/null
+++ b/docs/freeradius/raddb/sql.conf
@@ -0,0 +1,107 @@
+# -*- text -*-
+##
+## sql.conf -- SQL modules
+##
+## $Id$
+
+######################################################################
+#
+# Configuration for the SQL module
+#
+# The database schemas and queries are located in subdirectories:
+#
+# sql/DB/schema.sql Schema
+# sql/DB/dialup.conf Basic dialup (including policy) queries
+# sql/DB/counter.conf counter
+# sql/DB/ippool.conf IP Pools in SQL
+# sql/DB/ippool.sql schema for IP pools.
+#
+# Where "DB" is mysql, mssql, oracle, or postgresql.
+#
+
+sql {
+ #
+ # Set the database to one of:
+ #
+ # mysql, mssql, oracle, postgresql
+ #
+ database = "mysql"
+
+ #
+ # Which FreeRADIUS driver to use.
+ #
+ driver = "rlm_sql_${database}"
+
+ # Connection info:
+ server = "localhost"
+ port = 3306
+ login = "root"
+ password = "password"
+
+ # Database table configuration for everything except Oracle
+ radius_db = "stg"
+ # If you are using Oracle then use this instead
+ # radius_db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=your_sid)))"
+
+ # If you want both stop and start records logged to the
+ # same SQL table, leave this as is. If you want them in
+ # different tables, put the start table in acct_table1
+ # and stop table in acct_table2
+ acct_table1 = "radius_acct"
+ acct_table2 = "radius_acct"
+
+ # Allow for storing data after authentication
+ postauth_table = "radius_postauth"
+
+ authcheck_table = "radius_check"
+ authreply_table = "radius_reply"
+
+ groupcheck_table = "radius_groupcheck"
+ groupreply_table = "radius_groupreply"
+
+ # Table to keep group info
+ usergroup_table = "radius_usergroup"
+
+ # If set to 'yes' (default) we read the group tables
+ # If set to 'no' the user MUST have Fall-Through = Yes in the radreply table
+ read_groups = yes
+
+ # Remove stale session if checkrad does not see a double login
+ deletestalesessions = yes
+
+ # Print all SQL statements when in debug mode (-x)
+ sqltrace = no
+ sqltracefile = ${logdir}/sqltrace.sql
+
+ # number of sql connections to make to server
+ num_sql_socks = 5
+
+ # number of seconds to dely retrying on a failed database
+ # connection (per_socket)
+ connect_failure_retry_delay = 60
+
+ # lifetime of an SQL socket. If you are having network issues
+ # such as TCP sessions expiring, you may need to set the socket
+ # lifetime. If set to non-zero, any open connections will be
+ # closed "lifetime" seconds after they were first opened.
+ lifetime = 0
+
+ # Maximum number of queries used by an SQL socket. If you are
+ # having issues with SQL sockets lasting "too long", you can
+ # limit the number of queries performed over one socket. After
+ # "max_qeuries", the socket will be closed. Use 0 for "no limit".
+ max_queries = 0
+
+ # Set to 'yes' to read radius clients from the database ('nas' table)
+ # Clients will ONLY be read on server startup. For performance
+ # and security reasons, finding clients via SQL queries CANNOT
+ # be done "live" while the server is running.
+ #
+ # readclients = yes
+
+ # Table to keep radius client info
+ nas_table = "radius_clients"
+
+ # Read driver-specific configuration
+ $INCLUDE sql/${database}/dialup.conf
+}
diff --git a/docs/freeradius/raddb/sql/mysql/dialup.conf b/docs/freeradius/raddb/sql/mysql/dialup.conf
new file mode 100644
index 000000000..85c96cce6
--- /dev/null
+++ b/docs/freeradius/raddb/sql/mysql/dialup.conf
@@ -0,0 +1,318 @@
+# -*- text -*-
+##
+## dialup.conf -- MySQL configuration for default schema (schema.sql)
+##
+## $Id$
+
+ # Safe characters list for sql queries. Everything else is replaced
+ # with their mime-encoded equivalents.
+ # The default list should be ok
+ #safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
+
+ #######################################################################
+ # Connection config
+ #######################################################################
+ # The character set is not configurable. The default character set of
+ # the mysql client library is used. To control the character set,
+ # create/edit my.cnf (typically in /etc/mysql/my.cnf or /etc/my.cnf)
+ # and enter
+ # [client]
+ # default-character-set = utf8
+ #
+
+ #######################################################################
+ # Query config: Username
+ #######################################################################
+ # This is the username that will get substituted, escaped, and added
+ # as attribute 'SQL-User-Name'. '%{SQL-User-Name}' should be used below
+ # everywhere a username substitution is needed so you you can be sure
+ # the username passed from the client is escaped properly.
+ #
+ # Uncomment the next line, if you want the sql_user_name to mean:
+ #
+ # Use Stripped-User-Name, if it's there.
+ # Else use User-Name, if it's there,
+ # Else use hard-coded string "DEFAULT" as the user name.
+ #sql_user_name = "%{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}"
+ #
+ sql_user_name = "%{User-Name}"
+
+ #######################################################################
+ # Default profile
+ #######################################################################
+ # This is the default profile. It is found in SQL by group membership.
+ # That means that this profile must be a member of at least one group
+ # which will contain the corresponding check and reply items.
+ # This profile will be queried in the authorize section for every user.
+ # The point is to assign all users a default profile without having to
+ # manually add each one to a group that will contain the profile.
+ # The SQL module will also honor the User-Profile attribute. This
+ # attribute can be set anywhere in the authorize section (ie the users
+ # file). It is found exactly as the default profile is found.
+ # If it is set then it will *overwrite* the default profile setting.
+ # The idea is to select profiles based on checks on the incoming packets,
+ # not on user group membership. For example:
+ # -- users file --
+ # DEFAULT Service-Type == Outbound-User, User-Profile := "outbound"
+ # DEFAULT Service-Type == Framed-User, User-Profile := "framed"
+ #
+ # By default the default_user_profile is not set
+ #
+ #default_user_profile = "DEFAULT"
+
+ #######################################################################
+ # NAS Query
+ #######################################################################
+ # This query retrieves the radius clients
+ #
+ # 0. Row ID (currently unused)
+ # 1. Name (or IP address)
+ # 2. Shortname
+ # 3. Type
+ # 4. Secret
+ # 5. Server
+ #######################################################################
+
+ nas_query = "SELECT id, nasname, shortname, type, secret, server FROM ${nas_table}"
+
+ #######################################################################
+ # Authorization Queries
+ #######################################################################
+ # These queries compare the check items for the user
+ # in ${authcheck_table} and setup the reply items in
+ # ${authreply_table}. You can use any query/tables
+ # you want, but the return data for each row MUST
+ # be in the following order:
+ #
+ # 0. Row ID (currently unused)
+ # 1. UserName/GroupName
+ # 2. Item Attr Name
+ # 3. Item Attr Value
+ # 4. Item Attr Operation
+ #######################################################################
+ # Use these for case sensitive usernames.
+# authorize_check_query = "SELECT id, username, attribute, value, op \
+# FROM ${authcheck_table} \
+# WHERE username = BINARY '%{SQL-User-Name}' \
+# ORDER BY id"
+# authorize_reply_query = "SELECT id, username, attribute, value, op \
+# FROM ${authreply_table} \
+# WHERE username = BINARY '%{SQL-User-Name}' \
+# ORDER BY id"
+
+ # The default queries are case insensitive. (for compatibility with
+ # older versions of FreeRADIUS)
+ authorize_check_query = "SELECT (@cnt := @cnt + 1) as id, UserName, Attribute, Value, op \
+ FROM ${authcheck_table} \
+ CROSS JOIN (SELECT @cnt := 0) AS dummy \
+ WHERE username = '%{SQL-User-Name}' \
+ ORDER BY id"
+ authorize_reply_query = "SELECT (@cnt := @cnt + 1) as id, UserName, Attribute, Value, op \
+ FROM ${authreply_table} \
+ CROSS JOIN (SELECT @cnt := 0) AS dummy \
+ WHERE username = '%{SQL-User-Name}' \
+ ORDER BY id"
+
+ # Use these for case sensitive usernames.
+# group_membership_query = "SELECT groupname \
+# FROM ${usergroup_table} \
+# WHERE username = BINARY '%{SQL-User-Name}' \
+# ORDER BY priority"
+
+ group_membership_query = "SELECT GroupName \
+ FROM ${usergroup_table} \
+ WHERE UserName = '%{SQL-User-Name}' \
+ ORDER BY priority"
+
+ authorize_group_check_query = "SELECT (@cnt := @cnt + 1) as id, GroupName, Attribute, \
+ Value, op \
+ FROM ${groupcheck_table} \
+ CROSS JOIN (SELECT @cnt := 0) AS dummy \
+ WHERE groupname = '%{Sql-Group}' \
+ ORDER BY id"
+ authorize_group_reply_query = "SELECT (@cnt := @cnt + 1) as id, GroupName, Attribute, \
+ Value, op \
+ FROM ${groupreply_table} \
+ CROSS JOIN (SELECT @cnt := 0) AS dummy \
+ WHERE groupname = '%{Sql-Group}' \
+ ORDER BY id"
+
+ #######################################################################
+ # Accounting Queries
+ #######################################################################
+ # accounting_onoff_query - query for Accounting On/Off packets
+ # accounting_update_query - query for Accounting update packets
+ # accounting_update_query_alt - query for Accounting update packets
+ # (alternate in case first query fails)
+ # accounting_start_query - query for Accounting start packets
+ # accounting_start_query_alt - query for Accounting start packets
+ # (alternate in case first query fails)
+ # accounting_stop_query - query for Accounting stop packets
+ # accounting_stop_query_alt - query for Accounting start packets
+ # (alternate in case first query doesn't
+ # affect any existing rows in the table)
+ #######################################################################
+ accounting_onoff_query = "\
+ UPDATE ${acct_table1} \
+ SET \
+ acctstoptime = '%S', \
+ acctsessiontime = unix_timestamp('%S') - \
+ unix_timestamp(acctstarttime), \
+ acctterminatecause = '%{Acct-Terminate-Cause}', \
+ acctstopdelay = %{%{Acct-Delay-Time}:-0} \
+ WHERE acctstoptime IS NULL \
+ AND nasipaddress = '%{NAS-IP-Address}' \
+ AND acctstarttime <= '%S'"
+
+ accounting_update_query = " \
+ UPDATE ${acct_table1} \
+ SET \
+ framedipaddress = '%{Framed-IP-Address}', \
+ acctsessiontime = '%{Acct-Session-Time}', \
+ acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | \
+ '%{%{Acct-Input-Octets}:-0}', \
+ acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | \
+ '%{%{Acct-Output-Octets}:-0}' \
+ WHERE acctsessionid = '%{Acct-Session-Id}' \
+ AND username = '%{SQL-User-Name}' \
+ AND nasipaddress = '%{NAS-IP-Address}'"
+
+ accounting_update_query_alt = " \
+ INSERT INTO ${acct_table1} \
+ (acctsessionid, acctuniqueid, username, \
+ realm, nasipaddress, nasportid, \
+ nasporttype, acctstarttime, acctsessiontime, \
+ acctauthentic, connectinfo_start, acctinputoctets, \
+ acctoutputoctets, calledstationid, callingstationid, \
+ servicetype, framedprotocol, framedipaddress, \
+ acctstartdelay, xascendsessionsvrkey) \
+ VALUES \
+ ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \
+ '%{SQL-User-Name}', \
+ '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \
+ '%{NAS-Port-Type}', \
+ DATE_SUB('%S', \
+ INTERVAL (%{%{Acct-Session-Time}:-0} + \
+ %{%{Acct-Delay-Time}:-0}) SECOND), \
+ '%{Acct-Session-Time}', \
+ '%{Acct-Authentic}', '', \
+ '%{%{Acct-Input-Gigawords}:-0}' << 32 | \
+ '%{%{Acct-Input-Octets}:-0}', \
+ '%{%{Acct-Output-Gigawords}:-0}' << 32 | \
+ '%{%{Acct-Output-Octets}:-0}', \
+ '%{Called-Station-Id}', '%{Calling-Station-Id}', \
+ '%{Service-Type}', '%{Framed-Protocol}', \
+ '%{Framed-IP-Address}', \
+ '0', '%{X-Ascend-Session-Svr-Key}')"
+
+ accounting_start_query = " \
+ INSERT INTO ${acct_table1} \
+ (acctsessionid, acctuniqueid, username, \
+ realm, nasipaddress, nasportid, \
+ nasporttype, acctstarttime, acctstoptime, \
+ acctsessiontime, acctauthentic, connectinfo_start, \
+ connectinfo_stop, acctinputoctets, acctoutputoctets, \
+ calledstationid, callingstationid, acctterminatecause, \
+ servicetype, framedprotocol, framedipaddress, \
+ acctstartdelay, acctstopdelay, xascendsessionsvrkey) \
+ VALUES \
+ ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \
+ '%{SQL-User-Name}', \
+ '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \
+ '%{NAS-Port-Type}', '%S', NULL, \
+ '0', '%{Acct-Authentic}', '%{Connect-Info}', \
+ '', '0', '0', \
+ '%{Called-Station-Id}', '%{Calling-Station-Id}', '', \
+ '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', \
+ '%{%{Acct-Delay-Time}:-0}', '0', '%{X-Ascend-Session-Svr-Key}')"
+
+ accounting_start_query_alt = " \
+ UPDATE ${acct_table1} SET \
+ acctstarttime = '%S', \
+ acctstartdelay = '%{%{Acct-Delay-Time}:-0}', \
+ connectinfo_start = '%{Connect-Info}' \
+ WHERE acctsessionid = '%{Acct-Session-Id}' \
+ AND username = '%{SQL-User-Name}' \
+ AND nasipaddress = '%{NAS-IP-Address}'"
+
+ accounting_stop_query = " \
+ UPDATE ${acct_table2} SET \
+ acctstoptime = '%S', \
+ acctsessiontime = '%{Acct-Session-Time}', \
+ acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | \
+ '%{%{Acct-Input-Octets}:-0}', \
+ acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | \
+ '%{%{Acct-Output-Octets}:-0}', \
+ acctterminatecause = '%{Acct-Terminate-Cause}', \
+ acctstopdelay = '%{%{Acct-Delay-Time}:-0}', \
+ connectinfo_stop = '%{Connect-Info}' \
+ WHERE acctsessionid = '%{Acct-Session-Id}' \
+ AND username = '%{SQL-User-Name}' \
+ AND nasipaddress = '%{NAS-IP-Address}'"
+
+ accounting_stop_query_alt = " \
+ INSERT INTO ${acct_table2} \
+ (acctsessionid, acctuniqueid, username, \
+ realm, nasipaddress, nasportid, \
+ nasporttype, acctstarttime, acctstoptime, \
+ acctsessiontime, acctauthentic, connectinfo_start, \
+ connectinfo_stop, acctinputoctets, acctoutputoctets, \
+ calledstationid, callingstationid, acctterminatecause, \
+ servicetype, framedprotocol, framedipaddress, \
+ acctstartdelay, acctstopdelay) \
+ VALUES \
+ ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \
+ '%{SQL-User-Name}', \
+ '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \
+ '%{NAS-Port-Type}', \
+ DATE_SUB('%S', \
+ INTERVAL (%{%{Acct-Session-Time}:-0} + \
+ %{%{Acct-Delay-Time}:-0}) SECOND), \
+ '%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '', \
+ '%{Connect-Info}', \
+ '%{%{Acct-Input-Gigawords}:-0}' << 32 | \
+ '%{%{Acct-Input-Octets}:-0}', \
+ '%{%{Acct-Output-Gigawords}:-0}' << 32 | \
+ '%{%{Acct-Output-Octets}:-0}', \
+ '%{Called-Station-Id}', '%{Calling-Station-Id}', \
+ '%{Acct-Terminate-Cause}', \
+ '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', \
+ '0', '%{%{Acct-Delay-Time}:-0}')"
+
+ #######################################################################
+ # Simultaneous Use Checking Queries
+ #######################################################################
+ # simul_count_query - query for the number of current connections
+ # - If this is not defined, no simultaneouls use checking
+ # - will be performed by this module instance
+ # simul_verify_query - query to return details of current connections for verification
+ # - Leave blank or commented out to disable verification step
+ # - Note that the returned field order should not be changed.
+ #######################################################################
+
+ # Uncomment simul_count_query to enable simultaneous use checking
+ #simul_count_query = "SELECT COUNT(*) \
+ #FROM ${acct_table1} \
+ #WHERE username = '%{SQL-User-Name}' \
+ #AND acctstoptime IS NULL"
+
+ simul_verify_query = "SELECT radacctid, acctsessionid, username, \
+ nasipaddress, nasportid, framedipaddress, \
+ callingstationid, framedprotocol \
+ FROM ${acct_table1} \
+ WHERE username = '%{SQL-User-Name}' \
+ AND acctstoptime IS NULL"
+
+ #######################################################################
+ # Authentication Logging Queries
+ #######################################################################
+ # postauth_query - Insert some info after authentication
+ #######################################################################
+
+ postauth_query = "INSERT INTO ${postauth_table} \
+ (username, pass, reply, authdate) \
+ VALUES ( \
+ '%{User-Name}', \
+ '%{%{User-Password}:-%{Chap-Password}}', \
+ '%{reply:Packet-Type}', '%S')"
+
diff --git a/docs/freeradius/raddb/users b/docs/freeradius/raddb/users
new file mode 100644
index 000000000..1c17b508d
--- /dev/null
+++ b/docs/freeradius/raddb/users
@@ -0,0 +1,203 @@
+#
+# Please read the documentation file ../doc/processing_users_file,
+# or 'man 5 users' (after installing the server) for more information.
+#
+# This file contains authentication security and configuration
+# information for each user. Accounting requests are NOT processed
+# through this file. Instead, see 'acct_users', in this directory.
+#
+# The first field is the user's name and can be up to
+# 253 characters in length. This is followed (on the same line) with
+# the list of authentication requirements for that user. This can
+# include password, comm server name, comm server port number, protocol
+# type (perhaps set by the "hints" file), and huntgroup name (set by
+# the "huntgroups" file).
+#
+# If you are not sure why a particular reply is being sent by the
+# server, then run the server in debugging mode (radiusd -X), and
+# you will see which entries in this file are matched.
+#
+# When an authentication request is received from the comm server,
+# these values are tested. Only the first match is used unless the
+# "Fall-Through" variable is set to "Yes".
+#
+# A special user named "DEFAULT" matches on all usernames.
+# You can have several DEFAULT entries. All entries are processed
+# in the order they appear in this file. The first entry that
+# matches the login-request will stop processing unless you use
+# the Fall-Through variable.
+#
+# If you use the database support to turn this file into a .db or .dbm
+# file, the DEFAULT entries _have_ to be at the end of this file and
+# you can't have multiple entries for one username.
+#
+# Indented (with the tab character) lines following the first
+# line indicate the configuration values to be passed back to
+# the comm server to allow the initiation of a user session.
+# This can include things like the PPP configuration values
+# or the host to log the user onto.
+#
+# You can include another `users' file with `$INCLUDE users.other'
+#
+
+#
+# For a list of RADIUS attributes, and links to their definitions,
+# see:
+#
+# http://www.freeradius.org/rfc/attributes.html
+#
+
+#
+# Deny access for a specific user. Note that this entry MUST
+# be before any other 'Auth-Type' attribute which results in the user
+# being authenticated.
+#
+# Note that there is NO 'Fall-Through' attribute, so the user will not
+# be given any additional resources.
+#
+#lameuser Auth-Type := Reject
+# Reply-Message = "Your account has been disabled."
+
+#
+# Deny access for a group of users.
+#
+# Note that there is NO 'Fall-Through' attribute, so the user will not
+# be given any additional resources.
+#
+#DEFAULT Group == "disabled", Auth-Type := Reject
+# Reply-Message = "Your account has been disabled."
+#
+
+#
+# This is a complete entry for "steve". Note that there is no Fall-Through
+# entry so that no DEFAULT entry will be used, and the user will NOT
+# get any attributes in addition to the ones listed here.
+#
+#steve Cleartext-Password := "testing"
+# Service-Type = Framed-User,
+# Framed-Protocol = PPP,
+# Framed-IP-Address = 172.16.3.33,
+# Framed-IP-Netmask = 255.255.255.0,
+# Framed-Routing = Broadcast-Listen,
+# Framed-Filter-Id = "std.ppp",
+# Framed-MTU = 1500,
+# Framed-Compression = Van-Jacobsen-TCP-IP
+
+#
+# This is an entry for a user with a space in their name.
+# Note the double quotes surrounding the name.
+#
+#"John Doe" Cleartext-Password := "hello"
+# Reply-Message = "Hello, %{User-Name}"
+
+#
+# Dial user back and telnet to the default host for that port
+#
+#Deg Cleartext-Password := "ge55ged"
+# Service-Type = Callback-Login-User,
+# Login-IP-Host = 0.0.0.0,
+# Callback-Number = "9,5551212",
+# Login-Service = Telnet,
+# Login-TCP-Port = Telnet
+
+#
+# Another complete entry. After the user "dialbk" has logged in, the
+# connection will be broken and the user will be dialed back after which
+# he will get a connection to the host "timeshare1".
+#
+#dialbk Cleartext-Password := "callme"
+# Service-Type = Callback-Login-User,
+# Login-IP-Host = timeshare1,
+# Login-Service = PortMaster,
+# Callback-Number = "9,1-800-555-1212"
+
+#
+# user "swilson" will only get a static IP number if he logs in with
+# a framed protocol on a terminal server in Alphen (see the huntgroups file).
+#
+# Note that by setting "Fall-Through", other attributes will be added from
+# the following DEFAULT entries
+#
+#swilson Service-Type == Framed-User, Huntgroup-Name == "alphen"
+# Framed-IP-Address = 192.168.1.65,
+# Fall-Through = Yes
+
+#
+# If the user logs in as 'username.shell', then authenticate them
+# using the default method, give them shell access, and stop processing
+# the rest of the file.
+#
+#DEFAULT Suffix == ".shell"
+# Service-Type = Login-User,
+# Login-Service = Telnet,
+# Login-IP-Host = your.shell.machine
+
+
+#
+# The rest of this file contains the several DEFAULT entries.
+# DEFAULT entries match with all login names.
+# Note that DEFAULT entries can also Fall-Through (see first entry).
+# A name-value pair from a DEFAULT entry will _NEVER_ override
+# an already existing name-value pair.
+#
+
+#
+# Set up different IP address pools for the terminal servers.
+# Note that the "+" behind the IP address means that this is the "base"
+# IP address. The Port-Id (S0, S1 etc) will be added to it.
+#
+#DEFAULT Service-Type == Framed-User, Huntgroup-Name == "alphen"
+# Framed-IP-Address = 192.168.1.32+,
+# Fall-Through = Yes
+
+#DEFAULT Service-Type == Framed-User, Huntgroup-Name == "delft"
+# Framed-IP-Address = 192.168.2.32+,
+# Fall-Through = Yes
+
+#
+# Sample defaults for all framed connections.
+#
+#DEFAULT Service-Type == Framed-User
+# Framed-IP-Address = 255.255.255.254,
+# Framed-MTU = 576,
+# Service-Type = Framed-User,
+# Fall-Through = Yes
+
+#
+# Default for PPP: dynamic IP address, PPP mode, VJ-compression.
+# NOTE: we do not use Hint = "PPP", since PPP might also be auto-detected
+# by the terminal server in which case there may not be a "P" suffix.
+# The terminal server sends "Framed-Protocol = PPP" for auto PPP.
+#
+DEFAULT Framed-Protocol == PPP
+ Framed-Protocol = PPP,
+ Framed-Compression = Van-Jacobson-TCP-IP
+
+#
+# Default for CSLIP: dynamic IP address, SLIP mode, VJ-compression.
+#
+DEFAULT Hint == "CSLIP"
+ Framed-Protocol = SLIP,
+ Framed-Compression = Van-Jacobson-TCP-IP
+
+#
+# Default for SLIP: dynamic IP address, SLIP mode.
+#
+DEFAULT Hint == "SLIP"
+ Framed-Protocol = SLIP
+
+#
+# Last default: rlogin to our main server.
+#
+#DEFAULT
+# Service-Type = Login-User,
+# Login-Service = Rlogin,
+# Login-IP-Host = shellbox.ispdomain.com
+
+# #
+# # Last default: shell on the local terminal server.
+# #
+# DEFAULT
+# Service-Type = Administrative-User
+
+# On no match, the user is denied access.
diff --git a/docs/opt82_uhw/config/.htaccess b/docs/opt82_uhw/config/.htaccess
new file mode 100644
index 000000000..8d2f25636
--- /dev/null
+++ b/docs/opt82_uhw/config/.htaccess
@@ -0,0 +1 @@
+deny from all
diff --git a/docs/opt82_uhw/config/mysql.ini b/docs/opt82_uhw/config/mysql.ini
new file mode 100755
index 000000000..2ef702962
--- /dev/null
+++ b/docs/opt82_uhw/config/mysql.ini
@@ -0,0 +1,12 @@
+;database host
+server = "localhost"
+;database port
+port = "3306"
+;user login
+username = "mylogin"
+;user password
+password = "newpassword"
+;database name to use
+db = "stg"
+character = "UTF8"
+prefix = "billing"
diff --git a/docs/opt82_uhw/config/uhw.ini b/docs/opt82_uhw/config/uhw.ini
new file mode 100755
index 000000000..431ad189a
--- /dev/null
+++ b/docs/opt82_uhw/config/uhw.ini
@@ -0,0 +1,58 @@
+;
+; ISP and network settings
+;
+
+
+; ISP name
+ISP_NAME="Рога&Копыта"
+
+; ISP site URL
+ISP_URL="http://ubilling.net.ua"
+
+; ISP logo (path or URL)
+ISP_LOGO="images/logo.png"
+
+; Unknown users IP mask
+UNKNOWN_MASK="172.32."
+UNKNOWN_LEASE="Leased IP: "
+; Hide MAC dots
+HIDE_DOTS=0
+; show last symbols to user (0 - if no cutting)
+SHOW_MAC_SIZE=0
+
+SUDO_PATH="/usr/local/bin/sudo"
+CAT_PATH="/bin/cat"
+GREP_PATH="/usr/bin/grep"
+TAIL_PATH="/usr/bin/tail"
+LOG_PATH="/var/log/dhcpd.log"
+
+
+;
+; Locale settings
+;
+
+; Page title
+TITLE="Активация учетной записи"
+; Page sub title
+SUB_TITLE="Извините, ваша учетная запись еще не активирована на этом оборудовании";
+
+SUP_PHONES="12345 или 54321"
+SUP_DESC="Время работы службы техподдержки"
+SUP_DAYS="понедельник-суббота"
+SUP_TIME="с 09:00 до 18:00"
+
+CALL_US="Пожалуйста позвоните нам по номеру"
+SUP_ACTIVATE="для того, чтобы активировать ваше текущее оборудование для работы в сети."
+SUP_REQUIRE="Вам необходимо будет продиктовать службе техподдержки адрес проживания, ваши Ф.И.О. и следующий набор букв или цифр выделенных красным цветом:"
+SUP_SELFACT="Самостоятельная активация"
+SUP_PASS="Пароль пользователя"
+SUP_PASSNOTICE="Пароль пользователя НЕ является красными буквами и цифрами которые вы видите на этой странице, узнать его вы можете из своего договора. Он является конфиденциальной информацией, не доверяйте его никому. Не забудьте перезагрузить ваше оборудование после активации, для получения новых настроек."
+SUP_ACTIVATE_QUERY="Активировать мое текущее оборудование"
+SUP_OPTEXISTS="...Ой, ваше оборудование кажется уже активировано, перезагрузите его."
+SUP_ERROR="Ошибка"
+SUP_NOOPT="Случилась странная ошибка, перезагрузите ваше оборудование и попробуйте еще раз."
+SUP_WRONGPASS="Вы ввели неверный пароль, у вас кстати не так много попыток. Обратите внимание на регистр букв."
+SUP_STRANGE="Странная ошибка, ее вообще не могло произойти. Обратитесь к администратору."
+SUP_BRUTEERROR="К сожелению вы исчерпали количество попыток. Самостоятельная активация невозможна."
+SUP_SELFACTDONE="Активация вашего нового оборудования завершена. Не забудьте перезагрузить ваше устройство, для получения новых настроек."
+
diff --git a/docs/opt82_uhw/images/img01.jpg b/docs/opt82_uhw/images/img01.jpg
new file mode 100755
index 000000000..8c1dea1be
Binary files /dev/null and b/docs/opt82_uhw/images/img01.jpg differ
diff --git a/docs/opt82_uhw/images/img02.jpg b/docs/opt82_uhw/images/img02.jpg
new file mode 100755
index 000000000..980e3b7e0
Binary files /dev/null and b/docs/opt82_uhw/images/img02.jpg differ
diff --git a/docs/opt82_uhw/images/img03.jpg b/docs/opt82_uhw/images/img03.jpg
new file mode 100755
index 000000000..df84f33c2
Binary files /dev/null and b/docs/opt82_uhw/images/img03.jpg differ
diff --git a/docs/opt82_uhw/images/img04.jpg b/docs/opt82_uhw/images/img04.jpg
new file mode 100755
index 000000000..b3779ba48
Binary files /dev/null and b/docs/opt82_uhw/images/img04.jpg differ
diff --git a/docs/opt82_uhw/images/img05.jpg b/docs/opt82_uhw/images/img05.jpg
new file mode 100755
index 000000000..af85cd7df
Binary files /dev/null and b/docs/opt82_uhw/images/img05.jpg differ
diff --git a/docs/opt82_uhw/images/img06.gif b/docs/opt82_uhw/images/img06.gif
new file mode 100755
index 000000000..866f4ba8a
Binary files /dev/null and b/docs/opt82_uhw/images/img06.gif differ
diff --git a/docs/opt82_uhw/images/img07.jpg b/docs/opt82_uhw/images/img07.jpg
new file mode 100755
index 000000000..138defe05
Binary files /dev/null and b/docs/opt82_uhw/images/img07.jpg differ
diff --git a/docs/opt82_uhw/images/img08.jpg b/docs/opt82_uhw/images/img08.jpg
new file mode 100755
index 000000000..d7a92c2d1
Binary files /dev/null and b/docs/opt82_uhw/images/img08.jpg differ
diff --git a/docs/opt82_uhw/images/logo.png b/docs/opt82_uhw/images/logo.png
new file mode 100755
index 000000000..57cdfed5e
Binary files /dev/null and b/docs/opt82_uhw/images/logo.png differ
diff --git a/docs/opt82_uhw/index.php b/docs/opt82_uhw/index.php
new file mode 100755
index 000000000..6d4856b31
--- /dev/null
+++ b/docs/opt82_uhw/index.php
@@ -0,0 +1,107 @@
+
+
+
+
+
+=$uconf['TITLE'];?>
+
+
+
+
+
+
+
+
+
+
+
+
=$uconf['SUB_TITLE'];?>
+
+
+
=$uconf['CALL_US'];?> =$uconf['SUP_PHONES'];?> =$uconf['SUP_ACTIVATE'];?>
+ =$uconf['SUP_REQUIRE'];?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
new file mode 100755
index 000000000..5b5dab2ab
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
new file mode 100755
index 000000000..ac8b229af
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
new file mode 100755
index 000000000..ad3d6346e
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
new file mode 100755
index 000000000..42ccba269
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
new file mode 100755
index 000000000..5a46b47cb
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
new file mode 100755
index 000000000..86c2baa65
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
new file mode 100755
index 000000000..4443fdc1a
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
new file mode 100755
index 000000000..7c9fa6c6e
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_222222_256x240.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_222222_256x240.png
new file mode 100755
index 000000000..b273ff111
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_222222_256x240.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_2e83ff_256x240.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_2e83ff_256x240.png
new file mode 100755
index 000000000..09d1cdc85
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_2e83ff_256x240.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_454545_256x240.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_454545_256x240.png
new file mode 100755
index 000000000..59bd45b90
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_454545_256x240.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_888888_256x240.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_888888_256x240.png
new file mode 100755
index 000000000..6d02426c1
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_888888_256x240.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_cd0a0a_256x240.png
new file mode 100755
index 000000000..2ab019b73
Binary files /dev/null and b/docs/opt82_uhw/jui/css/smoothness/images/ui-icons_cd0a0a_256x240.png differ
diff --git a/docs/opt82_uhw/jui/css/smoothness/jquery-ui-1.8.23.custom.css b/docs/opt82_uhw/jui/css/smoothness/jquery-ui-1.8.23.custom.css
new file mode 100755
index 000000000..82303840e
--- /dev/null
+++ b/docs/opt82_uhw/jui/css/smoothness/jquery-ui-1.8.23.custom.css
@@ -0,0 +1,563 @@
+/*!
+ * jQuery UI CSS Framework 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
+.ui-helper-clearfix:after { clear: both; }
+.ui-helper-clearfix { zoom: 1; }
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+
+
+/*!
+ * jQuery UI CSS Framework 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
+.ui-widget .ui-widget { font-size: 1em; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
+.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
+.ui-widget-content a { color: #222222; }
+.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
+.ui-widget-header a { color: #222222; }
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
+.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
+.ui-widget :active { outline: none; }
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+
+/* Overlays */
+.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
+.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
+ * jQuery UI Resizable 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
+.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
+.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
+.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
+.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
+.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
+.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
+.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
+.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*!
+ * jQuery UI Selectable 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Selectable#theming
+ */
+.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
+/*!
+ * jQuery UI Accordion 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion#theming
+ */
+/* IE/Win - Fix animation bug - #4615 */
+.ui-accordion { width: 100%; }
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
+.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
+.ui-accordion .ui-accordion-content-active { display: block; }
+/*!
+ * jQuery UI Autocomplete 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete { position: absolute; cursor: default; }
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/*
+ * jQuery UI Menu 1.8.23
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu {
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+ float: left;
+}
+.ui-menu .ui-menu {
+ margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
+}
+.ui-menu .ui-menu-item a {
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+ font-weight: normal;
+ margin: -1px;
+}
+/*!
+ * jQuery UI Button 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button#theming
+ */
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
+.ui-button-icons-only { width: 3.4em; }
+button.ui-button-icons-only { width: 3.7em; }
+
+/*button text element */
+.ui-button .ui-button-text { display: block; line-height: 1.4; }
+.ui-button-text-only .ui-button-text { padding: .4em 1em; }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+/* no icon support for input elements, provide padding by default */
+input.ui-button { padding: .4em 1em; }
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+
+/*button sets*/
+.ui-buttonset { margin-right: 7px; }
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+/*!
+ * jQuery UI Dialog 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+/*!
+ * jQuery UI Slider 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Slider#theming
+ */
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }/*!
+ * jQuery UI Tabs 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Tabs#theming
+ */
+.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
+.ui-tabs .ui-tabs-hide { display: none !important; }
+/*!
+ * jQuery UI Datepicker 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker#theming
+ */
+.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+ position: absolute; /*must have*/
+ z-index: -1; /*must have*/
+ filter: mask(); /*must have*/
+ top: -4px; /*must have*/
+ left: -4px; /*must have*/
+ width: 200px; /*must have*/
+ height: 200px; /*must have*/
+}/*!
+ * jQuery UI Progressbar 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar#theming
+ */
+.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
\ No newline at end of file
diff --git a/docs/opt82_uhw/jui/js/jquery-1.8.0.min.js b/docs/opt82_uhw/jui/js/jquery-1.8.0.min.js
new file mode 100755
index 000000000..f121291c4
--- /dev/null
+++ b/docs/opt82_uhw/jui/js/jquery-1.8.0.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v@1.8.0 jquery.com | jquery.org/license */
+(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;ba ",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;jq&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;ai){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML=" ";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="
",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML=" ",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="
",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j ",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="
",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML=" ",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/ ]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""," "],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X","
"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>$2>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1>$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/
+ ';
+ die($redirect);
+}
+
+function uhw_IsAllPasswordsUnique() {
+ $query_u="SELECT COUNT(`login`) from `users`";
+ $userdata=simple_query($query_u);
+ $usercount=$userdata['COUNT(`login`)'];
+ $query_p="SELECT DISTINCT `Password` from `users`";
+ $passwdata= simple_queryall($query_p);
+ $passwordcount=sizeof($passwdata);
+ if ($usercount==$passwordcount) {
+ return (true);
+ } else {
+ return (false);
+ }
+}
+
+//find mac for current user ip by mask
+function uhw_FindMac($ip) {
+ $uconf= uhw_LoadConfig();
+ $sudo_path=$uconf['SUDO_PATH'];
+ $cat_path=$uconf['CAT_PATH'];
+ $logpath=$uconf['LOG_PATH'];
+ $tail_path=$uconf['TAIL_PATH'];
+ $grep_path=$uconf['GREP_PATH'];
+ $unknown_mask=$uconf['UNKNOWN_MASK'];
+ $unknown_lease=$uconf['UNKNOWN_LEASE'];
+
+ $raw=shell_exec($sudo_path.' '.$cat_path.' '.$logpath.' | '.$grep_path.' "'.$unknown_lease.$ip.' " | '.$tail_path.' -n1');
+ if (!empty($raw)) {
+ $mac_detect=uhw_MacParse($raw);
+ if ($mac_detect) {
+ return ($mac_detect);
+ } else {
+ return (false);
+ }
+
+ } else {
+ return (false);
+ }
+}
+
+//find mac for current user ip by mask
+function uhw_FindOpt82($ip) {
+ $uconf= uhw_LoadConfig();
+ $sudo_path=$uconf['SUDO_PATH'];
+ $cat_path=$uconf['CAT_PATH'];
+ $logpath=$uconf['LOG_PATH'];
+ $tail_path=$uconf['TAIL_PATH'];
+ $grep_path=$uconf['GREP_PATH'];
+ $unknown_mask=$uconf['UNKNOWN_MASK'];
+ $unknown_lease=$uconf['UNKNOWN_LEASE'];
+ $raw=shell_exec($sudo_path.' '.$cat_path.' '.$logpath.' | '.$grep_path.' "'.$unknown_lease.$ip.' " | '.$tail_path.' -n1');
+ $opt82_detect='';
+
+ if (!empty($raw)) {
+ $explodeLine=explode(' ',$raw);
+
+ //log have normal format
+ if (isset($explodeLine[9]) AND (isset($explodeLine[11])) AND (isset($explodeLine[7]))) {
+ $leaseIp=$explodeLine[7];
+ $remoteId=$explodeLine[9];
+ $circuitID=$explodeLine[11];
+ //check for new lease?
+ $opt82_detect=$remoteId.'+'.$circuitID;
+ }
+
+
+ if ($opt82_detect) {
+ return ($opt82_detect);
+ } else {
+ return (false);
+ }
+
+ } else {
+ return (false);
+ }
+}
+
+
+function uhw_modal($link, $title, $content, $linkclass = '', $width = '',$height='') {
+
+ $wid = rand(0,99999);
+
+
+
+//setting link class
+ if ($linkclass != '') {
+ $link_class = 'class="' . $linkclass . '"';
+ } else {
+ $link_class = '';
+ }
+
+//setting auto width if not specified
+ if ($width == '') {
+ $width = '600';
+ }
+
+//setting auto width if not specified
+ if ($height == '') {
+ $height = '400';
+ }
+
+ $dialog = '
+
+
+
+
+' . $link . '
+';
+
+ return($dialog);
+}
+
+function uhw_modal_open($title, $content, $width = '',$height='') {
+
+ $wid = rand(0,99999);
+//setting auto width if not specified
+ if ($width == '') {
+ $width = '600';
+ }
+
+//setting auto width if not specified
+ if ($height == '') {
+ $height = '400';
+ }
+
+ $dialog = '
+
+
+
+
+
+';
+
+ return($dialog);
+}
+
+function uhw_PasswordForm($uconf) {
+ $form='
+
+
+
+
+
+ '.$uconf['SUP_PASSNOTICE'].'
+ ';
+
+ $result=' ';
+ $result.=uhw_modal($uconf['SUP_SELFACT'], $uconf['SUP_SELFACT'], $form, 'ubButton', '600', '400');
+ print($result);
+}
+
+function uhw_IsMacUnique($mac) {
+ $mac=vf($mac);
+ $mac= strtolower($mac);
+ $query="SELECT `id` from `nethosts` WHERE `mac`='".$mac."'";
+ $data= simple_query($query);
+
+ if ($mac=='00:00:00:00:00:00') {
+ return (false);
+ }
+
+ if (empty($data)) {
+ return (true);
+ } else {
+ return (false);
+ }
+}
+
+
+function uhw_FindUserByPassword($password) {
+ $password= mysql_real_escape_string($password);
+ $query="SELECT `login` from `users` WHERE `Password`='".$password."'";
+ $result= simple_query($query);
+ if (!empty($result)) {
+ return ($result['login']);
+ } else {
+ return(false);
+ }
+}
+
+function uhw_UserGetIp($login) {
+ $query="SELECT `IP` from `users` WHERE `login`='".$login."'";
+ $result= simple_query($query);
+ if (!empty($result)) {
+ return ($result['IP']);
+ } else {
+ return (false);
+ }
+}
+
+
+function uhw_NethostGetID($ip) {
+ $query="SELECT `id` from `nethosts` WHERE `ip`='".$ip."'";
+ $result= simple_query($query);
+ if (!empty($result)) {
+ return ($result['id']);
+ } else {
+ return (false);
+ }
+}
+
+
+function uhw_NethostGetMac($nethostid) {
+ $query="SELECT `mac` from `nethosts` WHERE `id`='".$nethostid."'";
+ $result= simple_query($query);
+ if (!empty($result)) {
+ return ($result['mac']);
+ } else {
+ return (false);
+ }
+}
+
+ function uhw_ub_log_register($event) {
+ $admin_login='external';
+ $ip='127.0.0.1';
+ $current_time=date("Y-m-d H:i:s");
+ $event=mysql_real_escape_string($event);
+ $query="INSERT INTO `weblogs` (`id`,`date`,`admin`,`ip`,`event`) VALUES(NULL,'".$current_time."','".$admin_login."','".$ip."','".$event."')";
+ nr_query($query);
+}
+
+function uhw_LogSelfact($trypassword,$login,$tryip,$nethostid,$oldmac,$newmac) {
+ $date=date("Y-m-d H:i:s");
+ $query="INSERT INTO `uhw_log` (
+`id` ,
+`date` ,
+`password` ,
+`login` ,
+`ip` ,
+`nhid` ,
+`oldmac` ,
+`newmac`
+)
+VALUES (
+NULL , '".$date."', '".$trypassword."', '".$login."', '".$tryip."', '".$nethostid."', '".$oldmac."', '".$newmac."'
+);";
+ nr_query($query);
+ //put ubilling log entry
+ uhw_ub_log_register("UHW CHANGE (".$login.") MAC FROM ".$oldmac." ON ".$newmac);
+}
+
+
+function uhw_GetBrute($mac) {
+ $query="SELECT COUNT(`id`) from `uhw_brute` WHERE `mac`='".$mac."'";
+ $data= simple_query($query);
+ return ($data['COUNT(`id`)']);
+}
+
+function uhw_LogBrute($password,$mac) {
+ $password= mysql_real_escape_string($password);
+ $date=date("Y-m-d H:i:s");
+ $query="INSERT INTO `uhw_brute` (
+`id` ,
+`date` ,
+`password` ,
+`mac`
+)
+VALUES (
+NULL , '".$date."', '".$password."', '".$mac."'
+);";
+ nr_query($query);
+
+}
+
+function uhw_ChangeMac($nethost_id,$newmac) {
+ $newmac=strtolower($newmac);
+ simple_update_field('nethosts', 'mac', $newmac, "WHERE `id`='".$nethost_id."'");
+}
+
+function uhw_RemoteApiPush($url,$serial,$action,$param='') {
+ $getdata = http_build_query(
+ array(
+ 'module' => 'remoteapi',
+ 'key' => $serial,
+ 'action'=>$action,
+ 'param'=>$param
+ )
+ );
+
+
+ $opts = array('http' =>
+ array(
+ 'method' => 'GET',
+ 'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
+ 'content' => $getdata
+ )
+ );
+
+ $context=stream_context_create($opts);
+
+ @$result=file_get_contents($url.'?'.$getdata,false,$context);
+ return ($result);
+}
+
+?>
\ No newline at end of file
diff --git a/docs/opt82_uhw/style.css b/docs/opt82_uhw/style.css
new file mode 100755
index 000000000..f6f6791fb
--- /dev/null
+++ b/docs/opt82_uhw/style.css
@@ -0,0 +1,554 @@
+body {
+ margin: 0;
+ padding: 0;
+ background: #E3E3E3;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ color: #8A8985;
+}
+
+h1, h2, h3 {
+ margin: 0;
+ padding: 0;
+ font-weight: normal;
+ color: #7D7764;
+}
+
+h1 {
+ font-size: 2em;
+}
+
+h2 {
+ font-size: 2.8em;
+}
+
+h3 {
+ font-size: 1.6em;
+}
+
+p, ul, ol {
+ margin-top: 0;
+ line-height: 180%;
+}
+
+ul, ol {
+}
+
+a {
+ text-decoration: none;
+ color: #CA4C44;
+}
+
+a:hover {
+}
+
+#wrapper {
+ margin: 0 auto;
+ padding: 0;
+}
+
+.container {
+ width: 1000px;
+ margin: 0px auto;
+}
+
+/* Header */
+
+#header {
+ width: 900px;
+ height: 150px;
+ margin: 0 auto;
+ padding: 0px 50px;
+ background: url(images/img01.jpg) no-repeat left top;
+}
+
+/* Logo */
+
+#logo {
+ float: left;
+ width: 500px;
+ margin: 0;
+ padding: 0;
+ color: #000000;
+}
+
+#logo h1, #logo p {
+}
+
+#logo h1 {
+ padding: 60px 0px 0px 0px;
+ letter-spacing: -2px;
+
+ font-size: 3.8em;
+ background: redc;
+}
+
+#logo p {
+ margin: 0;
+ padding: 0px 0 0 0px;
+ letter-spacing: -1px;
+ font: normal 18px Georgia, "Times New Roman", Times, serif;
+ font-style: italic;
+ color: #CCCCC4;
+}
+
+#logo p a {
+ color: #CCCCC4;
+}
+
+#logo a {
+ border: none;
+ background: none;
+ text-decoration: none;
+ color: #E3564F;
+}
+
+/* Splash */
+
+#splash {
+ height: 300px;
+}
+
+
+/* Search */
+
+#search {
+ float: right;
+ width: 80px;
+ height: 60px;
+ padding: 20px 0px 0px 0px;
+}
+
+#search form {
+ height: 41px;
+ margin: 0;
+ padding: 10px 0 0 20px;
+}
+
+#search fieldset {
+ margin: 0;
+ padding: 0;
+ border: none;
+}
+
+#search-text {
+ width: 70px;
+ padding: 6px 5px 2px 5px;
+ border: 1px solid #DEDEDE;
+ background: #FFFFFF;
+ font: normal 11px Arial, Helvetica, sans-serif;
+ color: #5D781D;
+}
+
+#search-submit {
+ width: 10px;
+ height: 22px;
+ border: none;
+ background: #B9B9B9;
+ color: #000000;
+}
+
+/* Menu */
+
+#menu {
+ float: right;
+ width: 300px;
+ height: 90px;
+ margin: 0 auto;
+ padding: 0;
+}
+
+#menu ul {
+ float: right;
+ margin: 0;
+ padding: 85px 0px 0px 0px;
+ list-style: none;
+ line-height: normal;
+}
+
+#menu li {
+ float: left;
+}
+
+#menu a {
+ display: block;
+ margin-right: 1px;
+ padding: 10px 15px 15px 15px;
+ background: url(images/img06.gif) no-repeat left 12px;
+ text-decoration: none;
+ text-align: center;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 13px;
+ font-weight: bold;
+ color: #7D7764;
+ border: none;
+}
+
+#menu a:hover, #menu .current_page_item a {
+ text-decoration: none;
+}
+
+#menu .current_page_item a {
+}
+
+/* Page */
+
+#page {
+ width: 890px;
+ margin: 0 auto;
+ padding: 30px 55px;
+ background: url(images/img03.jpg) repeat-y left top;
+}
+
+/* Content */
+
+#content {
+ float: left;
+ width: 780px;
+ padding: 0px 0px 0px 0px;
+}
+
+.post {
+ overflow: hidden;
+ margin-bottom: 40px;
+ border-bottom: 1px dotted #E7E2DC;
+}
+
+.post .title {
+ height: 41px;
+ padding: 7px 0px 0px 0px;
+ letter-spacing: -1px;
+ color: #7D7764;
+}
+
+.post .title a {
+ border: none;
+ color: #7D7764;
+}
+
+.post .meta {
+ margin-bottom: 30px;
+ padding: 0px;
+ text-align: left;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 13px;
+ font-weight: bold;
+}
+
+.post .meta .date {
+ float: left;
+}
+
+.post .meta .posted {
+ float: right;
+}
+
+.post .meta a {
+}
+
+.post .entry {
+ padding: 0px 0px 20px 0px;
+ padding-bottom: 20px;
+ text-align: justify;
+}
+
+.links {
+ padding-top: 20px;
+ margin-bottom: 30px;
+}
+
+.more {
+ display: block;
+ float: left;
+ width: 88px;
+ height: 25px;
+ padding: 2px 0px 0px 0px;
+ margin-right: 10px;
+ background: url(images/img08.jpg) no-repeat left top;
+ text-align: center;
+ color: #FFFFFF;
+}
+
+.comments {
+ display: block;
+ float: left;
+ width: 88px;
+ height: 25px;
+ padding: 2px 0px 0px 0px;
+ background: url(images/img08.jpg) no-repeat left top;
+ text-align: center;
+ color: #FFFFFF;
+}
+
+/* Sidebar */
+
+#sidebar {
+ float: right;
+ width: 80px;
+ margin: 0px;
+ padding: 0px 0px 0px 0px;
+ color: #787878;
+}
+
+#sidebar ul {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+#sidebar li {
+ margin: 0;
+ padding: 0;
+}
+
+#sidebar li ul {
+ margin: 0px 0px;
+ padding-bottom: 30px;
+}
+
+#sidebar li li {
+ line-height: 35px;
+ border-bottom: 1px dotted #E7E2DC;
+ background: url(images/img02.jpg) no-repeat left 15px;
+ margin: 0px 30px;
+ border-left: none;
+}
+
+#sidebar li li span {
+ display: block;
+ margin-top: -20px;
+ padding: 0;
+ font-size: 11px;
+ font-style: italic;
+}
+
+#sidebar li li a {
+ padding: 0px 0px 0px 15px;
+}
+
+#sidebar h2 {
+ height: 38px;
+ padding-left: 30px;
+ letter-spacing: -.5px;
+ font-size: 1.8em;
+ color: #7D7764;
+}
+
+#sidebar p {
+ margin: 0 0px;
+ padding: 0px 30px 20px 30px;
+ text-align: justify;
+}
+
+#sidebar a {
+ border: none;
+}
+
+#sidebar a:hover {
+ text-decoration: underline;
+}
+
+/* Calendar */
+
+#calendar {
+}
+
+#calendar_wrap {
+ padding: 20px;
+}
+
+#calendar table {
+ width: 100%;
+}
+
+#calendar tbody td {
+ text-align: center;
+}
+
+#calendar #next {
+ text-align: right;
+}
+
+/* Three Column Footer Content */
+
+#footer-content {
+ background: url(images/img04.jpg) repeat-y left top;
+ color: #BFBFBF;
+}
+
+#footer-bg {
+ overflow: hidden;
+ width: 890px;
+ padding: 30px 55px 50px 55px;
+ background: url(images/img05.jpg) no-repeat left bottom;
+}
+
+#footer-content h2 {
+ margin: 0px;
+ padding: 0px 0px 20px 0px;
+ letter-spacing: -1px;
+ font-size: 26px;
+ color: #FFFFFF;
+}
+
+#footer-content ul {
+ margin: 0px;
+ padding: 0px 0px 0px 20px;
+}
+
+#footer-content a {
+ color: #447ECF;
+}
+
+#column1 {
+ float: left;
+ width: 290px;
+ margin-right: 30px;
+}
+
+#column2 {
+ float: left;
+ width: 280px;
+}
+
+#column3 {
+ float: right;
+ width: 260px;
+}
+
+/* Footer */
+
+#footer {
+ height: 50px;
+ margin: 0 auto;
+ padding: 0px 0 15px 0;
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+#footer p {
+ margin: 0;
+ padding-top: 10px;
+ line-height: normal;
+ font-size: 9px;
+ text-transform: uppercase;
+ text-align: center;
+ color: #202020;
+}
+
+#footer a {
+ color: #202020;
+}
+
+#marketing {
+ overflow: hidden;
+ margin-bottom: 30px;
+ padding: 20px 0px 10px 0px;
+ border-top: 1px solid #E3E3E3;
+ border-bottom: 1px solid #E3E3E3;
+}
+
+#marketing .text1 {
+ float: left;
+ margin: 0px;
+ padding: 0px;
+ letter-spacing: -2px;
+ text-transform: lowercase;
+ font-size: 34px;
+ color: #345E9B;
+}
+
+#marketing .text2 {
+ float: right;
+}
+
+#marketing .text2 a {
+ display: block;
+ width: 252px;
+ height: 38px;
+ padding: 15px 0px 0px 0px;
+ background: url(images/img07.jpg) no-repeat left top;
+ letter-spacing: -2px;
+ text-align: center;
+ text-transform: lowercase;
+ font-size: 30px;
+ color: #FFFFFF;
+}
+
+
+/* glamour forms =) */
+
+ .glamour label {
+ /* font-size: 20px; */
+ color: #666;
+ padding-left: 4px;
+ }
+
+ .glamour {
+ float: left;
+ border: 1px solid #ddd;
+ padding: 6px 6px 6px 12px;
+ background: #fff;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border-radius: 10px;
+ background: -webkit-gradient(linear, 0% 0%, 0% 40%, from(#EEE), to(#FFFFFF));
+ background: -moz-linear-gradient(0% 40% 90deg,#FFF, #EEE);
+ -webkit-box-shadow:0px 0 50px #ccc;
+ -moz-box-shadow:0px 0 50px #ccc;
+ box-shadow:0px 0 50px #ccc;
+ }
+
+ .glamour fieldset { border: none; }
+
+
+ .glamour textarea {
+
+ }
+
+ .glamour input:hover, textarea:hover {
+ background: #eee;
+ }
+
+ .glamour legend
+ {
+ float: left;
+ color: #000000;
+ border: 1px solid #C4C4C4;
+ padding: 8px;
+ margin: 8px;
+ width: 60%;
+ }
+
+
+
+.ubButton {
+ -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ box-shadow:inset 0px 1px 0px 0px #ffffff;
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
+ background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
+ background-color:#ededed;
+ -moz-border-radius:6px;
+ -webkit-border-radius:6px;
+ border-radius:6px;
+ border:1px solid #dcdcdc;
+ display:inline-block;
+ color:#777777;
+ font-family:arial;
+ font-size:15px;
+ font-weight:bold;
+ padding:6px 24px;
+ text-decoration:none;
+ text-shadow:1px 1px 0px #ffffff;
+}
+.ubButton:hover {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
+ background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
+ background-color:#dfdfdf;
+}
+.ubButton:active {
+ position:relative;
+ top:1px;
+}
\ No newline at end of file
diff --git a/docs/presets/Linux/etc/OnConnect b/docs/presets/Linux/etc/OnConnect
index de07dd1b6..28cea6013 100755
--- a/docs/presets/Linux/etc/OnConnect
+++ b/docs/presets/Linux/etc/OnConnect
@@ -1,8 +1,8 @@
#!/bin/bash
#OnConnect
-IFUP="eth0"
-IFDOWN="eth1"
+IFUP="EXTERNAL_IFACE"
+IFDOWN="INTERNAL_IFACE"
LOGIN=$1
IP=$2
CASH=$3
diff --git a/docs/presets/Linux/etc/OnDisconnect b/docs/presets/Linux/etc/OnDisconnect
index 22b4d1fed..e99a48e52 100755
--- a/docs/presets/Linux/etc/OnDisconnect
+++ b/docs/presets/Linux/etc/OnDisconnect
@@ -1,8 +1,8 @@
#!/bin/bash
# OnDisconnect
-IFUP="eth0"
-IFDOWN="eth1"
+IFUP="EXTERNAL_IFACE"
+IFDOWN="INTERNAL_IFACE"
LOGIN=$1
IP=$2
CASH=$3
diff --git a/docs/test_dump.sql b/docs/test_dump.sql
index d83c4d50a..fa0bc3a95 100644
--- a/docs/test_dump.sql
+++ b/docs/test_dump.sql
@@ -914,4 +914,25 @@ CREATE TABLE IF NOT EXISTS `switchportassign` (
ALTER TABLE `build` ADD `geo` VARCHAR( 255 ) DEFAULT NULL ;
-ALTER TABLE `networks` ADD `use_radius` TINYINT(1) NOT NULL DEFAULT '0';
\ No newline at end of file
+ALTER TABLE `networks` ADD `use_radius` TINYINT(1) NOT NULL DEFAULT '0';
+
+-- 0.4.7 update
+
+CREATE TABLE IF NOT EXISTS `watchdog` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `active` TINYINT(1) NOT NULL DEFAULT '0',
+ `name` varchar(255) NOT NULL,
+ `checktype` varchar(255) NOT NULL,
+ `param` varchar(255) NOT NULL,
+ `operator` varchar(255) NOT NULL,
+ `condition` varchar(255) DEFAULT NULL,
+ `action` varchar(255) NOT NULL,
+ `oldresult` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `active` (`active`),
+ KEY `name` (`name`),
+ KEY `oldresult` (`oldresult`),
+ KEY `param` (`param`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+
diff --git a/languages/russian/billing.php b/languages/russian/billing.php
index 7fd03c115..abdfa32e8 100755
--- a/languages/russian/billing.php
+++ b/languages/russian/billing.php
@@ -1491,6 +1491,34 @@
$lang['def']['Only users with root rights can use set cash option']='Только пользователи с рутовыми правами могут "устанавливать счет"';
$lang['def']['Stargazer currently not running. We strongly advise against trying to use Ubilling in this case. If you are absolutely sure of what you are doing - you can turn off this alert with the option NOSTGCHECKPID']='Stargazer сейчас не запущен. Мы настоятельно не рекомендуем пытаться использовать Ubilling в этом случае. Если вы совершенно уверены в том что делаете - вы можете отключить это оповещение при помощи опции NOSTGCHECKPID';
-
+//rev 2952
+$lang['def']['New DHCP option 82'] = 'Новое значение optoin 82';
+$lang['def']['Set random'] = 'Установить случайные';
+$lang['def']['No DHCP option 82 networks available'] = 'Нету сетей использующих DHCP option 82';
+$lang['def']['right to set option 82 values for users'] = 'Право управления DHCP опцией 82 для пользователей';
+$lang['def']['Dynamic shaper is enabled'] = 'Динамический шейпер включен';
+$lang['def']['Watchdog'] = 'Собака-наблюдака';
+$lang['def']['Autofreezing cash limit'] = 'Порог денег для автозаморозки';
+$lang['def']['Watchdog notifies that'] = 'Собака-наблюдака сообщает, что';
+$lang['def']['Available Watchdog tasks'] = 'Существующие задачи для собаки-наблюдаки';
+$lang['def']['Check type'] = 'Тип проверки';
+$lang['def']['Operator'] = 'Оператор';
+$lang['def']['Condition'] = 'Условие';
+$lang['def']['Manage'] = 'Управление';
+$lang['def']['Show all tasks'] = 'Показать все задачи';
+$lang['def']['Manual run'] = 'Ручной запуск';
+$lang['def']['Watchdog alert text'] = 'Текст уведомления собаки-наблюдаки';
+$lang['def']['Phone numbers to send alerts'] = 'Телефонные номера, для рассылки уведомлений';
+$lang['def']['Emails to send alerts'] = 'Адреса електропочты, для рассылки';
+$lang['def']['right to control watchdog'] = 'Право управления собакой-наблюдакой';
+$lang['def']['Set contract same as login after user register'] = 'Устанавливать договор таким же как и логин при регистрации';
+$lang['def']['No existing DB backups here'] = 'Нету никаких дампов БД. Печалька.';
+$lang['def']['Available database backups'] = 'Резервные копии базы данных в наличии';
+$lang['def']['Important Ubilling configs'] = 'Важные конфиги Ubilling';
+$lang['def']['Autofreeze report'] = 'Отчет по автозаморозке';
+$lang['def']['right to view autofreeze report'] = 'право просматривать отчет по автозаморозке';
+$lang['def']['Users without port assigned'] = 'Пользователи без присвоенного порта';
+$lang['def']['right to view report by users with no port assinged'] = 'Право просматривать отчет по пользователям без порта';
+$lang['def']['No location set'] = 'Не указано местонахождение';
?>
diff --git a/languages/ukrainian/billing.php b/languages/ukrainian/billing.php
index a1cac9ec0..0ff8f5431 100755
--- a/languages/ukrainian/billing.php
+++ b/languages/ukrainian/billing.php
@@ -1503,4 +1503,34 @@
$lang['def']['Only users with root rights can use set cash option']='Тільки користувачі з рутовими правами можуть "встановлювати рахунок"';
$lang['def']['Stargazer currently not running. We strongly advise against trying to use Ubilling in this case. If you are absolutely sure of what you are doing - you can turn off this alert with the option NOSTGCHECKPID']='Stargazer зараз не запущений. Ми категорично не рекомендуємо намагатися використовувати Ubilling в цьому випадку. Якщо ви абсолютно впевнені в тому що робите - ви можете вимкнути це сповіщення за допомогою опції NOSTGCHECKPID';
+//rev 2952
+$lang['def']['New DHCP option 82'] = 'Нове значення optoin 82';
+$lang['def']['Set random'] = 'Встановити випадкові';
+$lang['def']['No DHCP option 82 networks available'] = 'Нема мереж, що використовують DHCP option 82';
+$lang['def']['right to set option 82 values for users'] = 'Привілей керування DHCP опцією 82 для користувачів';
+$lang['def']['Dynamic shaper is enabled'] = 'Динамічний шейпер увімкнено';
+$lang['def']['Watchdog'] = 'Собака-спостерігака';
+$lang['def']['Autofreezing cash limit'] = 'Поріг грошей, для автозаморожування';
+$lang['def']['Watchdog notifies that'] = 'Собака-спостерігака повідомляє, що';
+$lang['def']['Available Watchdog tasks'] = 'Існуючі задачі для собаки-спостерігаки';
+$lang['def']['Check type'] = 'Тип перевірки';
+$lang['def']['Operator'] = 'Оператор';
+$lang['def']['Condition'] = 'Умова';
+$lang['def']['Manage'] = 'Керування';
+$lang['def']['Show all tasks'] = 'Показати всі задачі';
+$lang['def']['Manual run'] = 'Ручний запуск';
+$lang['def']['Watchdog alert text'] = 'Текст повідомлення собаки-спостерігаки';
+$lang['def']['Phone numbers to send alerts'] = 'Телефонні номери для розсилки повідомлень';
+$lang['def']['Emails to send alerts'] = 'Адреси електропошти, для розсилання';
+$lang['def']['right to control watchdog'] = 'Право керування собакою-спостерігакою';
+
+$lang['def']['Set contract same as login after user register'] = 'Встановити угоду такою ж як і логін при реєстрації';
+$lang['def']['No existing DB backups here'] = 'Немає жодних дампів БД.';
+$lang['def']['Available database backups'] = 'Резервні копії БД в наявності';
+$lang['def']['Important Ubilling configs'] = 'Важливі конфіги Ubilling';
+$lang['def']['Autofreeze report'] = 'Звіт по автозаморозці';
+$lang['def']['right to view autofreeze report'] = 'Право перегляду звіту по автозаморозці';
+$lang['def']['Users without port assigned'] = 'Користувачі без присвоєного порта';
+$lang['def']['right to view report by users with no port assinged'] = 'Право переглядати звіт по користувачах без порта';
+$lang['def']['No location set'] = 'Не вказано місцезнаходження';
?>
diff --git a/modules/general/backups/index.php b/modules/general/backups/index.php
index 8e1a6aaaf..1ce5fcfc4 100755
--- a/modules/general/backups/index.php
+++ b/modules/general/backups/index.php
@@ -9,10 +9,96 @@
} else {
show_error(__('You are not mentally prepared for this'));
}
+}
+
+
+if (wf_CheckGet(array('download'))) {
+ if (cfr('ROOT')) {
+ $filePath= base64_decode($_GET['download']);
+ zb_DownloadFile($filePath);
+
+ } else {
+ show_window(__('Error'), __('Access denied'));
+ }
+}
+
+function web_AvailableDBBackupsList() {
+ $backupsPath=DATA_PATH.'backups/sql/';
+ $availbacks= rcms_scandir($backupsPath);
+ $result=__('No existing DB backups here');
+ if (!empty($availbacks)) {
+ $cells= wf_TableCell(__('Date'));
+ $cells.= wf_TableCell(__('Size'));
+ $cells.= wf_TableCell(__('Filename'));
+ $rows= wf_TableRow($cells, 'row1');
+
+ foreach ($availbacks as $eachDump) {
+ $fileDate= filectime($backupsPath.$eachDump);
+ $fileDate= date("Y-m-d H:i:s", $fileDate);
+ $fileSize= filesize($backupsPath.$eachDump);
+ $fileSize= stg_convert_size($fileSize);
+ $downloadLink= wf_Link('?module=backups&download='. base64_encode($backupsPath.$eachDump), $eachDump, false, '');
+
+ $cells= wf_TableCell($fileDate);
+ $cells.= wf_TableCell($fileSize);
+ $cells.= wf_TableCell($downloadLink);
+ $rows.= wf_TableRow($cells, 'row3');
+ }
+ $result= wf_TableBody($rows, '100%', '0', 'sortable');
+ }
-
+ return ($result);
}
+function web_ConfigsUbillingList() {
+ $downloadable=array(
+ 'config/billing.ini',
+ 'config/mysql.ini',
+ 'config/alter.ini',
+ 'config/ymaps.ini',
+ 'config/catv.ini',
+ 'config/dhcp/global.template',
+ 'config/dhcp/subnets.template',
+ 'config/dhcp/option82.template',
+ 'userstats/config/mysql.ini',
+ 'userstats/config/userstats.ini',
+ 'userstats/config/tariffmatrix.ini'
+ );
+
+
+ if (!empty($downloadable)) {
+ $cells= wf_TableCell(__('Date'));
+ $cells.= wf_TableCell(__('Size'));
+ $cells.= wf_TableCell(__('Filename'));
+ $rows= wf_TableRow($cells, 'row1');
+
+ foreach ($downloadable as $eachConfig) {
+ if (file_exists($eachConfig)) {
+ $fileDate= filectime($eachConfig);
+ $fileDate= date("Y-m-d H:i:s", $fileDate);
+ $fileSize= filesize($eachConfig);
+ $fileSize= stg_convert_size($fileSize);
+ $downloadLink= wf_Link('?module=backups&download='. base64_encode($eachConfig), $eachConfig, false, '');
+
+ $cells= wf_TableCell($fileDate);
+ $cells.= wf_TableCell($fileSize);
+ $cells.= wf_TableCell($downloadLink);
+ $rows.= wf_TableRow($cells, 'row3');
+ } else {
+ $cells= wf_TableCell('');
+ $cells.= wf_TableCell('');
+ $cells.= wf_TableCell($eachConfig);
+ $rows.= wf_TableRow($cells, 'row3');
+ }
+ }
+ $result= wf_TableBody($rows, '100%', '0', 'sortable');
+ }
+
+ return ($result);
+}
+
+
+
//tables cleanup
if (wf_CheckGet(array('tableclean'))) {
zb_DBTableCleanup($_GET['tableclean']);
@@ -22,8 +108,11 @@
show_window(__('Create backup'), web_BackupForm());
+show_window(__('Available database backups'), web_AvailableDBBackupsList());
+show_window(__('Important Ubilling configs'), web_ConfigsUbillingList());
show_window(__('Database cleanup'),web_DBCleanupForm());
+
} else {
show_error(__('You cant control this module'));
}
diff --git a/modules/general/dshaper/index.php b/modules/general/dshaper/index.php
index 9b6f6fa46..2951cc0a3 100755
--- a/modules/general/dshaper/index.php
+++ b/modules/general/dshaper/index.php
@@ -4,74 +4,30 @@
function web_DshapeShowTimeRules() {
$query="SELECT * from `dshape_time`";
$allrules=simple_queryall($query);
-// $alltariffs=zb_TariffsGetAll();
-// $shaperules=array();
- $result='';
- $result='';
- $result.='
-
- '.__('ID').'
- '.__('Tariff').'
- '.__('Time from').'
- '.__('Time to').'
- '.__('Speed').'
- '.__('Actions').'
-
- ';
+
+ $cells= wf_TableCell(__('ID'));
+ $cells.= wf_TableCell(__('Tariff'));
+ $cells.= wf_TableCell(__('Time from'));
+ $cells.= wf_TableCell(__('Time to'));
+ $cells.= wf_TableCell(__('Speed'));
+ $cells.= wf_TableCell(__('Actions'));
+ $rows= wf_TableRow($cells, 'row1');
if (!empty ($allrules)) {
foreach ($allrules as $io=>$eachrule) {
- $result.='
-
- '.$eachrule['id'].'
- '.$eachrule['tariff'].'
- '.$eachrule['threshold1'].'
- '.$eachrule['threshold2'].'
- '.$eachrule['speed'].'
-
- '. wf_JSAlert('?module=dshaper&delete='.$eachrule['id'], web_delete_icon(), 'Removing this may lead to irreparable results').'
- '.web_edit_icon().'
-
-
- ';
- }
+ $cells= wf_TableCell($eachrule['id']);
+ $cells.= wf_TableCell($eachrule['tariff']);
+ $cells.= wf_TableCell($eachrule['threshold1']);
+ $cells.= wf_TableCell($eachrule['threshold2']);
+ $cells.= wf_TableCell($eachrule['speed']);
+ $actions= wf_JSAlert('?module=dshaper&delete='.$eachrule['id'], web_delete_icon(), 'Removing this may lead to irreparable results');
+ $actions.= wf_JSAlert('?module=dshaper&edit='.$eachrule['id'], web_edit_icon(), __('Are you serious'));
+ $cells.= wf_TableCell($actions);
+ $rows.= wf_TableRow($cells, 'row3');
+ }
}
- $result.='
';
- //new interface
-// if (!empty ($allrules)) {
-// foreach ($allrules as $io=>$eachrule) {
-// $shaperules[$eachrule['tariff']]['id']=$eachrule['id'];
-// $shaperules[$eachrule['tariff']]['tariff']=$eachrule['tariff'];
-// $shaperules[$eachrule['tariff']]['threshold1']=$eachrule['threshold1'];
-// $shaperules[$eachrule['tariff']]['threshold2']=$eachrule['threshold2'];
-// $shaperules[$eachrule['tariff']]['speed']=$eachrule['speed'];
-// }
-// }
-//
-//
-//
-// if (!empty($alltariffs)) {
-// foreach ($alltariffs as $ia=>$eachtariff) {
-// if (isset($shaperules[$eachtariff['name']])) {
-// $content=''.$eachtariff['name'].' ';
-// $tablecells= wf_TableCell(__('ID'));
-// $tablecells.= wf_TableCell(__('Tariff'));
-// $tablecells.= wf_TableCell(__('Time from'));
-// $tablecells.= wf_TableCell(__('Time to'));
-// $tablecells.= wf_TableCell(__('Speed'));
-// $tablecells.= wf_TableCell(__('Actions'));
-// $tablerows= wf_TableRow($tablecells, 'row2');
-//
-//
-// $content.=wf_TableBody($tablerows, '100%', '0');
-//
-// $result.=wf_Plate($content, '400px', '200px', 'glamour');
-// }
-// }
-// }
-// $result.=' ';
-
+ $result= wf_TableBody($rows, '100%', '0', 'sortable');
show_window(__('Available dynamic shaper time rules'),$result);
}
@@ -79,20 +35,19 @@ function zb_DshapeDeleteTimeRule($ruleid) {
$ruleid=vf($ruleid);
$query="DELETE from dshape_time where `id`='".$ruleid."'";
nr_query($query);
- log_register("DSHAPE DELETE ".$ruleid);
+ log_register("DSHAPE DELETE [".$ruleid.']');
}
function web_DshapeShowTimeRuleAddForm() {
- $form='
-
-
- ';
+ $sup= wf_tag('sup').'*'.wf_tag('sup', true);
+
+ $inputs= web_tariffselector('newdshapetariff').' '.__('Tariff').wf_tag('br');
+ $inputs.= wf_TextInput('newthreshold1', __('Time from').$sup, '', true);
+ $inputs.= wf_TextInput('newthreshold2', __('Time to').$sup, '', true);
+ $inputs.= wf_TextInput('newspeed', __('Speed').$sup, '', true);
+ $inputs.= wf_Submit(__('Create'));
+ $form= wf_Form('', 'POST', $inputs, 'glamour');
+
show_window(__('Add new time shaper rule'),$form);
}
@@ -100,16 +55,18 @@ function web_DshapeShowTimeRuleEditForm($timeruleid) {
$timeruleid=vf($timeruleid);
$query="SELECT * from `dshape_time` WHERE `id`='".$timeruleid."'";
$timerule_data=simple_query($query);
- $form='
-
-
- ';
+
+ $sup= wf_tag('sup').'*'.wf_tag('sup', true);
+
+ $inputs= wf_tag('input', false, '', 'type="text" name="editdshapetariff" value="'.$timerule_data['tariff'].'" READONLY'). wf_tag('br');
+ $inputs.= wf_TextInput('editthreshold1', __('Time from').$sup, $timerule_data['threshold1'], true);
+ $inputs.= wf_TextInput('editthreshold2', __('Time to').$sup, $timerule_data['threshold2'], true);
+ $inputs.= wf_TextInput('editspeed', __('Speed').$sup, $timerule_data['speed'], true);
+ $inputs.= wf_Submit(__('Save'));
+ $form= wf_Form('', 'POST', $inputs, 'glamour');
+ $form.= wf_Link('?module=dshaper', __('Back'), true, 'ubButton');
+
+
show_window(__('Edit time shaper rule'),$form);
}
@@ -131,7 +88,7 @@ function zb_DshapeAddTimeRule($tariff,$threshold1,$threshold2,$speed) {
NULL , '".$tariff."', '".$threshold1."', '".$threshold2."', '".$speed."'
);";
nr_query($query);
- log_register("DSHAPE ADD ".$tariff);
+ log_register("DSHAPE ADD `".$tariff.'`');
}
function zb_DshapeEditTimeRule($timeruleid,$threshold1,$threshold2,$speed) {
@@ -145,10 +102,13 @@ function zb_DshapeEditTimeRule($timeruleid,$threshold1,$threshold2,$speed) {
`speed` = '".$speed."' WHERE `id` ='".$timeruleid."' LIMIT 1;
";
nr_query($query);
- log_register("DSHAPE CHANGE ".$timeruleid.' ON '.$speed);
+ log_register("DSHAPE CHANGE [".$timeruleid.'] ON `'.$speed.'`');
}
-//debug
+$alterconf= rcms_parse_ini_file(CONFIG_PATH."alter.ini");
+if (isset($alterconf['DSHAPER_ENABLED'])) {
+if ($alterconf['DSHAPER_ENABLED']) {
+
//if someone deleting time rule
if (isset($_GET['delete'])) {
@@ -180,7 +140,14 @@ function zb_DshapeEditTimeRule($timeruleid,$threshold1,$threshold2,$speed) {
//show add form
web_DshapeShowTimeRuleAddForm();
-
+} else {
+ show_window(__('Error'), __('This module is disabled'));
+ }
+
+} else {
+ show_window(__('Error'), __('This module is disabled'));
+ }
+//end of option enabled check
} else {
show_error(__('You cant control this module'));
diff --git a/modules/general/macvendor/index.php b/modules/general/macvendor/index.php
index c34b32b8b..3177dcc72 100644
--- a/modules/general/macvendor/index.php
+++ b/modules/general/macvendor/index.php
@@ -6,7 +6,7 @@
if (wf_CheckGet(array('mac','username'))) {
$mac=$_GET['mac'];
$login=$_GET['username'];
- $vendor=''.zb_MacVendorLookup($mac).' ';
+ $vendor= wf_tag('h3'). wf_tag('center').zb_MacVendorLookup($mac). wf_tag('center',true).wf_tag('h3',true);
$result=$vendor;
print($result);
diff --git a/modules/general/pl_option82/index.php b/modules/general/pl_option82/index.php
new file mode 100644
index 000000000..5d30c1167
--- /dev/null
+++ b/modules/general/pl_option82/index.php
@@ -0,0 +1,212 @@
+'.$circuitID;
+ }
+ }
+ }
+
+ }
+
+ return ($result);
+ }
+
+ /*
+ * get all busy option 82 leases
+ *
+ * @return array - list of uses leases for isset check
+ */
+ function opt82_GetAllUsedLeases() {
+ $query="SELECT * from `nethosts` WHERE `option` IS NOT NULL";
+ $allNethosts= simple_queryall($query);
+ $result=array();
+ if (!empty($allNethosts)) {
+ foreach ($allNethosts as $io=>$each) {
+ if (!empty($each['option'])) {
+ $result[]=$each['option'];
+ }
+ }
+ $result= array_flip($result);
+ }
+ return ($result);
+ }
+
+
+ /*
+ * Get current nethost options by user`s login
+ *
+ * @param $login - user`s login
+ *
+ * @return array
+ */
+ function opt82_GetCurrentOptions($login) {
+ $login= mysql_real_escape_string($login);
+ $userIp= zb_UserGetIP($login);
+ $nethost_q="SELECT * from `nethosts` WHERE `ip`='".$userIp."'";
+ $nethostRaw= simple_query($nethost_q);
+
+ $result=array();
+ $result['hostid']='';
+ $result['hostip']='';
+ $result['netid']='';
+ $result['remoteid']='';
+ $result['circuitid']='';
+
+
+ if (!empty($nethostRaw)) {
+ $result['hostid']=$nethostRaw['id'];
+ $result['hostip']=$nethostRaw['ip'];
+ $result['netid']=$nethostRaw['netid'];
+
+ if (!empty($nethostRaw['option'])) {
+ $explode= explode('|', $nethostRaw['option']);
+ if (isset($explode[1])) {
+ $result['remoteid']=$explode[0];
+ $result['circuitid']=$explode[1];
+ }
+ }
+ }
+ return ($result);
+ }
+
+ /*
+ * Returns nethost option modify form
+ *
+ * @param $allLeases - all available leases parsed from log
+ * @param $login - user`s login
+ *
+ * @return string
+ */
+ function web_opt82_ShowForm($allLeases,$login) {
+ $result='';
+ $currentData=opt82_GetCurrentOptions($login);
+
+ $cells= wf_TableCell(__('IP'));
+ $cells.= wf_TableCell($currentData['hostip']);
+ $rows= wf_TableRow($cells, 'row3');
+ $cells= wf_TableCell(__('Remote-ID'));
+ $cells.= wf_TableCell($currentData['remoteid']);
+ $rows.= wf_TableRow($cells, 'row3');
+ $cells= wf_TableCell(__('Circuit-ID'));
+ $cells.= wf_TableCell($currentData['circuitid']);
+ $rows.= wf_TableRow($cells, 'row3');
+
+ $currentTable= wf_TableBody($rows, '30%', '0', '');
+ $result.=$currentTable;
+ $result.=wf_delimiter();
+
+ $inputs= wf_Selector('newopt82', $allLeases, __('New DHCP option 82'), '', true);
+ $inputs.= wf_HiddenInput('edithostid', $currentData['hostid']);
+ $inputs.= wf_HiddenInput('edithostip', $currentData['hostip']);
+ $inputs.= wf_CheckInput('setrandomopt82', __('Set random'), true, false);
+ $inputs.= wf_Submit(__('Save'));
+ $form= wf_Form('', 'POST', $inputs, 'glamour');
+
+ $result.=$form;
+ $result.=wf_delimiter();
+ $result.=web_UserControls($login);
+
+ return ($result);
+ }
+
+ /*
+ * Update some option in "remote-id|circuit-id" view into the nethosts
+ *
+ * @param $ip - nethost ip
+ * @param $option - nethost option to set
+ *
+ * @return void
+ */
+ function opt82_SetOption($ip,$option) {
+ $query="UPDATE `nethosts` SET `option`='".$option."' WHERE `ip`='".$ip."'";
+ nr_query($query);
+ log_register("OPT82 SET ".$ip.' `'.$option.'`');
+ }
+
+
+ /*
+ * checks for available dhcp82 networks
+ *
+ * @return bool
+ */
+ function opt82_NetsAvailable () {
+ $query="SELECT `id` from `networks` WHERE `nettype`='dhcp82';";
+ $rawData= simple_query($query);
+ if (!empty($rawData)) {
+ return (true);
+ } else {
+ return (false);
+ }
+ }
+
+
+ if (wf_CheckGet(array('username'))) {
+ $login= $_GET['username'];
+
+ if (opt82_NetsAvailable()) {
+ $busyLeases= opt82_GetAllUsedLeases();
+ $allLeases= opt82_LoadLeases($billing_config,$altercfg,$busyLeases);
+
+ if (wf_CheckPost(array('edithostid','edithostip'))) {
+ if (!isset($_POST['setrandomopt82'])) {
+ if (wf_CheckPost(array('newopt82'))) {
+ opt82_SetOption($_POST['edithostip'],$_POST['newopt82']);
+ } else {
+ show_error(__('No option 82 get'));
+ }
+
+ } else {
+ $randomRemoteId='14:88:'.rand(10000,99999);
+ $randomCircuitId=rand(10000,99999);
+ $randomNewOpt=$randomRemoteId.'|'.$randomCircuitId;
+ opt82_SetOption($_POST['edithostip'],$randomNewOpt);
+ }
+
+ multinet_rebuild_all_handlers();
+ rcms_redirect("?module=pl_option82&username=".$login);
+ }
+ show_window(__('Current value'),web_opt82_ShowForm($allLeases,$login));
+ } else {
+ show_window(__('Error'), __('No DHCP option 82 networks available'));
+ }
+
+ }
+
+
+} else {
+ show_error(__('You cant control this module'));
+}
+?>
diff --git a/modules/general/pl_option82/module.php b/modules/general/pl_option82/module.php
new file mode 100644
index 000000000..473847f9a
--- /dev/null
+++ b/modules/general/pl_option82/module.php
@@ -0,0 +1,3 @@
+registerModule($module, 'main', __('User option 82 control'), 'Nightfly', array('OPTION82' => __('right to set option 82 values for users')));
+?>
diff --git a/modules/general/remoteapi/index.php b/modules/general/remoteapi/index.php
index a49d220d4..430a99eaa 100755
--- a/modules/general/remoteapi/index.php
+++ b/modules/general/remoteapi/index.php
@@ -253,6 +253,41 @@
file_put_contents('exports/cache_mac', $cacheMacArr);
die('OK:REBUILDUSERDATACACHE');
}
+
+ /*
+ * auto freezing call
+ */
+ if ($_GET['action']=='autofreeze') {
+ if (isset($alterconf['AUTOFREEZE_CASH_LIMIT'])) {
+ $afCashLimit=$alterconf['AUTOFREEZE_CASH_LIMIT'];
+ $autoFreezeQuery="SELECT * from `users` WHERE `Passive`='0' AND `Cash`<='".$afCashLimit."' AND `Credit`='0';";
+ $allUsersToFreeze= simple_queryall($autoFreezeQuery);
+ $freezeCount=0;
+ if (!empty($allUsersToFreeze)) {
+ foreach ($allUsersToFreeze as $efuidx=>$eachfreezeuser) {
+ $freezeLogin=$eachfreezeuser['login'];
+ $freezeCash=$eachfreezeuser['Cash'];
+ $billing->setpassive($freezeLogin,'1');
+ log_register('AUTOFREEZE ('.$freezeLogin.') ON BALANCE '.$freezeCash);
+ $freezeCount++;
+ }
+ log_register('AUTOFREEZE DONE COUNT `'.$freezeCount.'`');
+ die('OK:AUTOFREEZE');
+ } else {
+ die('OK:NO_USERS_TO_AUTOFREEZE');
+ }
+ } else {
+ die('ERROR:NO_AUTOFREEZE_CASH_LIMIT');
+ }
+ }
+ /*
+ * Watchdog tasks processing
+ */
+ if ($_GET['action']=='watchdog') {
+ $runWatchDog=new WatchDog();
+ $runWatchDog->processTask();
+ die('OK:WATCHDOG');
+ }
////
//// End of actions
////
diff --git a/modules/general/report_autofreeze/index.php b/modules/general/report_autofreeze/index.php
new file mode 100644
index 000000000..7b9cd8eaa
--- /dev/null
+++ b/modules/general/report_autofreeze/index.php
@@ -0,0 +1,120 @@
+loadData($date);
+ //sets default calendar position
+ $this->interval=$date;
+ }
+
+ /*
+ * parse data from system weblog and store it into private property
+ *
+ * @return void
+ */
+ private function loadData($date='') {
+ if (!empty($date)) {
+ $wherePostfix=" AND `date` LIKE '".$date."%';";
+ } else {
+ $wherePostfix=' LIMIT 50;';
+ }
+ $query="SELECT * from `weblogs` WHERE `event` LIKE 'AUTOFREEZE (%'".$wherePostfix;
+ $alldata= simple_queryall($query);
+
+ if (!empty($alldata)) {
+ foreach ($alldata as $io=>$each) {
+ $this->data[$each['id']]['id']=$each['id'];
+ $this->data[$each['id']]['date']=$each['date'];
+ $this->data[$each['id']]['admin']=$each['admin'];
+ $this->data[$each['id']]['ip']=$each['ip'];
+
+ $parse= explode(' ',$each['event']);
+
+ //all elements available
+ if (sizeof($parse)==5) {
+ $userLogin=str_replace('(', '', $parse[1]);
+ $userLogin=str_replace(')', '', $userLogin);
+ $userBalance=$parse[4];
+ $this->data[$each['id']]['login']=$userLogin;
+ $this->data[$each['id']]['balance']=$userBalance;
+ }
+
+ }
+ }
+ }
+
+
+ /*
+ * returns private propert data
+ *
+ * @return array
+ */
+ public function getData () {
+ $result= $this->data;
+ return ($result);
+ }
+
+ /*
+ * renders autofreeze report by existing private data prop
+ *
+ * @return string
+ */
+ public function render() {
+ $allAddress= zb_AddressGetFulladdresslist();
+ $allRealNames= zb_UserGetAllRealnames();
+
+ $cells= wf_TableCell(__('ID'));
+ $cells.= wf_TableCell(__('Date'));
+ $cells.= wf_TableCell(__('Login'));
+ $cells.= wf_TableCell(__('Address'));
+ $cells.= wf_TableCell(__('Real Name'));
+ $cells.= wf_TableCell(__('Cash'));
+ $rows= wf_TableRow($cells, 'row1');
+
+ if (!empty($this->data)) {
+ foreach ($this->data as $io=>$each) {
+ $cells= wf_TableCell($each['id']);
+ $cells.= wf_TableCell($each['date']);
+ $loginLink= wf_Link("?module=userprofile&username=".$each['login'], web_profile_icon().' '.$each['login'], false, '');
+ $cells.= wf_TableCell($loginLink);
+ $cells.= wf_TableCell(@$allAddress[$each['login']]);
+ $cells.= wf_TableCell(@$allRealNames[$each['login']]);
+ $cells.= wf_TableCell($each['balance']);
+ $rows.= wf_TableRow($cells, 'row3');
+ }
+ }
+ $result= wf_TableBody($rows, '100%', '0', 'sortable');
+ return ($result);
+ }
+
+ /*
+ * renders form for date selecting
+ *
+ * @return string
+ */
+ public function dateForm() {
+ $inputs= wf_DatePickerPreset('date', $this->interval);
+ $inputs.= __('By date').' ';
+ $inputs.= wf_Submit(__('Show'));
+ $result= wf_Form("", 'POST', $inputs, 'glamour');
+ return ($result);
+ }
+
+ }
+
+
+
+ $datePush= (wf_CheckPost(array('date'))) ? $dateSelector=$_POST['date'] : $dateSelector='';
+ $autoFreezeReport = new ReportAutoFreeze($dateSelector);
+ show_window('', $autoFreezeReport->dateForm());
+ show_window(__('Autofreeze report'),$autoFreezeReport->render());
+
+} else {
+ show_error(__('You cant control this module'));
+}
diff --git a/modules/general/report_autofreeze/module.php b/modules/general/report_autofreeze/module.php
new file mode 100644
index 000000000..fa53744c8
--- /dev/null
+++ b/modules/general/report_autofreeze/module.php
@@ -0,0 +1,3 @@
+registerModule($module, 'main', __('Autofreeze report'), 'Nightfly', array('REPORTAUTOFREEZE' => __('right to view autofreeze report')));
+?>
diff --git a/modules/general/report_noswitchport/index.php b/modules/general/report_noswitchport/index.php
new file mode 100644
index 000000000..a9d244c8d
--- /dev/null
+++ b/modules/general/report_noswitchport/index.php
@@ -0,0 +1,96 @@
+loadData();
+ //loads full user list
+ $this->loadAllUsers();
+ }
+
+ /*
+ * get all users with switch port assing and pus it into data prop
+ *
+ * @return void
+ */
+ private function loadData() {
+
+ $query="SELECT * from `switchportassign`;";
+ $alldata= simple_queryall($query);
+
+ if (!empty($alldata)) {
+ foreach ($alldata as $io=>$each) {
+ $this->data[$each['login']]=$each['login'];
+ }
+ }
+ }
+
+ /*
+ * get all users logins and push it into allusers prop
+ *
+ * @return void
+ */
+ private function loadAllUsers() {
+
+ $query="SELECT `login` from `users`;";
+ $alldata= simple_queryall($query);
+
+ if (!empty($alldata)) {
+ foreach ($alldata as $io=>$each) {
+ $this->allusers[$each['login']]=$each['login'];
+ }
+ }
+ }
+
+ /*
+ * returns private propert data
+ *
+ * @return array
+ */
+ public function getData () {
+ $result= $this->data;
+ return ($result);
+ }
+
+ /*
+ * renders report by existing private data prop
+ *
+ * @return string
+ */
+ public function render() {
+ $diff=array();
+ if (!empty($this->allusers)) {
+ foreach ($this->allusers as $io=>$each) {
+ if (!isset($this->data[$each])) {
+ $this->diff[$each]=$each;
+ }
+ }
+ }
+ $result= web_UserArrayShower($this->diff);
+ return ($result);
+ }
+
+
+ }
+
+ /*
+ * controller and view section
+ */
+
+ $altercfg= rcms_parse_ini_file(CONFIG_PATH."alter.ini");
+ if ($altercfg['SWITCHPORT_IN_PROFILE']) {
+ $noSwitchPortReport=new ReportNoSwitchPort();
+ show_window(__('Users without port assigned'),$noSwitchPortReport->render());
+ } else {
+ show_window(__('Error'), __('This module disabled'));
+ }
+
+} else {
+ show_error(__('You cant control this module'));
+}
diff --git a/modules/general/report_noswitchport/module.php b/modules/general/report_noswitchport/module.php
new file mode 100644
index 000000000..482a462a2
--- /dev/null
+++ b/modules/general/report_noswitchport/module.php
@@ -0,0 +1,3 @@
+registerModule($module, 'main', __('Users without port assigned'), 'Nightfly', array('REPORTNOSWPORT' => __('right to view report by users with no port assinged')));
+?>
diff --git a/modules/general/sqlconsole/index.php b/modules/general/sqlconsole/index.php
index 9a275f20b..9078c1e76 100755
--- a/modules/general/sqlconsole/index.php
+++ b/modules/general/sqlconsole/index.php
@@ -169,7 +169,7 @@ function web_PhpConsoleShowTemplates() {
ob_end_clean();
return show_window('SQL '.__('Result'),wf_tag('b').__('Wrong query').':'. wf_tag('b', true). wf_delimiter().$newquery);
} else {
- while($row = mysql_fetch_assoc($queried)) {
+ while(@$row = mysql_fetch_assoc($queried)) {
$query_result[]= $row;
}
diff --git a/modules/general/ticketing/index.php b/modules/general/ticketing/index.php
index 9903b120b..7bb178823 100755
--- a/modules/general/ticketing/index.php
+++ b/modules/general/ticketing/index.php
@@ -27,6 +27,7 @@ function web_TicketsShow() {
$tablecells.=wf_TableCell(__('From'));
$tablecells.=wf_TableCell(__('Real Name'));
$tablecells.=wf_TableCell(__('Full address'));
+ $tablecells.=wf_TableCell(__('IP'));
$tablecells.=wf_TableCell(__('Tariff'));
$tablecells.=wf_TableCell(__('Balance'));
$tablecells.=wf_TableCell(__('Credit'));
@@ -41,6 +42,7 @@ function web_TicketsShow() {
$alltariffs=zb_TariffsGetAllUsers();
$allcash=zb_CashGetAllUsers();
$allcredits=zb_CreditGetAllUsers();
+ $alluserips= zb_UserGetAllIPs();
foreach ($alltickets as $io=>$eachticket) {
@@ -50,6 +52,7 @@ function web_TicketsShow() {
$tablecells.=wf_TableCell($fromlink);
$tablecells.=wf_TableCell(@$allrealnames[$eachticket['from']]);
$tablecells.=wf_TableCell(@$alladdress[$eachticket['from']]);
+ $tablecells.=wf_TableCell(@$alluserips[$eachticket['from']]);
$tablecells.=wf_TableCell(@$alltariffs[$eachticket['from']]);
$tablecells.=wf_TableCell(@$allcash[$eachticket['from']]);
$tablecells.=wf_TableCell(@$allcredits[$eachticket['from']]);
@@ -107,6 +110,7 @@ function web_TicketDialogue($ticketid) {
$alltariffs=zb_TariffsGetAllUsers();
$allcash=zb_CashGetAllUsers();
$allcredits=zb_CreditGetAllUsers();
+ $alluserips= zb_UserGetAllIPs();
if ($ticketdata['status']) {
$actionlink=wf_Link('?module=ticketing&openticket='.$ticketdata['id'], 'Open', false, 'ubButton');
@@ -120,6 +124,7 @@ function web_TicketDialogue($ticketid) {
$tablecells.=wf_TableCell(__('Login'));
$tablecells.=wf_TableCell(__('Real Name'));
$tablecells.=wf_TableCell(__('Full address'));
+ $tablecells.=wf_TableCell(__('IP'));
$tablecells.=wf_TableCell(__('Tariff'));
$tablecells.=wf_TableCell(__('Balance'));
$tablecells.=wf_TableCell(__('Credit'));
@@ -132,6 +137,7 @@ function web_TicketDialogue($ticketid) {
$tablecells.=wf_TableCell($profilelink);
$tablecells.=wf_TableCell(@$allrealnames[$ticketdata['from']]);
$tablecells.=wf_TableCell(@$alladdress[$ticketdata['from']]);
+ $tablecells.=wf_TableCell(@$alluserips[$ticketdata['from']]);
$tablecells.=wf_TableCell(@$alltariffs[$ticketdata['from']]);
$tablecells.=wf_TableCell(@$allcash[$ticketdata['from']]);
$tablecells.=wf_TableCell(@$allcredits[$ticketdata['from']]);
diff --git a/modules/general/turbosms/index.php b/modules/general/turbosms/index.php
index 8bec149e8..25040791d 100644
--- a/modules/general/turbosms/index.php
+++ b/modules/general/turbosms/index.php
@@ -72,7 +72,7 @@ function tsms_SafeEscapeString($string) {
function tsms_query($query) {
global $tsms_host,$tsms_db,$tsms_login,$tsms_password,$tsms_table;
$TsmsDB = new DbConnect($tsms_host, $tsms_login, $tsms_password, $tsms_db, $error_reporting = true, $persistent = false);
- $TsmsDB->open() or die($db->error());
+ $TsmsDB->open() or die($TsmsDB->error());
$result = array();
$TsmsDB->query('SET NAMES utf8;');
$TsmsDB->query($query);
diff --git a/modules/general/userreg/index.php b/modules/general/userreg/index.php
index 45daefa7d..b7b8aad49 100755
--- a/modules/general/userreg/index.php
+++ b/modules/general/userreg/index.php
@@ -1,6 +1,7 @@
loadAllTasks();
+ $interface->loadSettings();
+
+ //manual run of existing tasks
+ if (wf_CheckGet(array('manual'))) {
+ $watchdog=new WatchDog();
+ $watchdog->processTask();
+ rcms_redirect("?module=watchdog");
+ }
+ //deleting existing task
+ if (wf_CheckGet(array('delete'))) {
+ $interface->deleteTask($_GET['delete']);
+ rcms_redirect("?module=watchdog");
+ }
+
+ //adding new task
+ if (wf_CheckPost(array('newname','newchecktype','newparam','newoperator'))) {
+ if (isset($_POST['newactive'])) {
+ $newActivity=1;
+ } else {
+ $newActivity=0;
+ }
+ $interface->createTask($_POST['newname'], $_POST['newchecktype'], $_POST['newparam'], $_POST['newoperator'], $_POST['newcondition'], $_POST['newaction'], $newActivity);
+ rcms_redirect("?module=watchdog");
+ }
+
+ //changing task
+ if (wf_CheckPost(array('editname'))) {
+ $interface->changeTask();
+ rcms_redirect("?module=watchdog");
+ }
+
+ //changing watchdog settings
+ if (wf_CheckPost(array('changealert'))) {
+ $interface->saveSettings();
+ rcms_redirect("?module=watchdog");
+ }
+
+
+
+ //show sms queue
+ if (wf_CheckGet(array('showsmsqueue'))) {
+ show_window('', wf_Link('?module=watchdog', __('Back'), true, 'ubButton'));
+ show_window(__('View SMS sending queue'), $interface->showSMSqueue());
+
+ } else {
+ //show watchdog main control panel
+ show_window('', $interface->panel());
+
+ if (!wf_CheckGet(array('edit'))) {
+ //show interface controls
+ show_window(__('Available Watchdog tasks'),$interface->listAllTasks());
+ } else {
+ //show task edit form
+ show_window(__('Edit task'),$interface->editTaskForm($_GET['edit']));
+ }
+ }
+
+
+} else {
+ show_error(__('Access denied'));
+}
+
+?>
\ No newline at end of file
diff --git a/modules/general/watchdog/module.php b/modules/general/watchdog/module.php
new file mode 100644
index 000000000..ca3483336
--- /dev/null
+++ b/modules/general/watchdog/module.php
@@ -0,0 +1,3 @@
+registerModule($module, 'main', 'Watchdog', 'Nightfly', array('WATCHDOG' => __('right to control watchdog')));
+?>
\ No newline at end of file
diff --git a/skins/opt82.png b/skins/opt82.png
new file mode 100755
index 000000000..71b70e9e4
Binary files /dev/null and b/skins/opt82.png differ
diff --git a/skins/taskbar/autofreeze.png b/skins/taskbar/autofreeze.png
new file mode 100644
index 000000000..d15b743a1
Binary files /dev/null and b/skins/taskbar/autofreeze.png differ
diff --git a/skins/taskbar/noswitchport.png b/skins/taskbar/noswitchport.png
new file mode 100644
index 000000000..77ea743a8
Binary files /dev/null and b/skins/taskbar/noswitchport.png differ
diff --git a/skins/taskbar/watchdog.jpg b/skins/taskbar/watchdog.jpg
new file mode 100755
index 000000000..8750c27c7
Binary files /dev/null and b/skins/taskbar/watchdog.jpg differ
diff --git a/userstats/config/userstats.ini b/userstats/config/userstats.ini
index 5f06bc9a6..42da58563 100755
--- a/userstats/config/userstats.ini
+++ b/userstats/config/userstats.ini
@@ -1,6 +1,9 @@
-;authorisation types - currently support "ip" and "login" methods
+;authorization types - currently support "ip" and "login" methods
auth=ip
+;ip authorization failure redirect action
+authfailredir=""
+
;Default language, available values: ukrainian,russian,english
lang = russian
diff --git a/userstats/modules/engine/api.userstats.php b/userstats/modules/engine/api.userstats.php
index 1abee96aa..35bfee678 100755
--- a/userstats/modules/engine/api.userstats.php
+++ b/userstats/modules/engine/api.userstats.php
@@ -31,7 +31,7 @@ function zbs_UserDetectIp($debug=false) {
}
}
if ($debug) {
- // $ip='172.30.0.2';
+ // $ip='172.30.0.2';
}
return($ip);
@@ -45,7 +45,18 @@ function zbs_UserGetLoginByIp($ip) {
return($result['login']);
} else {
if ($glob_conf['auth']=='ip') {
+ if ((isset($glob_conf['authfailredir']))) {
+ if (!empty($glob_conf['authfailredir'])) {
+ rcms_redirect($glob_conf['authfailredir']);
+ die('Unknown user');
+ } else {
+ die('Unknown user');
+ }
+
+ } else {
die('Unknown user');
+ }
+
}
}
diff --git a/userstats/modules/general/paycards/index.php b/userstats/modules/general/paycards/index.php
index 1cded9894..8bb1127c1 100755
--- a/userstats/modules/general/paycards/index.php
+++ b/userstats/modules/general/paycards/index.php
@@ -66,6 +66,7 @@ function zbs_PaycardGetParams($cardnumber) {
function zbs_PaycardUse($cardnumber) {
global $user_ip;
global $user_login;
+ $cardnumber=vf($cardnumber);
$us_config= zbs_LoadConfig();
$carddata=zbs_PaycardGetParams($cardnumber);
$cardcash=$carddata['cash'];
@@ -75,7 +76,7 @@ function zbs_PaycardUse($cardnumber) {
`usedip` = '".$user_ip."',
`usedate`= '".$ctime."',
`used`='1'
- WHERE `serial` =".$cardnumber." LIMIT 1 ;
+ WHERE `serial` ='".$cardnumber."';
";
nr_query($carduse_q);
zbs_PaymentLog($user_login, $cardcash, $us_config['PC_CASHTYPEID'], "CARD:".$cardnumber);