Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1842

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

Upravy:

- fixes #312 - Generovani zaznamu DHCP serveru zarizeni (osetreni chyb)

Zobrazit rozdíly:

freenetis/branches/1.1/application/models/device.php
// only for VLAN type of interface
else if ($iface->type == Iface_Model::TYPE_VLAN)
{
$interface->vlan = arr::to_object(array
if (!$iface->ifaces_vlans->count())
{
throw new Exception(
__('Error').': '.__('Cannot find VLAN of VLAN interface '.$iface->name)
);
}
if (!$iface->ifaces_relationships->count())
{
throw new Exception(
__('Error').': '.__('Cannot find parent interface of VLAN interface '.$iface->name)
);
}
$interface->vlan = arr::to_object(array
(
'name' => $iface->ifaces_vlans->current()->vlan->name,
'parent_interface' => $iface->ifaces_relationships->current()->parent_iface->name,
'tag_802_1q' => $iface->ifaces_vlans->current()->vlan->tag_802_1q
), 'stdClass', FALSE);
}
// only for port type of interface
else if ($iface->type == Iface_Model::TYPE_PORT)
{
......
$port_vlan = $iface_vlan->vlan->tag_802_1q;
}
$interface['port'] = array
$interface->port = arr::to_object(array
(
'mode' => $iface->port_mode,
'port_vlan' => $port_vlan,
'vlans' => $vlans
);
), 'stdClass', FALSE);
}
$interface->ip_addresses = array();
......
// for VLAN interface get MAC from parent interface
if ($dhcp_ip_address->iface->type == Iface_Model::TYPE_VLAN)
{
if (!$dhcp_ip_address->iface->ifaces_relationships->count())
{
throw new Exception(
__('Error').': '.__('Cannot find parent interface of VLAN interface '.$dhcp_ip_address->iface)
);
}
$mac = $dhcp_ip_address->iface->ifaces_relationships->current()->parent_iface->mac;
}
else
$mac = $dhcp_ip_address->iface->mac;
freenetis/branches/1.1/application/controllers/devices.php
// user is not logged
if (!$this->user_id)
{
@header('HTTP/1.0 404 Not found');
//@header('HTTP/1.0 404 Not found');
die($device_id);
}
else
{
......
}
else
{
if (!$this->acl_check_view(get_class($this), 'devices', $device->user->member_id))
Controller::error(ACCESS);
// user is not logged
if (!$this->user_id)
{
@header('HTTP/1.0 403 Forbidden');
die();
}
else
{
if (!$this->acl_check_view(get_class($this), 'devices', $device->user->member_id))
Controller::error(ACCESS);
}
}
// definition of formats of export
......
}
}
// get full export of device
$device_export = $device->get_export();
try
{
// get full export of device
$device_export = $device->get_export();
}
catch (Exception $e)
{
Log::add_exception($e);
Log_queue_Model::error($e->getMessage(), print_r ($device, TRUE));
die();
}
// it is device itself?
if ($from_device)

Také k dispozici: Unified diff