Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2105

Přidáno uživatelem Michal Kliment před více než 11 roky(ů)

freenetis_1.1.0~alpha46
Opravy:
- fixes #725: Sdruzeni lze ukoncit clenstvi
- fixes #724: Zobrazeni celych komentaru k pracim ve vykazu
- fixes #722: Moznost specifikovat DNS server u podsite
- fixes #706: Chybna definice metody Vote_Model::remove()
- fixes #507: Subnet s maskou 255.255.255.255 - chybne validatory + obsazenost

Zobrazit rozdíly:

freenetis/branches/1.1/application/controllers/devices.php
header ("Content-disposition: attachment; filename=".url::title($device->name)."-".$format."-export".$ext);
}
// find dns servers
$dns_servers = arr::trim(explode("\n",Settings::get('dns_servers')));
// dns servers has to be set
if (!count($dns_servers))
{
// log to database
Log_queue_Model::error(
'Device has not been exported: DNS servers are not set',
print_r($device_export, true)
);
if ($from_device)
{
if (!text::starts_with($format, 'mikrotik'))
{
@header('HTTP/1.0 500 Internal Server Error');
}
die();
}
}
$view = new View('device_export_templates/'.$format);
$view->result = $device_export;
$view->dns_servers = $dns_servers;
$view->render(TRUE);
}
// form to choose format and output
freenetis/branches/1.1/application/controllers/fees.php
*/
public function valid_interval($post = NULL)
{
if (empty($post) || !is_object($post) || !($post instanceof Validation))
if (empty($post) || !is_object($post) || !($post instanceof Validation) ||
!array_key_exists('day', $post) ||
!array_key_exists('month', $post) ||
!array_key_exists('year', $post))
{
self::error(PAGE);
}
freenetis/branches/1.1/application/controllers/ip_addresses.php
{
self::error(PAGE);
}
$method = $this->form->ip_address->method; // <FORM> method = POST, GET, ...
$ip = ip2long($this->input->$method('ip_address')); // Submitted values;
$ip = ip2long($this->input->post('ip_address')); // Submitted values;
if ($ip === FALSE || $ip == -1)
{ // invalid IP adress
$input->add_error('required', __('Invalid IP address'));
return false;
}
$subnet_id = $this->input->$method('subnet_id');
$subnet_model = new Subnet_Model($subnet_id);
$subnet = $subnet_model->get_net_and_mask_of_subnet();
$subnet_id = $this->input->post('subnet_id');
$subnet = new Subnet_Model($subnet_id);
if ($subnet && $subnet->id)
{
$this->check_ip($ip, 0 + $subnet->net, $subnet->mask, $input);
$net = ip2long($subnet->network_address);
$mask = ip2long($subnet->netmask);
$size = (~$mask & 0xffffffff)+1;
if (($ip & $mask) != $net)
{
$input->add_error('required', __(
'IP address does not match the subnet/mask.'
));
}
else if ($size > 1 && ($ip == $net || $ip == ($net + $size - 1)))
{
$input->add_error('required', __('Invalid IP address'));
}
}
else
{
$input->add_error('required', __('Invalid subnet'));
}
// checks if exists this ip
$ip_model = new ip_address_Model();
......
}
}
}
/**
* Checks ip address if matches subnet and mask.
*
* @param string $ip
* @param integer $net
* @param string $mask
* @param object $input
*/
private function check_ip($ip, $net, $mask, $input)
{
$mask = 0xffffffff << (32 - $mask) & 0xffffffff;
if (($ip & $mask) != (int) $net)
{
$input->add_error('required', __(
'IP address does not match the subnet/mask.'
));
}
else if (($ip == $net || $ip == ($net | ~$mask)) && ~$mask != 0)
{
$input->add_error('required', __('Invalid IP address'));
}
}
}
freenetis/branches/1.1/application/controllers/members.php
}
if ($this->acl_check_edit(get_class($this),'type',$member->id) &&
$member->type != Member_Model::TYPE_APPLICANT)
$member->type != Member_Model::TYPE_APPLICANT &&
$form_data['type'] != Member_Model::TYPE_APPLICANT)
{
$member->type = $form_data['type'];
}
......
if (!$this->acl_check_edit(get_class($this), 'members', $member_id))
Controller::error(ACCESS);
// cannot end membership to association (#725)
if ($member->id == Member_Model::ASSOCIATION)
{
status::warning('Cannot end membership to association.');
$this->redirect('members/show/', $member->id);
}
// form
$form = new Forge('members/end_membership/' . $member_id);
$form = new Forge();
$form->date('leaving_date')
->label('Leaving date');
freenetis/branches/1.1/application/controllers/subnets.php
->label('DHCP')
->values(arr::bool());
$filter_form->add('dns')
->type('select')
->label('DNS')
->values(arr::bool());
$filter_form->add('qos')
->type('select')
->label('QoS')
......
->label(__('Owner').' '.help::hint('subnet_owner'))
->callback('callback::member_field');
// access control
if ($this->acl_check_view('Subnets_Controller', 'redirect'))
{
$grid->order_field('redirect')
......
->class('center');
}
$grid->order_callback_field('dhcp')
->label(__('DHCP'))
->callback('callback::boolean')
->class('center')
->help(help::hint('subnet_dhcp'));
// access control
if ($this->acl_check_view('Subnets_Controller', 'dhcp'))
{
$grid->order_callback_field('dhcp')
->label(__('DHCP'))
->callback('callback::boolean')
->class('center')
->help(help::hint('subnet_dhcp'));
}
$grid->order_callback_field('qos')
->label(__('QoS'))
->callback('callback::boolean')
->class('center')
->help(help::hint('subnet_qos'));
// access control
if ($this->acl_check_view('Subnets_Controller', 'dns'))
{
$grid->order_callback_field('dns')
->label(__('DNS'))
->callback('callback::boolean')
->class('center')
->help(help::hint('subnet_dns'));
}
// access control
if ($this->acl_check_view('Subnets_Controller', 'qos'))
{
$grid->order_callback_field('qos')
->label(__('QoS'))
->callback('callback::boolean')
->class('center')
->help(help::hint('subnet_qos'));
}
$grid->order_callback_field('used')
->label(__('Used'))
->callback('callback::used_field')
......
Controller::error(RECORD);
}
$total_available = (~ip2long($subnet->netmask) & 0xffffffff)+1;
// subnet has gateway
$has_gateway = $subnet->has_gateway();
if ($has_gateway)
{
$total_available = $total_available - 2;
$from = 1;
$to = $total_available;
}
else
{
$from = 0;
$to = $total_available - 1;
}
// clouds of subnet
$clouds = $subnet->get_clouds_of_subnet($subnet_id);
// ip addresses of subnet
$ips = $subnet->ip_addresses;
$total_available = (~ip2long($subnet->netmask) & 0xffffffff)+1;
$used = round(count($ips)/$total_available*100,1);
$network = ip2long($subnet->network_address);
$ip_addresses = array();
for ($i=0; $i <= $total_available; $i++)
for ($i=$from; $i <= $to; $i++)
{
// allow add IP address with network address only for 1 host subnet (mask /32) (#507)
if ($total_available != 1 && $i == 0)
continue;
// not allow add another IP address for 1 host subnet (mask /32) (#507)
if ($total_available == 1 && $i == 1)
break;
$ip_addresses[$i] = arr::to_object(array
(
'ip_address_id' => NULL,
......
->label(__('OSPF area ID').':')
->rules('valid_digit');
// access control
if ($this->acl_check_new('Subnets_Controller', 'redirect'))
{
$form->dropdown('redirect')
......
->selected(0);
}
$form->dropdown('dhcp')
->label('DHCP server')
->help(help::hint('subnet_dhcp'))
->options(arr::rbool());
// access control
if ($this->acl_check_new('Subnets_Controller', 'dhcp'))
{
$form->dropdown('dhcp')
->label('DHCP server')
->help(help::hint('subnet_dhcp'))
->options(arr::rbool());
}
$form->dropdown('qos')
->label('QoS')
->help(help::hint('subnet_qos'))
->options(arr::rbool());
// access control
if ($this->acl_check_new('Subnets_Controller', 'dns'))
{
$form->dropdown('dns')
->label('DNS server')
->help(help::hint('subnet_dns'))
->options(arr::rbool());
}
// access control
if ($this->acl_check_new('Subnets_Controller', 'qos'))
{
$form->dropdown('qos')
->label('QoS')
->help(help::hint('subnet_qos'))
->options(arr::rbool());
}
$form->dropdown('owner_id')
->label(__('Owner').' '.help::hint('subnet_owner'))
......
$subnet_model->network_address = $form_data['network_address'];
$subnet_model->netmask = $form_data['netmask'];
$subnet_model->OSPF_area_id = $form_data['OSPF_area_id'];
$subnet_model->dhcp = $form_data['dhcp'];
$subnet_model->qos = $form_data['qos'];
// access control
if ($this->acl_check_new('Subnets_Controller', 'dhcp'))
{
$subnet_model->dhcp = $form_data['dhcp'];
}
// access control
if ($this->acl_check_new('Subnets_Controller', 'dns'))
{
$subnet_model->dns = $form_data['dns'];
}
// access control
if ($this->acl_check_new('Subnets_Controller', 'qos'))
{
$subnet_model->qos = $form_data['qos'];
}
if ($subnet_model->dhcp)
{
$subnet_model->dhcp_expired = 1;
}
// redirect
// access control
if ($this->acl_check_new('Subnets_Controller', 'redirect'))
{
$subnet_model->redirect = $form_data['redirect'];
......
->rules('valid_digit')
->value($subnet_model->OSPF_area_id);
// access control
if ($this->acl_check_edit('Subnets_Controller', 'redirect'))
{
$form->dropdown('redirect')
......
->selected($subnet_model->redirect);
}
$form->dropdown('dhcp')
->label('DHCP server')
->help(help::hint('subnet_dhcp'))
->options(arr::rbool())
->selected($subnet_model->dhcp);
// access control
if ($this->acl_check_edit('Subnets_Controller', 'dhcp'))
{
$form->dropdown('dhcp')
->label('DHCP server')
->help(help::hint('subnet_dhcp'))
->options(arr::rbool())
->selected($subnet_model->dhcp);
}
$form->dropdown('qos')
->label('QoS')
->help(help::hint('subnet_qos'))
->options(arr::rbool())
->selected($subnet_model->qos);
// access control
if ($this->acl_check_edit('Subnets_Controller', 'dns'))
{
$form->dropdown('dns')
->label('DNS server')
->help(help::hint('subnet_dns'))
->options(arr::rbool())
->selected($subnet_model->dns);
}
// access control
if ($this->acl_check_edit('Subnets_Controller', 'qos'))
{
$form->dropdown('qos')
->label('QoS')
->help(help::hint('subnet_qos'))
->options(arr::rbool())
->selected($subnet_model->qos);
}
$form->dropdown('owner_id')
->label(__('Owner').' '.help::hint('subnet_owner'))
......
$subnet_model->network_address = $form_data['network_address'];
$subnet_model->netmask = $form_data['netmask'];
$subnet_model->OSPF_area_id = $form_data['OSPF_area_id'];
$subnet_model->dhcp = $form_data['dhcp'];
$subnet_model->dhcp_expired = 1;
$subnet_model->qos = $form_data['qos'];
// access control
if ($this->acl_check_edit('Subnets_Controller', 'redirect'))
{
$subnet_model->redirect = $form_data['redirect'];
}
// access control
if ($this->acl_check_edit('Subnets_Controller', 'dhcp'))
{
$subnet_model->dhcp = $form_data['dhcp'];
}
// access control
if ($this->acl_check_edit('Subnets_Controller', 'dns'))
{
$subnet_model->dns = $form_data['dns'];
}
// access control
if ($this->acl_check_edit('Subnets_Controller', 'qos'))
{
$subnet_model->qos = $form_data['qos'];
}
$subnet_model->save_throwable();
freenetis/branches/1.1/application/controllers/work_reports.php
'id' => 'work_reports__show_grid'
));
$works_grid->add_new_button(
url::base().url::current(),
'Show whole descriptions',
array
(
'id' => 'work_report__show_descr'
)
);
if ($work_report->state >= 2)
{
$works_grid->callback_field('approved')
......
continue;
// delete old vote
$vote_model->remove(
$vote_model->remove_vote(
$this->user_id,
Vote_Model::WORK,
$work->id
freenetis/branches/1.1/application/i18n/cs_CZ/help.php
'sms_enabled' => 'Určuje zda-li zasílání SMS zpráv ze systému do sítě tohoto operátora je povoleno.',
'ssh' => 'Klíč je použit pro přístup k zařízením, která spravuje tento uživatel.',
'subnet_dhcp' => 'Ukazatel, zda-li je na podsíti spuštěn DHCP server. Využívá se pro export zařízení.',
'subnet_dns' => 'Ukazatel, zda-li je na podsíti spuštěn DNS server. Využívá se pro export zařízení.',
'subnet_owner' => 'IP adresy, jenž nejsou v systému, patřící do podsítě budou přiřazeni k tomuto členovi-vlastníkovi. Na tyto podsítě se tedy nevztahuje přesměrování Neznámé zařízení - neznámé IP adresy jsou přiřazeni k členovi.',
'subnet_qos' => 'Ukazatel, zda-li je na podsíti spuštěn QoS. Využívá se pro export zařízení.',
'subnet_used_ips' => 'Jedná se procentuální vyjádření využití IP adres v podsíti. Červené zbarvení značí docházející IP adresy, zelené pak nevyužitou podsít (zbytečně velká?).',
freenetis/branches/1.1/application/i18n/en_US/help.php
'set_whitelist_to_member' => 'Permanent white list is a list of members for which it does not redirect. This is such an important partner institution involved in the network, such as municipal authorities, etc. Any diversion system is not in default bother computer with an IP address on the white list. But you can create a message that will ignore this list, such as informing of impending failure. For temporary whitelist does the same, but IP addresses in it after a specified time from the instrument clean. Eg. user was redirected due to non-payment and we want him to allow short-term Internet access to internet banking.',
'sms_enabled' => 'Specifies whether to send SMS messages from the system into a network of this operator is allowed.',
'ssh' => 'Key is used for accessing devices, which are administrated by this user.',
'subnet_dhcp' => 'Indicator whether there is a running dhcp server on this subnet. It is used for export of devices.',
'subnet_dhcp' => 'Indicator whether there is a running DHCP server on this subnet. It is used for export of devices.',
'subnet_dns' => 'Indicator whether there is a running DNS server on this subnet. It is used for export of devices.',
'subnet_owner' => 'IP addresses, which are not in the system, belonging to a subnet will be assigned to the member-owner. These are therefore not subnet redirects Unknown device - unknown IP addresses are assigned to the member.',
'subnet_qos' => 'Indicator whether there is a running QoS on this subnet. It is used for export of devices.',
'subnet_used_ips' => 'This percentage of use of IP addresses in the subnet. Red coloration indicates incoming IP addresses, then the unused green subnet (too large?).',
freenetis/branches/1.1/application/models/device.php
// DHCP servers of device
$dhcp_servers = array();
// dns servers
$system_dns_servers = arr::trim(explode("\n", Settings::get('dns_servers')));
if (!count($system_dns_servers))
{
throw new Exception(
__('Error').': '.
__('Device has not been exported: DNS servers are not set')
);
}
// all device's interfaces
foreach ($device->ifaces as $iface)
{
......
$range_start = long2ip(ip2long($ip_address->ip_address)+1);
$range_end = long2ip(ip2long($broadcast)-1);
$dns_servers = $system_dns_servers;
// DNS server is on
if ($ip_address->subnet->dns)
{
array_unshift($dns_servers, $ip_address->ip_address);
}
$dhcp_server = arr::to_object(array
(
'name' => text::cs_utf2ascii($ip_address->subnet->name),
......
'end' => $range_end
), 'stdClass', FALSE),
),
'dns_servers' => $dns_servers,
'hosts' => array(),
'comment' => '{name}'
), 'stdClass', FALSE);
......
'interfaces' => $interfaces,
'ip_addresses' => $addresses,
'dhcp_servers' => $dhcp_servers,
'dns_servers' => $system_dns_servers,
'gateways' => array_unique($gateways)
), 'stdClass', FALSE);
}
freenetis/branches/1.1/application/models/subnet.php
* @property integer $redirect
* @property integer $dhcp
* @property boolean $dhcp_expired
* @property integer $dns
* @property Subnets_owner_Model $subnets_owner
* @property ORM_Iterator $clouds
* @property ORM_Iterator $ip_addresses
......
FROM ip_addresses
WHERE subnet_id = s.id
)/((~inet_aton(s.netmask) & 0xffffffff)+1)*100,1),0) AS used,
m.id AS member_id, m.name AS member_name, dhcp, qos
m.id AS member_id, m.name AS member_name, dhcp, dns, qos
FROM subnets s
LEFT JOIN subnets_owners so ON s.id = so.subnet_id
LEFT JOIN members m ON so.member_id = m.id
......
}
/**
* Check whether subnet has gateway
*
* @author Michal Kliment
* @param type $subnet_id
* @return type
*/
public function has_gateway($subnet_id = NULL)
{
if (!$subnet_id && $this->id)
$subnet_id = $this->id;
$gateway = $this->get_gateway($subnet_id);
return ($gateway && $gateway->id);
}
/**
* This method is used for determining whether the user is connected
* from registered connection. If he is the null is returned.
* If not then subnet from which he is connected is searched.
freenetis/branches/1.1/application/models/vote.php
* @param integer $fk_id
* @return type
*/
public function remove ($user_id, $type, $fk_id)
public function remove_vote ($user_id, $type, $fk_id)
{
return $this->db->query("
DELETE FROM votes
freenetis/branches/1.1/application/vendors/unit_tester/unit_testing_config.xml
</values>
</method>
<method name="redirected_ranges" autogenerate="on">
<attributes>
<attribute name="paginator" default_value="FALSE" />
<attribute name="page" default_value="" />
</attributes>
<attributes></attributes>
<values>
<input></input>
<input>
<param value="FALSE" />
</input>
<input>
<param value="FALSE" />
<param value="" />
</input>
</values>
</method>
<method name="allowed_ip_addresses" autogenerate="on">
<attributes>
<attribute name="paginator" default_value="FALSE" />
<attribute name="page" default_value="" />
</attributes>
<attributes></attributes>
<values>
<input></input>
<input>
<param value="FALSE" />
</input>
<input>
<param value="FALSE" />
<param value="" />
</input>
</values>
</method>
<method name="unallowed_ip_addresses" autogenerate="on">
<attributes>
<attribute name="paginator" default_value="FALSE" />
<attribute name="page" default_value="" />
</attributes>
<attributes></attributes>
<values>
<input></input>
<input>
<param value="FALSE" />
</input>
<input>
<param value="FALSE" />
<param value="" />
</input>
</values>
</method>
<method name="self_cancelable_ip_addresses" autogenerate="on">
<attributes>
<attribute name="paginator" default_value="FALSE" />
<attribute name="page" default_value="" />
</attributes>
<attributes></attributes>
<values>
<input></input>
<input>
<param value="FALSE" />
</input>
<input>
<param value="FALSE" />
<param value="" />
</input>
</values>
</method>
<method name="local_subnets" autogenerate="on">
<attributes>
<attribute name="paginator" default_value="FALSE" />
<attribute name="page" default_value="" />
</attributes>
<attributes></attributes>
<values>
<input></input>
<input>
<param value="FALSE" />
</input>
<input>
<param value="FALSE" />
<param value="" />
</input>
</values>
</method>
<method name="callback" autogenerate="on">
<method name="voip_callback" autogenerate="on">
<attributes>
<attribute name="user" default_value="" />
<attribute name="pass" default_value="" />
......
</input>
</values>
</method>
<method name="get_allowed_subnet_by_member_and_ip_address" autogenerate="on">
<attributes>
<attribute name="member_id" default_value="" />
<attribute name="ip_address" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
</model>
<model name="allowed_subnets_count"></model>
<model name="approval_template">
......
</input>
</values>
</method>
<method name="scount_unidentified_transfers" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_bank_transfer" autogenerate="off">
<attributes>
<attribute name="trans_id" default_value=""/>
......
</input>
</values>
</method>
<method name="count_inactive_dhcp_servers" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="count_devices_of_user" autogenerate="off">
<attributes>
<attribute name="user_id" default_value=""/>
......
</input>
</values>
</method>
<method name="get_regular_member_fee_name_by_member_date" autogenerate="on">
<attributes>
<attribute name="member_id" default_value="" />
<attribute name="date" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="get_transfer_fee_by_date" autogenerate="on">
<attributes>
<attribute name="date" default_value="" />
......
</input>
</values>
</method>
<method name="get_count_of_unvoted_works_of_voter" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_suggest_amount" autogenerate="on">
<attributes></attributes>
<values>
......
<input></input>
</values>
</method>
<method name="get_count_of_unvoted_work_reports_of_voter" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_votes_of_voter_on_work_report" autogenerate="on">
<attributes>
<attribute name="work_report_id" default_value="" />
......
</input>
</values>
</method>
<method name="count_of_unclosed_logs" autogenerate="on">
<attributes>
<attribute name="minimal_type" default_value="self::TYPE_ERROR" />
</attributes>
<values>
<input></input>
<input>
<param value="self::TYPE_ERROR" />
</input>
</values>
</method>
</model>
<model name="login_log">
<method name="count_all_login_logs" autogenerate="on">
......
</input>
</values>
</method>
<method name="count_all_unread_inbox_messages_by_user_id" autogenerate="off">
<attributes>
<attribute name="user_id" default_value=""/>
</attributes>
<values>
<input>
<param value=""/>
</input>
<input>
<param value="1"/>
</input>
<input>
<param value="1'+1"/>
</input>
</values>
</method>
<method name="count_all_sent_messages_by_user_id" autogenerate="off">
<attributes>
<attribute name="user_id" default_value=""/>
......
</input>
</values>
</method>
<method name="get_first_member_account_id" autogenerate="on">
<attributes>
<attribute name="member_id" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_active_traffic_members_ip_addresses" autogenerate="on">
<attributes>
<attribute name="day" default_value="" />
......
</input>
</values>
</method>
<method name="count_of_registered_members" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="count_all_members" autogenerate="off">
<attributes>
<!-- Not protected on model site -->
......
<input></input>
</values>
</method>
<method name="count_off_down_devices" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="update_host" autogenerate="on">
<attributes>
<attribute name="ip_address" default_value="" />
......
</method>
</model>
<model name="phone_invoice_user">
<method name="has_phone_invoices" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="count_unfilled_phone_invoices" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_total_prices" autogenerate="off">
<attributes>
<attribute name="user_id" default_value=""/>
......
<values>
</values>
</method></model>
<model name="preprocessor">
<method name="has_phone_invoices" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="count_unfilled_phone_invoices" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="has_voip_sips" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="count_all_unread_inbox_messages_by_user_id" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="count_of_registered_members" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_first_member_account_id" autogenerate="on">
<attributes>
<attribute name="member_id" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_count_of_unvoted_works_of_voter" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_count_of_unvoted_work_reports_of_voter" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_count_of_unvoted_requests_of_voter" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="count_off_down_devices" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="scount_unidentified_transfers" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="get_allowed_subnet_by_member_and_ip_address" autogenerate="on">
<attributes>
<attribute name="member_id" default_value="" />
<attribute name="ip_address" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="count_of_unclosed_logs" autogenerate="on">
<attributes>
<attribute name="minimal_type" default_value="1" />
</attributes>
<values>
<input></input>
<input>
<param value="1" />
</input>
</values>
</method>
<method name="count_inactive_dhcp_servers" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="is_users_favourite" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
<attribute name="page" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="count_undecided_requests" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="count_all_disabled_allowed_subnets_by_member" autogenerate="on">
<attributes>
<attribute name="member_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_subnet_for_connection_request" autogenerate="on">
<attributes>
<attribute name="ip_address" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
</model>
<model name="private_users_contact">
<method name="get_contact_id" autogenerate="off">
<attributes>
......
</input>
</values>
</method>
<method name="get_count_of_unvoted_requests_of_voter" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_suggest_amount" autogenerate="on">
<attributes></attributes>
<values>
......
</input>
</values>
</method>
<method name="has_gateway" autogenerate="on">
<attributes>
<attribute name="subnet_id" default_value="" />
</attributes>
<values>
<input></input>
<input>
<param value="" />
</input>
</values>
</method>
<method name="get_subnet_for_connection_request" autogenerate="on">
<attributes>
<attribute name="ip_address" default_value="" />
......
<input></input>
</values>
</method>
<method name="has_voip_sips" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
<method name="count_all_records" autogenerate="on">
<attributes></attributes>
<values>
......
</input>
</values>
</method>
<method name="remove" autogenerate="on">
<method name="remove_vote" autogenerate="on">
<attributes>
<attribute name="user_id" default_value="" />
<attribute name="type" default_value="" />
......
</input>
</values>
</method>
<method name="months_array" autogenerate="on">
<attributes>
<attribute name="translate" default_value="TRUE" />
</attributes>
<values>
<input></input>
<input>
<param value="TRUE" />
</input>
</values>
</method>
<method name="months" autogenerate="on">
<attributes></attributes>
<values>
freenetis/branches/1.1/application/views/device_export_templates/debian-etc-dhcp-dhcpd.php
#
# Sample configuration file for ISC dhcpd for Debian
# This is configuration file for ISC dhcpd for Debian, generated by Freenetis
#
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
......
# option definitions common to all supported networks...
option domain-name-servers <?php echo implode(", ",$dns_servers) ?>;
option domain-name-servers <?php echo implode(", ", $result->dns_servers) ?>;
default-lease-time 600;
max-lease-time 7200;
......
<?php foreach ($dhcp_server->ranges as $range): ?>
range <?php echo $range->start ?> <?php echo $range->end ?>;
<?php endforeach ?>
option domain-name-servers <?php echo implode(", ", $dhcp_server->dns_servers) ?>;
<?php foreach ($dhcp_server->hosts as $host): ?>
# <?php echo text::cs_utf2ascii(text::object_format($host, $host->comment)) ?>
freenetis/branches/1.1/application/views/device_export_templates/mikrotik-all.php
add address=<?php echo $address->address ?>/<?php echo network::netmask2cidr($address->netmask) ?> disabled=no interface="<?php echo $address->interface ?>" network=<?php echo $address->network ?> comment="<?php echo text::cs_utf2ascii(text::object_format($address, $address->comment)) ?>"
<?php endforeach ?>
/ip dns
set allow-remote-requests=yes servers=<?php echo implode(", ",$dns_servers) ?>
set allow-remote-requests=yes servers=<?php echo implode(", ",$result->dns_servers) ?>
/ip pool
<?php foreach ($result->dhcp_servers as $dhcp_server): ?>
add name="<?php echo text::cs_utf2ascii($dhcp_server->name) ?>" ranges=<?php echo $dhcp_server->range_start ?>-<?php echo $dhcp_server->range_end ?>
......
set store-leases-disk=5m
/ip dhcp-server network
<?php foreach ($result->dhcp_servers as $dhcp_server): ?>
add address=<?php echo $dhcp_server->cidr ?> dhcp-option="" dns-server="" gateway=<?php echo $dhcp_server->gateway ?> ntp-server="" wins-server="" comment="<?php echo text::cs_utf2ascii(text::object_format($dhcp_server, $dhcp_server->comment)) ?>"
add address=<?php echo $dhcp_server->cidr ?> dhcp-option="" dns-server="<?php echo implode(", ",$dhcp_server->dns_servers) ?>" gateway=<?php echo $dhcp_server->gateway ?> ntp-server="" wins-server="" comment="<?php echo text::cs_utf2ascii(text::object_format($dhcp_server, $dhcp_server->comment)) ?>"
<?php endforeach ?>
/ip dhcp-server lease
<?php foreach ($result->dhcp_servers as $dhcp_server): ?>
freenetis/branches/1.1/application/views/device_export_templates/mikrotik-ip-dhcp-server.php
/ip dhcp-server network
remove [find]
<?php foreach ($result->dhcp_servers as $dhcp_server): ?>
add address=<?php echo $dhcp_server->cidr ?> dhcp-option="" dns-server=<?php echo implode(',', $dns_servers) ?> gateway=<?php echo $dhcp_server->gateway ?> ntp-server="" wins-server="" comment="<?php echo text::cs_utf2ascii(text::object_format($dhcp_server, $dhcp_server->comment)) ?>"
add address=<?php echo $dhcp_server->cidr ?> dhcp-option="" dns-server=<?php echo implode(',', $dhcp_server->dns_servers) ?> gateway=<?php echo $dhcp_server->gateway ?> ntp-server="" wins-server="" comment="<?php echo text::cs_utf2ascii(text::object_format($dhcp_server, $dhcp_server->comment)) ?>"
<?php endforeach ?>
/ip dhcp-server lease
remove [find]
freenetis/branches/1.1/application/views/subnets/show.php
<td><?php echo ($subnet->redirect == 1) ? __('Yes') : __('No') ?></td>
</tr>
<?php endif ?>
<?php if ($this->acl_check_view('Subnets_Controller', 'dhcp')): ?>
<tr>
<th><?php echo __('DHCP server') ?> <?php echo help::hint('subnet_dhcp') ?></th>
<td><?php echo ($subnet->dhcp == 1) ? __('Yes') : __('No') ?></td>
</tr>
<?php endif ?>
<?php if ($this->acl_check_view('Subnets_Controller', 'dns')): ?>
<tr>
<th><?php echo __('DNS server') ?> <?php echo help::hint('subnet_dns') ?></th>
<td><?php echo ($subnet->dns == 1) ? __('Yes') : __('No') ?></td>
</tr>
<?php endif ?>
<?php if ($this->acl_check_view('Subnets_Controller', 'qos')): ?>
<tr>
<th><?php echo __('QoS') ?> <?php echo help::hint('subnet_qos') ?></th>
<td><?php echo ($subnet->qos == 1) ? __('Yes') : __('No') ?></td>
</tr>
<?php endif ?>
<tr>
<th><?php echo __('Cloud') ?></th>
<td>
freenetis/branches/1.1/db_upgrades/upgrade_1.1.0~alpha46.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/
*
*/
/**
* This upgrade is not equal to any of previos upgrades
*
* @author Michal Kliment
*/
$upgrade_equal_to['1.1.0~alpha46'] = array();
/**
* Adds column dns to subnets and AXO for DHCP, QoS and DNS settings of subnet
*
* @author Michal Kliment
*/
$upgrade_sql['1.1.0~alpha46'] = array
(
"ALTER TABLE subnets ADD dns TINYINT(1) NOT NULL DEFAULT '0' AFTER dhcp_expired",
"INSERT INTO axo
SELECT MAX(id)+1, 'Subnets_Controller', 'dhcp', 'DHCP server on subnet' FROM axo",
"INSERT INTO axo
SELECT MAX(id)+1, 'Subnets_Controller', 'qos', 'QoS on subnet' FROM axo",
"INSERT INTO axo
SELECT MAX(id)+1, 'Subnets_Controller', 'dns', 'DNS server on subnet' FROM axo",
"INSERT INTO axo_map (acl_id, section_value, value) VALUES
('38', 'Subnets_Controller', 'dhcp'),
('38', 'Subnets_Controller', 'qos'),
('38', 'Subnets_Controller', 'dns')"
);
freenetis/branches/1.1/version.php
* The current version of FreenetIS.
* This value must be changed by developers in a new release of FreenetIS.
*/
define('FREENETIS_VERSION', '1.1.0~alpha45');
define('FREENETIS_VERSION', '1.1.0~alpha46');

Také k dispozici: Unified diff