Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1550

Přidáno uživatelem Ondřej Fibich před asi 12 roky(ů)

Upravy:
- pridan validator pro existenci AP v linku pri pridavani Virtual AP
- prisan validator pri editaci ifacu, zabranujici zmenu modu na klient , pokud ma iface alespon jedno Virtual AP rozhrani

Opravy:
- oprava nekterych en. textu ip address => IP address

Zobrazit rozdíly:

freenetis/branches/testing/application/i18n/cs_CZ/texts.php
'callcon' => 'Volaný',
'calls' => 'Volání',
'canceling of message for redirection' => 'Rušení zprávy pro přesměrování',
'cannot change mode of the interface to client a virtual ap is derived from this interface' => 'Nemohu změnit mód rozhraní na klientský. Alespoň jedno virtuální AP je vytvořeno nad tímto rozhraním.',
'cannot connect to database' => 'Nelze se připojit k databázi',
'cannot delete, there are other records depending on this one' => 'Nelze smazat, na položce jsou závislé jiné záznamy',
'cannot edit, there are other records depending on this one' => 'Nelze upravit, na položce jsou závislé jiné záznamy',
freenetis/branches/testing/application/helpers/callback.php
echo html::anchor(
"redirect/delete_from_member/$item->member_id/$item->message_id",
__('all ip addresses of member')
__('all IP addresses of member')
);
}
}
freenetis/branches/testing/application/models/iface.php
}
/**
* Gets ifaces of parent iface which is given by ID
*
* @param integer $parent_iface_id
* @return Mysql_Result
*/
public function get_child_infaces_of_parent($parent_iface_id = NULL)
{
if ($parent_iface_id === NULL && $this->loaded)
{
$parent_iface_id = $this->id;
}
return $this->db->query("
SELECT i.*
FROM ifaces i
JOIN ifaces_relationships ir ON ir.iface_id = i.id
WHERE ir.parent_iface_id = ?
", $parent_iface_id);
}
/**
* Gets array of ifaces grouped by device for dropdown
*
* @param integer $device_id Only iface of one device?
freenetis/branches/testing/application/controllers/ifaces.php
->label('Parent interface')
->options($parent_ifaces)
->rules('required')
->callback(array($this, 'valid_mode_virtual_ap'))
->style('width:200px');
}
......
->options($parent_ifaces)
->selected($parent_iface_id)
->rules('required')
->callback(array($this, 'valid_mode_virtual_ap'))
->style('width:200px');
}
......
}
/**
* Callback function to validate link
* Callback function to validate wireless mode
*
* @author Michal Kliment
* @param Form_Field $input
......
{
$input->add_error('required', __('Mode is required.'));
}
// one iface with AP mode in link
else if ($input->value == Iface_Model::WIRELESS_MODE_AP)
{
$count = ORM::factory('iface')->count_items_by_mode_and_link(
Iface_Model::WIRELESS_MODE_AP, $this->input->post('link_id'),
$this->iface_id
);
if ($count > 0)
{
$input->add_error('required', __(
'In this link an interface in mode AP already exists.'
));
}
}
// relationship with any Virtual AP during edit?
else if ($this->iface_id &&
$input->value == Iface_Model::WIRELESS_MODE_CLIENT)
{
if (count(ORM::factory('iface')->get_child_infaces_of_parent($this->iface_id)))
{
$input->add_error('required', __(
'Cannot change mode of the interface to client ' .
'a Virtual AP is derived from this interface.'
));
}
}
}
}
/**
* Callback function to validate vlan ap wmode
*
* @author Ondřej Fibich
* @param Form_Field $input
*/
public function valid_mode_virtual_ap($input = NULL)
{
// validators cannot be accessed
if (empty($input) || !is_object($input))
{
self::error(PAGE);
}
if ($this->input->post('itype') == Iface_Model::TYPE_VIRTUAL_AP)
{
$count = ORM::factory('iface')->count_items_by_mode_and_link(
Iface_Model::WIRELESS_MODE_AP, $this->input->post('link_id'),
$this->iface_id
);
if ($input->value == Iface_Model::WIRELESS_MODE_AP && $count > 0)
if ($count > 0)
{
$input->add_error('required', __(
'In this link an interface in mode AP already exists.'
freenetis/branches/testing/application/controllers/traffic.php
$grid->datasource($ip_addresses_traffics);
$title = __('Traffic of ip addresses');
$title = __('Traffic of IP addresses');
$view = new View('main');
$view->breadcrumbs = __('Traffic');
freenetis/branches/testing/application/controllers/settings.php
$this->form->textarea('qos_high_priority_ip_addresses')
->rules('valid_ip_address')
->label(__('High priority ip addresses'). ': '.help::hint('qos_high_priority_ip_addresses'))
->label(__('High priority IP addresses'). ': '.help::hint('qos_high_priority_ip_addresses'))
->value(str_replace(",","\n",Settings::get('qos_high_priority_ip_addresses')));
$this->form->submit('Save');
freenetis/branches/testing/application/views/members/show.php
<br />
<?php if ($this->acl_check_edit('Messages_Controller', 'member')) { ?>
<h3><?php echo __('Ip addresses')?></h3>
<h3><?php echo __('IP addresses')?></h3>
<?php echo $redir_grid ?>
<br />
<?php } ?>
freenetis/branches/testing/application/views/ifaces/detail.php
<h3><?php echo __('ip addresses') ?></h3>
<h3><?php echo __('IP addresses') ?></h3>
<?php echo $ip_addresses ?>
<br />

Také k dispozici: Unified diff