Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1219

Přidáno uživatelem Michal Kliment před asi 13 roky(ů)

Implementace bezdratoveho nastaveni. U portu pridani cisla.

Zobrazit rozdíly:

freenetis/branches/testing/application/i18n/cs_CZ/texts.php
'birthday' => 'Datum narození',
'bitrate' => 'Rychlost přenosu',
'bitrate is required' => 'Rychlost přenosu je povinná.',
'bit rate is invalid - it has to be smaller or equal to max bit rate of choosen wireless norm' => 'Rychlost přenosu je neplatná - musí být menší nebo rovna maximální rychlosti přenosu vybrané normy Wi-Fi.',
'before getting started, we need some information on the database' => 'Předtím než začneme, potřebujeme několik informací o databázi.',
'body' => 'Tělo',
'both' => 'obojí',
......
'changed values' => 'Změněné hodnoty',
'change voicemail password' => 'Změnit heslo hlasové schránky',
'channel' => 'Kanál',
'channel width' => 'Šířka kanálu',
'check again' => 'Znovu zkontrolovat',
'choose date' => 'Vyberte datum',
'choose language' => 'Vyberte jazyk',
'choose format of export' => 'Vyberte formát exportu',
'circular' => 'kruhová',
'clean urls' => 'Čistá URL',
'client' => 'klient',
'clip data' => 'Údaje v CLIP',
'closing balance' => 'Konečný zůstatek',
'cloud' => 'Oblast',
......
'dhcp configuration' => 'Konfigurace DHCP',
'dhcp configuration file was successfully generated' => 'Konfigurační soubor pro DHCP byl úspěšně vygenerován',
'direction' => 'Směr',
'directional' => 'směrová',
'directory' => 'adresář',
'directory "static" is not writable, change access rights' => 'Adresář "static" není zapisovatelný, změňte přístupová práva.',
'directory "upload" is not writable, change access rights' => 'Adresář "upload" není zapisovatelný, změňte přístupová práva.',
......
'error - voip not enabled' => 'Chyba - VoIP není povoleno',
'error: parameter ID is required!' => 'Chyba: parametr ID je povinný!',
'etc' => 'apod',
'ethernet' => 'ethernetové',
'example' => 'Příklad',
'exclude numbers' => 'Vynechaná čísla',
'execution time' => 'Doba provádění',
......
'from/to' => 'Od/komu',
'from' => 'Od',
'from2' => 'z',
'fiber optical multi-mode' => 'vlákno - optické vícevidové',
'fiber optical single-mode' => 'vlákno - optické jednovidové',
'fixed calls' => 'Volání na pevnou linku',
'gateway' => 'Brána',
'gateway information' => 'Informace o bráně',
......
'history of phone services between' => 'Historie telefonních služeb mezi',
'history of phone services between user and phone' => 'Historie telefonních služeb mezi uživatelem a číslem',
'honorary member' => 'Čestný člen',
'horizontal' => 'horizontální',
'horizontal and vertical' => 'horizontální a vertikální',
'hostname' => 'Název hostitele',
'hours' => 'Hodin',
'hours2' => 'Hodiny',
......
'minimal suggest amount' => 'Minimální navrhovaná částka',
'minimum of traffic' => 'Minimální provoz',
'mode' => 'Mód',
'mode is required' => 'Mód je povinný.',
'monitor' => 'Sledovat',
'month' => 'Měsíc',
'month from' => 'Od měsíce (včetně)',
......
'monthly member payment have to be a number' => 'Měsíční členské příspěvky musí být číslo',
'monthly member fee' => 'Měsíční členský příspěvek',
'monthly payment rate' => 'Měsíční splátka',
'multi-mode optical fiber' => 'vícevidové optické vlákno',
'must be logged in' => 'Musíte se přihlásit.',
'must pay regular fee' => 'Platí pravidelný příspěvek',
'my backups' => 'Moje zálohy',
......
'of all users works' => 'všech prací uživatele',
'of user' => 'uživatele',
'old password' => 'Staré heslo',
'omnidirectional' => 'všesměrová',
'on line' => 'Na řádce',
'one ip address' => 'jedné IP adrese',
'open vodafone invoice in adobe reader' => 'Otevřte fakturu Vodafonu v programu Adobe Reader',
......
'port has been successfully saved' => 'Port byl úspěšně uložen.',
'port has been successfully updated' => 'Port byl úspěšně upraven.',
'port name' => 'Název portu',
'port number' => 'Číslo portu',
'port number already exist' => 'Číslo portu již existuje.',
'ports list' => 'Seznam portů',
'ports' => 'Porty',
'possibility of canceling redirection to all ip addresses of member' => 'Možnost zrušení přesměrování všem IP adresám člena',
......
'second-degree certified engineers' => 'Certifikovaní technici druhého stupně',
'secondary dns' => 'Sekundární DNS.',
'section' => 'Sekce',
'sectional' => 'sektorová',
'send' => 'Odeslat',
'send mail warning to users related with invoice' => 'Odeslat upozornění uživatelům spojených s fakturou',
'send message' => 'Odeslat zprávu',
......
'segment has been successfully deleted' => 'Segment byl úspěšně smazán.',
'segment has been successfully saved' => 'Segment byl úspěšně uložen.',
'segment has been successfully updated' => 'Segment byl úspěšně upraven.',
'segment is invalid - its medium has to in relation with type of interface' => 'Segment je neplatný - jeho médium musí odpovídat typu rozhraní.',
'segment name' => 'Název segmentu',
'segment with roaming can exists only once' => 'Segment s roamingem smí existovat pouze jednou.',
'segment_name' => 'Název segmentu',
......
'select action' => 'Vyber činnost',
'select admin' => 'Vyber správce',
'select all' => 'Vyber vše',
'select antenna' => 'Vyber anténu',
'select approval template' => 'Vyber hlasovací šablonu',
'select approval type' => 'Vyber hlasovací typ',
'select area' => 'Vyber oblast',
......
'select fee type' => 'Vyber typ poplatku',
'select free subnet' => 'Vyber volnou podsíť',
'select interface' => 'Vyber rozhraní',
'select medium' => 'Vyber médium',
'select member' => 'Vyber člena',
'select message' => 'Vyber zprávu',
'select mode' => 'Vyber mód',
'select norm' => 'Vyber normu',
'select vlan interface' => 'Vyber VLAN rozhraní',
'select only one subnet' => 'Vyberte jen jednu podsíť.',
'select only one type of iface' => 'Vyberte jen jeden typ rozhraní.',
'select parent' => 'Vyber rodiče',
'select platform' => 'Vyber platformu',
'select polarization' => 'Vyber polarizaci',
'select port' => 'Vyber port',
'select segment' => 'Vyber segment',
'select street' => 'Vyber ulici',
......
'signature and stamp' => 'Podpis a razítko',
'simple majority' => 'Prostá většina',
'since' => 'Od',
'single-mode optical fiber' => 'jednovidové optické vlákno',
'sixth-degree certified engineers' => 'Certifikování technici šestého stupně',
'smokeping menu parent' => 'Rodič v menu smokepingu',
'smokeping monitoring' => 'Monitorování smokepingem',
......
'variable symbol has not been found in the database' => 'Variabilní symbol nebyl nalezen v databázi.',
'vat' => 'DPH',
'version' => 'verze',
'vertical' => 'vertikální',
'very weak' => 'Velmi slabé',
'viewing of all records' => 'Prohlížení všech záznamů',
'viewing of own records' => 'Prohlížení vlastních záznamů',
......
'whitelist setting has been successfully set' => 'Bílá listina byla úspěšně nastavena.',
'whole d' => 'Celé z.',
'without change' => 'Beze změny',
'wireless' => 'bezdrátové',
'work' => 'Práce',
'work approval' => 'Schválení práce',
'work confirmation' => 'Potvrzení práce',
freenetis/branches/testing/application/vendors/unit_tester/unit_testing_config.xml
</input>
</values>
</method>
<method name="add_whole" autogenerate="off">
<attributes>
<attribute name="user_id" default_value=""/>
</attributes>
<values>
<input/>
<input>
<param value=""/>
</input>
<input>
<param value="1"/>
</input>
<input>
<param type="post" name="user_id" value="1"/>
<param type="post" name="name" value="Unit tester test"/>
<param type="post" name="trade_name" value=""/>
<param type="post" name="type" value="1"/>
<param type="post" name="PPPoE_logging_in" value="1"/>
<param type="post" name="login" value="Unit tester test"/>
<param type="post" name="login_password" value="Unit tester test"/>
<param type="post" name="comment" value="Unit tester test"/>
<param type="post" name="first_engineer_id" value="1"/>
<param type="post" name="price" value="12"/>
<param type="post" name="payment_rate" value="2"/>
<param type="post" name="buy_date" value="2"/>
<param type="post" name="street_id" value="1"/>
<param type="post" name="street_number" value="1"/>
<param type="post" name="town_id" value="1"/>
<param type="post" name="country_id" value="1"/>
<param type="post" name="gpsx" value="12.45"/>
<param type="post" name="gpsy" value="14.45"/>
<param type="post" name="mac" value="02:45:12:ff:44:32"/>
<param type="post" name="segment_id" value="1"/>
<param type="post" name="ip_address" value="10.143.1.1"/>
<param type="post" name="subnet_id" value="1"/>
<param type="post" name="submit" value=""/>
</input>
<input>
<param value="1"/>
<param type="post" name="user_id" value="1"/>
<param type="post" name="name" value="Unit tester test"/>
<param type="post" name="trade_name" value=""/>
<param type="post" name="type" value="1"/>
<param type="post" name="PPPoE_logging_in" value="1"/>
<param type="post" name="login" value="Unit tester test"/>
<param type="post" name="login_password" value="Unit tester test"/>
<param type="post" name="comment" value="Unit tester test"/>
<param type="post" name="first_engineer_id" value="1"/>
<param type="post" name="price" value="12"/>
<param type="post" name="payment_rate" value="2"/>
<param type="post" name="buy_date" value="2"/>
<param type="post" name="street_id" value="1"/>
<param type="post" name="street_number" value="1"/>
<param type="post" name="town_id" value="1"/>
<param type="post" name="country_id" value="1"/>
<param type="post" name="gpsx" value="12.45"/>
<param type="post" name="gpsy" value="14.45"/>
<param type="post" name="mac" value="02:45:12:ff:44:32"/>
<param type="post" name="segment_id" value="1"/>
<param type="post" name="ip_address" value="10.143.1.1"/>
<param type="post" name="subnet_id" value="1"/>
<param type="post" name="submit" value=""/>
</input>
</values>
</method>
<method name="edit" autogenerate="off">
<attributes>
<attribute name="device_id" default_value=""/>
......
</input>
</values>
</method>
<method name="delete_whole" autogenerate="on">
<attributes>
<attribute name="device_id" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="show_port" autogenerate="off">
<attributes>
<attribute name="port_id" default_value=""/>
......
<values>
</values>
</method>
<method name="valid_itype" autogenerate="on">
<attributes>
<attribute name="input" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="valid_mac" autogenerate="on">
<attributes>
<attribute name="input" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="valid_subnet" autogenerate="on">
<attributes>
<attribute name="input" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
</controller>
<controller name="email">
<method name="index" autogenerate="on">
......
<values>
</values>
</method>
<method name="valid_segment" autogenerate="on">
<attributes>
<attribute name="input" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="valid_mode" autogenerate="on">
<attributes>
<attribute name="input" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
</controller>
<controller name="import">
<method name="index" autogenerate="on">
......
<input></input>
</values>
</method>
<method name="get_segments_by_iface_type" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
</controller>
<controller name="languages">
<method name="index" autogenerate="on">
......
</input>
</values>
</method>
<method name="valid_port_nr" autogenerate="on">
<attributes>
<attribute name="input" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
</controller>
<controller name="private_phone_contacts">
<method name="index" autogenerate="on">
......
</values>
</method>
</controller>
<controller name="wireless_settings">
<method name="add" autogenerate="off">
<attributes>
<attribute name="iface_id" default_value=""/>
</attributes>
<values>
<input/>
<input>
<param value=""/>
</input>
<input>
<param value="1"/>
</input>
</values>
</method>
<method name="edit" autogenerate="off">
<attributes>
<attribute name="iface_id" default_value=""/>
</attributes>
<values>
<input>
<param value=""/>
</input>
<input>
<param value="1"/>
</input>
</values>
</method>
<method name="delete" autogenerate="on">
<attributes>
<attribute name="iface_id" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
</controller>
<controller name="work_reports">
<method name="index" autogenerate="on">
<attributes></attributes>
......
</input>
</values>
</method>
<method name="remove_admins" autogenerate="on">
<attributes>
<attribute name="cloud_id" default_value="" />
<attribute name="admin_ids" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="remove_subnets" autogenerate="on">
<attributes>
<attribute name="cloud_id" default_value="" />
<attribute name="subnet_ids" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
</model>
<model name="comment">
<method name="get_all_comments_by_comments_thread" autogenerate="off">
......
</input>
</values>
</method>
<method name="count_ws_of_iface" autogenerate="off">
<attributes>
<attribute name="iface_id" default_value=""/>
</attributes>
<values>
<input>
<param value=""/>
</input>
<input>
<param value="1"/>
</input>
<input>
<param value="sef'š$@"/>
</input>
</values>
</method>
<method name="get_all_ifaces_of_device_with_gw_ips" autogenerate="off">
<attributes>
<attribute name="device_id" default_value=""/>
......
<input></input>
</values>
</method>
<method name="get_type" autogenerate="on">
<attributes>
<attribute name="type" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_types" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_default_name" autogenerate="on">
<attributes>
<attribute name="type" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_default_names" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
</model>
<model name="invoice"></model>
<model name="invoice_item">
......
</values>
</method>
</model>
<model name="ip_addresses_state">
<method name="update_ip_addresses" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="update_success_avarages" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="update_success_counts" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="update_fail_counts" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="update_last_success" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="update_last_fail" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="update_availabilities" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="clean_pings" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
</model>
<model name="ip_addresses_traffic">
<method name="count_all_ip_addresses_traffics" autogenerate="on">
<attributes></attributes>
......
<values>
</values>
</method>
<method name="port_number_exists" autogenerate="on">
<attributes>
<attribute name="port_nr" default_value="" />
<attribute name="device_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
</model>
<model name="ports_vlan"></model>
<model name="private_users_contact">
......
<input></input>
</values>
</method>
<method name="get_all_segments_to_iface_dropdown" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_all_segments_to_port_dropdown" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_medium_type" autogenerate="on">
<attributes>
<attribute name="medium_type_id" default_value="" />
......
</input>
</values>
</method>
<method name="get_all_segments_by_iface_type" autogenerate="on">
<attributes>
<attribute name="type" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
</model>
<model name="sms_message"></model>
<model name="street">
......
</input>
</values>
</method></model>
<model name="wireless_setting">
<method name="get_wireless_setting" autogenerate="off">
<model name="wireless_iface">
<method name="get_mode" autogenerate="on">
<attributes>
<attribute name="iface_id" default_value=""/>
<attribute name="mode" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value=""/>
<param value="" />
</input>
</values>
</method>
<method name="get_modes" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_antenna" autogenerate="on">
<attributes>
<attribute name="antenna" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="1"/>
<param value="" />
</input>
</values>
</method>
<method name="get_antennas" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
</model>
<model name="wireless_segment">
<method name="get_norm" autogenerate="on">
<attributes>
<attribute name="norm" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="1'+1"/>
<param value="" />
</input>
</values>
</method></model>
</method>
<method name="get_norms" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_polarization" autogenerate="on">
<attributes>
<attribute name="polarization" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_polarizations" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_max_bitrate" autogenerate="on">
<attributes>
<attribute name="norm" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_max_bitrates" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
</model>
<helper name="arr">
<method name="callback_string" autogenerate="on">
<attributes>
freenetis/branches/testing/application/models/wireless_setting.php
<?php defined('SYSPATH') or die('No direct script access.');
/*
* This file is part of open source system FreeNetIS
* and it is release under GPLv3 licence.
*
* More info about licence can be found:
* http://www.gnu.org/licenses/gpl-3.0.html
*
* More info about project can be found:
* http://www.freenetis.org/
*
*/
/**
* @package Model
*/
class Wireless_setting_Model extends ORM
{
protected $belongs_to = array('iface');
/**
* Function gets one wireless setting. Each property is translated.
*
* @author Jiri Svitak
* @param $iface_id
* @return unknown_type
*/
public function get_wireless_setting($iface_id)
{
return $this->db->query("
SELECT ws.id, ws.ssid,
IFNULL(t1.translated_term, e1.value) AS wmode,
IFNULL(t2.translated_term, e2.value) AS norm,
ws.frequence, ws.channel,
IFNULL(t3.translated_term, e3.value) AS antenna,
IFNULL(t4.translated_term, e4.value) AS polarization
FROM wireless_settings ws
LEFT JOIN enum_types e1 ON e1.id = ws.wmode
LEFT JOIN translations t1 ON t1.original_term = e1.value
LEFT JOIN enum_types e2 ON e2.id = ws.norm
LEFT JOIN translations t2 ON t2.original_term = e2.value
LEFT JOIN enum_types e3 ON e3.id = ws.antenna
LEFT JOIN translations t3 ON t3.original_term = e3.value
LEFT JOIN enum_types e4 ON e4.id = ws.polarization
LEFT JOIN translations t4 ON t4.original_term = e4.value
WHERE ws.iface_id = ?
", $iface_id);
}
}
freenetis/branches/testing/application/models/device.php
'device_type' => 'd.type',
'member_id' => 'users.member_id'
);
const TYPE_PC = 7;
const TYPE_CLIENT = 8;
const TYPE_AP = 62;
/**
* Gets all devices from database. Database query returns member's device parameters (id, name, type),
freenetis/branches/testing/application/models/subnet.php
}
/**
* Function tries to find subnet of user. Used in devices/add_whole.
* Function tries to find subnet of user. Used in devices/add.
*
* @param integer $user_id
* @return unknown_type
freenetis/branches/testing/application/models/iface.php
* @package Model
*
* @property Device_Model $device
* @property Wireless_iface_Model $wireless
*/
class Iface_Model extends ORM
{
protected $belongs_to = array('segment','device');
protected $has_many = array('vlan_ifaces','ip_addresses');
protected $has_one = array('wireless_setting');
protected $has_one = array('wireless' => 'wireless_iface');
const TYPE_WIRELESS = 1;
const TYPE_ETHERNET = 2;
private static $types = array
(
self::TYPE_WIRELESS => 'Wireless',
self::TYPE_ETHERNET => 'Ethernet'
);
private static $default_names = array
(
self::TYPE_WIRELESS => 'wlan',
self::TYPE_ETHERNET => 'eth'
);
/**
* Get count of ifaces of device
......
ORDER BY i.name
", array($device_id));
}
/**
* Gets count of iface
*
* @param integer $iface_id
* @return integer
*/
public function count_ws_of_iface($iface_id)
{
return $this->db->query("
SELECT count(*) as total
FROM wireless_settings
WHERE iface_id = ?
", $iface_id)->current()->total;
}
/**
* Returns all ifaces of device with IP address as gateway
......
return $result;
}
/**
* Returns type of current interface
*
* @author Michal Kliment
* @param integer $type
* @return string
*/
public function get_type ($type = NULL)
{
if (!$type)
$type = $this->type;
if (array_key_exists($type, self::$types))
return __(self::$types[$type]);
else
return NULL;
}
/**
* Returns all types of interfaces
*
* @author Michal Kliment
* @return array
*/
public function get_types ()
{
$types = array();
foreach (self::$types as $key => $value)
$types[$key] = __($value);
return $types;
}
/**
* Returns default name of current type of interface
*
* @author Michal Kliment
* @param integer $type
* @return string
*/
public function get_default_name ($type = NULL)
{
if (!$type)
$type = $this->type;
if (array_key_exists($type, self::$default_names))
return self::$default_names[$type];
else
return NULL;
}
/**
* Returns all default names of interfaces
*
* @author Michal Kliment
* @return array
*/
public function get_default_names ()
{
return self::$default_names;
}
}
freenetis/branches/testing/application/models/device_engineer.php
/**
* Function gets engineer of user.
* Used in devices/add and devices/add_whole to prefill engineer field.
* Used in devices/add to prefill engineer field.
*
* @param $user_id
* @return unknown_type
freenetis/branches/testing/application/models/wireless_segment.php
<?php defined('SYSPATH') or die('No direct script access.');
/*
* This file is part of open source system FreeNetIS
* and it is released under GPLv3 licence.
*
* More info about licence can be found:
* http://www.gnu.org/licenses/gpl-3.0.html
*
* More info about project can be found:
* http://www.freenetis.org/
*
*/
/**
* @package Model
* @author Michal Kliment
*
* @property Segment_Model $segment
* @property string $ssid
* @property integer $norm
* @property integer $frequence
* @property integer $channel
* @property integer $channel_width
* @property integer $polarization
*/
class Wireless_segment_Model extends ORM
{
// constants of norms
const NORM_802_11_A = 1;
const NORM_802_11_B = 2;
const NORM_802_11_G = 3;
const NORM_802_11_N = 4;
const NORM_802_11_B_G = 5;
// constants of polarizations
const POLARIZATION_HORIZONTAL = 1;
const POLARIZATION_VERTICAL = 2;
const POLARIZATION_CIRCULAR = 3;
const POLARIZATION_BOTH = 4;
const POLARIZATION_HORIZONTAL_VERTICAL = 5;
/**
* Array of norms, keys of array are equal to constants of norms
* @var array
*/
private static $norms = array
(
self::NORM_802_11_A => '802.11a',
self::NORM_802_11_B => '802.11b',
self::NORM_802_11_G => '802.11g',
self::NORM_802_11_N => '802.11n',
self::NORM_802_11_B_G => '802.11b/g'
);
/**
* Array of polarizations, keys of array are equal to constants of polarizations
* @var array
*/
private static $polarizations = array
(
self::POLARIZATION_HORIZONTAL => 'horizontal',
self::POLARIZATION_VERTICAL => 'vertical',
self::POLARIZATION_CIRCULAR => 'circular',
self::POLARIZATION_BOTH => 'both',
self::POLARIZATION_HORIZONTAL_VERTICAL => 'horizontal and vertical'
);
private static $max_bitrates = array
(
self::NORM_802_11_A => 54,
self::NORM_802_11_B => 11,
self::NORM_802_11_G => 54,
self::NORM_802_11_N => 600,
self::NORM_802_11_B_G => 54
);
/**
* Returns norm name by given norm id
*
* @author
* @param integer $norm
* @return string
*/
public function get_norm ($norm = NULL)
{
if (!$norm)
$norm = $this->norm;
if (array_key_exists($norm, self::$norms))
return self::$norms[$norm];
else
return NULL;
}
/**
* Returns all norm names
*
* @author Michal Kliment
* @return array
*/
public function get_norms ()
{
return self::$norms;
}
/**
* Returns polarization name by given polarization id
*
* @author Michal Kliment
* @param integer $polarization
* @return string
*/
public function get_polarization ($polarization = NULL)
{
if (!$polarization)
$polarization = $this->polarization;
if (array_key_exists($polarization, self::$polarizations))
return url_lang::lang('texts.'.self::$polarizations[$polarization]);
else
return NULL;
}
/**
* Returns all polarization names
*
* @author Michal Kliment
* @return array
*/
public function get_polarizations ()
{
$polarizations = array();
foreach (self::$polarizations as $key => $value)
$polarizations[$key] = url_lang::lang('texts.'.$value);
return $polarizations;
}
/**
* Returns max bitrate of norm
*
* @author Michal Kliment
* @param integer $norm
* @return integer
*/
public function get_max_bitrate ($norm = NULL)
{
if (!$norm)
$norm = $this->norm;
if (array_key_exists($norm, self::$max_bitrates))
return self::$max_bitrates[$norm];
else
return NULL;
}
/**
* Returns all max bitrates of norms
*
* @author Michal Kliment
* @param integer $norm
* @return integer
*/
public function get_max_bitrates ()
{
return self::$max_bitrates;
}
}
?>
freenetis/branches/testing/application/models/ip_address.php
protected $belongs_to = array('iface','subnet','vlan_iface', 'member');
protected $has_one = array('state' => 'ip_addresses_state');
/**
* Function gets all ip addresses.
*
freenetis/branches/testing/application/models/members_traffic.php
public function get_avg_traffic ()
{
$result = $this->db->query("
SELECT AVG(upload) AS upload, AVG(download) AS download, AVG(upload+download) AS total
SELECT IFNULL(AVG(upload),0) AS upload, IFNULL(AVG(download),0) AS download, IFNULL(AVG(upload+download),0) AS total
FROM
(
SELECT * FROM members_traffics mt
SELECT mt.*, upload+download AS total
FROM members_traffics mt
ORDER BY ".$this->db->escape_column(Settings::get('ulogd_active_type'))." DESC
LIMIT 0,".intval(Settings::get('ulogd_active_count'))."
) mt
......
$this->db->query("
UPDATE members_traffics
SET active = 1
WHERE ".$this->db->escape_column(Settings::get('ulogd_active_type'))." >= ?
WHERE member_id IN
(
SELECT member_id FROM
(
SELECT mt.*, upload+download AS total
FROM members_traffics mt
) mt
WHERE ".$this->db->escape_column(Settings::get('ulogd_active_type'))." > ?
)
", array(intval($avg)));
}
}
freenetis/branches/testing/application/models/segment.php
/**
* @package Model
*
* @property Wireless_segment_Model $wireless
*/
class Segment_Model extends ORM {
protected $has_many = array('ifaces','ports');
protected $has_one = array('wireless' => 'wireless_segment');
const ROAMING = 1;
const AIR = 2;
......
self::ROAMING => 'roaming',
self::AIR => 'air',
self::CABLE => 'cable',
self::SINGLE_FIBER => 'single-mode optical fiber',
self::MULTI_FIBER => 'multi-mode optical fiber'
self::SINGLE_FIBER => 'fiber optical single-mode',
self::MULTI_FIBER => 'fiber optical multi-mode'
);
const IFACE = 1;
......
}
/**
* Function tries to find segment where user's device is connected to. Used in devices/add_whole.
* Function tries to find segment where user's device is connected to. Used in devices/add.
*
* @param integer $user_id
* @return unknown_type
......
}
/**
* Returns all segments to dropdown as array
*
* @author Michal Kliment
* @return array
*/
public function get_all_segments_to_iface_dropdown ()
{
$segments = $this->db->query("
SELECT s.id, s.name
FROM segments s
WHERE medium_id = ? OR medium_id = ? OR medium_id = ?
ORDER BY s.name
", array(self::AIR, self::CABLE, self::ROAMING));
$arr_segments = array();
foreach ($segments as $segment)
$arr_segments[$segment->id] = $segment->name;
return $arr_segments;
}
/**
* Returns all segments to dropdown as array
*
* @author Michal Kliment
* @return array
*/
public function get_all_segments_to_port_dropdown ()
{
$segments = $this->db->query("
SELECT s.id, s.name
FROM segments s
WHERE medium_id = ? OR medium_id = ?
OR medium_id = ? OR medium_id = ?
ORDER BY s.name
", array(self::SINGLE_FIBER, self::MULTI_FIBER,
self::CABLE, self::ROAMING));
$arr_segments = array();
foreach ($segments as $segment)
$arr_segments[$segment->id] = $segment->name;
return $arr_segments;
}
/**
* Returns medium type by medium type id
*
* @author Michal Kliment
......
JOIN members m ON u.member_id = m.id
", self::IFACE, $segment_id, self::PORT, $segment_id);
}
/**
* Returns all segments according to given type of iface
*
* @author Michal Kliment
* @param integer $type
* @return array
*/
public function get_all_segments_by_iface_type ($type)
{
$arr_segments = array();
switch ($type)
{
case Iface_Model::TYPE_WIRELESS:
$medium_id = self::AIR;
break;
case Iface_Model::TYPE_ETHERNET:
$medium_id = self::CABLE;
break;
default:
return $arr_segments;
break;
}
$segments = $this->db->query("
SELECT * FROM segments s
WHERE medium_id = ? OR medium_id = ?
ORDER BY s.name
", array($medium_id, self::ROAMING));
foreach ($segments as $segment)
$arr_segments[$segment->id] = $segment->name;
return $arr_segments;
}
}
freenetis/branches/testing/application/models/port.php
// query
return $this->db->query("
SELECT devices.name as device_name,segments.name as segment_name,
IFNULL(ports_vlans.vlan_count,0) AS vlan_count, ports.id,ports.name
IFNULL(ports_vlans.vlan_count,0) AS vlan_count, ports.id,ports.name,
ports.port_nr
FROM ports
LEFT JOIN devices ON devices.id = ports.device_id
LEFT JOIN segments ON segments.id = ports.segment_id
......
return $this->db->query("
SELECT ports.id AS port_id, ports.name AS port_name,
devices.name as device_name,ports.segment_id, segments.name as segment_name,
IFNULL(ports_vlans.vlan_count,0) AS vlan_count, ports.id,ports.name
IFNULL(ports_vlans.vlan_count,0) AS vlan_count, ports.id,ports.name,
ports.port_nr
FROM ports
LEFT JOIN devices ON devices.id = ports.device_id
LEFT JOIN segments ON segments.id = ports.segment_id
......
GROUP BY port_id
) ports_vlans ON ports_vlans.port_id=ports.id
WHERE device_id=?
ORDER BY id ASC
ORDER BY port_nr ASC
", $device_id);
}
......
WHERE port_id = ?
", $port_id);
}
/**
* Checks whether exists port number in device
*
* @author Michal Kliment
* @param integer $port_nr
* @param integer $device_id
* @return boolean
*/
public function port_number_exists ($port_nr, $device_id)
{
$result = $this->db->query("
SELECT COUNT(*) AS total
FROM ports p
WHERE p.port_nr = ? AND p.device_id = ?
", array($port_nr, $device_id));
if ($result && $result->current())
return (bool) $result->current()->total;
else
return false;
}
}
freenetis/branches/testing/application/models/wireless_iface.php
<?php defined('SYSPATH') or die('No direct script access.');
/*
* This file is part of open source system FreeNetIS
* and it is release under GPLv3 licence.
*
* More info about licence can be found:
* http://www.gnu.org/licenses/gpl-3.0.html
*
* More info about project can be found:
* http://www.freenetis.org/
*
*/
/**
* @package Model
* @author Michal Kliment
*
* @property integer $wmode
* @property integer $antenna
* @property Iface_Model $iface
*/
class Wireless_iface_Model extends ORM
{
protected $belongs_to = array('iface');
const MODE_AP = 1;
const MODE_CLIENT = 2;
private static $modes = array
(
self::MODE_AP => 'AP',
self::MODE_CLIENT => 'client'
);
const ANTENNA_DIRECTIONAL = 1;
const ANTENNA_OMNIDIRECTIONAL = 2;
const ANTENNA_SECTIONAL = 3;
private static $antennas = array
(
self::ANTENNA_DIRECTIONAL => 'Directional',
self::ANTENNA_OMNIDIRECTIONAL => 'Omnidirectional',
self::ANTENNA_SECTIONAL => 'Sectional'
);
/**
* Returns mode of current wireless interface
*
* @author Michal Kliment
* @param integer $mode
* @return string
*/
public function get_mode ($mode = NULL)
{
if (!$mode)
$mode = $this->wmode;
if (array_key_exists($mode, self::$modes))
return __(self::$modes[$mode]);
else
return NULL;
}
/**
* Returns all modes of wireless interfaces
*
* @author Michal Kliment
* @param integer $mode
* @return string
*/
public function get_modes ()
{
$modes = array();
foreach (self::$modes as $key => $value)
$modes[$key] = __($value);
return $modes;
}
/**
* Returns antenna of current wireless interface
*
* @author Michal Kliment
* @param integer $mode
* @return string
*/
public function get_antenna ($antenna = NULL)
{
if (!$antenna)
$antenna = $this->antenna;
if (array_key_exists($antenna, self::$antennas))
return __(self::$antennas[$antenna]);
else
return NULL;
}
/**
* Returns all antennas of wireless interfaces
*
* @author Michal Kliment
* @param integer $mode
* @return string
*/
public function get_antennas ()
{
$antennas = array();
foreach (self::$antennas as $key => $value)
$antennas[$key] = __($value);
return $antennas;
}
}
freenetis/branches/testing/application/controllers/wireless_settings.php
<?php defined('SYSPATH') or die('No direct script access.');
/*
* This file is part of open source system FreeNetIS
* and it is released under GPLv3 licence.
*
* More info about licence can be found:
* http://www.gnu.org/licenses/gpl-3.0.html
*
* More info about project can be found:
* http://www.freenetis.org/
*
*/
/**
* @package Controller
*/
class Wireless_Settings_Controller extends Controller
{
/**
* Function adds wireless setting to existing interface.
*
* @param integer $iface_id
*/
public function add($iface_id = null)
{
if (!$this->acl_check_new('Devices_Controller', 'wireless_setting'))
Controller::error(ACCESS);
... Rozdílový soubor je zkrácen, protože jeho délka přesahuje max. limit.

Také k dispozici: Unified diff