Projekt

Obecné

Profil

« Předchozí | Další » 

Revize c1bdc1c4

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

Release 1.1.0

Zobrazit rozdíly:

application/controllers/allowed_subnets.php
Controller::error(RECORD);
// access control
if (!$this->acl_check_view('Devices_Controller', 'allowed_subnet', $member->id))
if (!$this->acl_check_view('Allowed_subnets_Controller', 'allowed_subnet', $member->id))
Controller::error(ACCESS);
// finds all allowed subnets of member
......
Controller::error(RECORD);
// access control
if (!$this->acl_check_new('Devices_Controller', 'allowed_subnet', $member->id))
if (!$this->acl_check_new('Allowed_subnets_Controller', 'allowed_subnet', $member->id))
Controller::error(ACCESS);
$subnet_model = new Subnet_Model();
......
$member_id = $allowed_subnet->member_id;
// access control
if (!$this->acl_check_delete('Devices_Controller', 'allowed_subnet', $member_id))
if (!$this->acl_check_delete('Allowed_subnets_Controller', 'allowed_subnet', $member_id))
Controller::error(ACCESS);
// success
......
Controller::error(RECORD);
// access control
if (!$this->acl_check_edit('Devices_Controller', 'allowed_subnet', $allowed_subnet->member->id))
if (!$this->acl_check_edit('Allowed_subnets_Controller', 'allowed_subnet', $allowed_subnet->member->id))
Controller::error(ACCESS);
$allowed_subnet->enabled = !$allowed_subnet->enabled;
......
}
$allowed_subnet_model->transaction_commit();
return TRUE; // all OK
}
catch (Exception $e) // failed => rollback and wait 100ms before next attempt
{
$allowed_subnet_model->transaction_rollback();
if (++$transaction_attempt_counter >= $max_attempts) // this was last attempt?
{
Log::add_exception($e);
......
return FALSE;
}
}
usleep($timeout);
}
}

Také k dispozici: Unified diff