public function deleteAcesso($delete) { try { $transaction = $this->beginTransaction(); if (is_array($delete)) { foreach ($delete as $id) { Access::create($id)->delete(); } } else { Access::create($delete)->delete(); } $transaction->commit(); } catch (Exception $e) { $transaction->rollback(); throw new EModelException('Error'); } }
break; case 'add_host': // Make sure we've got a valid form submission if (!Core::form_verify('add_acl', 'post')) { UI::access_denied(); exit; } Access::create($_POST); // Create Additional stuff based on the type if ($_POST['addtype'] == 'stream' || $_POST['addtype'] == 'all') { $_POST['type'] = 'stream'; Access::create($_POST); } if ($_POST['addtype'] == 'all') { $_POST['type'] = 'interface'; Access::create($_POST); } if (!Error::occurred()) { $url = AmpConfig::get('web_path') . '/admin/access.php'; show_confirmation(T_('Added'), T_('Your new Access Control List(s) have been created'), $url); } else { $action = 'show_add_' . $_POST['type']; require_once AmpConfig::get('prefix') . '/templates/show_add_access.inc.php'; } break; case 'update_record': if (!Core::form_verify('edit_acl')) { UI::access_denied(); exit; } $access = new Access($_REQUEST['access_id']);
public function formObject() { $this->data->Access = Access::create($this->data->id)->getData(); $this->render(); }