Revize 1261
Přidáno uživatelem Ondřej Fibich před asi 13 roky(ů)
freenetis/branches/testing/media/images/flags/LICENCE.txt | ||
---|---|---|
http://www.33ff.com/flags/
|
||
|
||
Copyright Notice
|
||
This freeware images may be used as long as they remain intact
|
||
and you add a courtesy link to this page in your website or blog.
|
freenetis/branches/testing/application/controllers/allowed_subnets.php | ||
---|---|---|
$to_disable = array($to_disable);
|
||
|
||
// finds all allowed subnet of member
|
||
$allowed_subnets = ORM::factory('allowed_subnet')
|
||
$allowed_subnet_model = new Allowed_subnet_Model();
|
||
$allowed_subnets = $allowed_subnet_model->where('member_id', $member->id)
|
||
->where('member_id', $member->id)
|
||
->orderby(array('enabled' => 'desc', 'last_update' => 'desc'))
|
||
->find_all();
|
freenetis/branches/testing/application/controllers/devices.php | ||
---|---|---|
public function delete($device_id = null)
|
||
{
|
||
if (!isset($device_id))
|
||
{
|
||
Controller::warning(PARAMETER);
|
||
}
|
||
|
||
$device = new Device_Model($device_id);
|
||
|
||
if ($device->id == 0)
|
||
{
|
||
Controller::error(RECORD);
|
||
}
|
||
|
||
if (!$this->acl_check_delete('Devices_Controller', 'devices', $device->user->member_id))
|
||
if (!$this->acl_check_delete(
|
||
'Devices_Controller', 'devices', $device->user->member_id
|
||
))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
|
||
$linkback = Path::instance()->previous()->current();
|
||
|
||
if (url::slice(url_lang::uri($linkback),1,1) == 'show')
|
||
{
|
||
$linkback = Path::instance()->previous()->current();
|
||
}
|
||
|
||
// count of deleted interfaces
|
||
$deleted_ifaces = 0;
|
||
... | ... | |
// going through interfaces
|
||
foreach($ifaces as $iface)
|
||
{
|
||
// ORM doesn't work in this case (1:0 relation), so number of wireless settings has to be detected manually
|
||
// only solution seems to be upgrading to higher version of kohana
|
||
$ws_count = $iface->count_ws_of_iface($iface->id);
|
||
// find vlan_ifaces
|
||
$vlan_ifaces = $iface->vlan_ifaces;
|
||
|
||
if ($ws_count > 0)
|
||
if (count($vlan_ifaces) > 0)
|
||
{
|
||
status::success(
|
||
__('Interface still has at least one VLAN interface.')." ".
|
||
... | ... | |
url::redirect($linkback);
|
||
}
|
||
|
||
if (count($vlan_ifaces) > 0)
|
||
{
|
||
status::success(
|
||
__('Interface still has at least one wireless setting.')." ".
|
||
__('Deleted').": $deleted_ifaces ".
|
||
__("Interfaces").", $deleted_ips IP",
|
||
FALSE
|
||
);
|
||
url::redirect($linkback);
|
||
}
|
||
$ips = $iface->ip_addresses;
|
||
|
||
$ips = $iface->ip_addresses;
|
||
foreach($ips as $ip)
|
||
{
|
||
// before deleting IP address it is necessary to delete redirection from junction table first
|
||
... | ... | |
$ip->delete();
|
||
$deleted_ips++;
|
||
}
|
||
|
||
$iface->delete();
|
||
$deleted_ifaces++;
|
||
}
|
Také k dispozici: Unified diff
Oprava:
- oprava mazani zarizeni pokud ma bezdratove nastaveni