public function delete() { $Access = new Access($this->data->id); $Access->delete(); $go = '>auth/Access/formFind'; $this->renderPrompt('information', "Access [{$this->data->idAccess}] removido.", $go); }
/** * @covers Xoops\Core\Cache\Access::cacheRead * @covers Xoops\Core\Cache\Access::read * @covers Xoops\Core\Cache\Access::delete */ public function testCacheRead() { $regenFunction = function ($args) { $vars = func_get_args(); return $vars[0]; }; $key = 'testCacheRead'; $value = 'fred'; $ret = $this->object->delete($key); $ret = $this->object->cacheRead($key, $regenFunction, 60, $value); $this->assertEquals($ret, $value); // this should return cached value, not current regenFunction result $ret = $this->object->cacheRead($key, $regenFunction, 60, 'not' . $value); $this->assertEquals($ret, $value); $ret = $this->object->read($key); $this->assertEquals($ret, $value); }
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ require_once '../lib/init.php'; if (!Access::check('interface', '100')) { UI::access_denied(); exit; } UI::show_header(); switch ($_REQUEST['action']) { case 'delete_record': if (!Core::form_verify('delete_access')) { UI::access_denied(); exit; } Access::delete($_REQUEST['access_id']); $url = AmpConfig::get('web_path') . '/admin/access.php'; show_confirmation(T_('Deleted'), T_('Your Access List Entry has been removed'), $url); break; case 'show_delete_record': if (AmpConfig::get('demo_mode')) { break; } $access = new Access($_GET['access_id']); show_confirmation(T_('Deletion Request'), T_('Are you sure you want to permanently delete') . ' ' . $access->name, 'admin/access.php?action=delete_record&access_id=' . $access->id, 1, 'delete_access'); break; case 'add_host': // Make sure we've got a valid form submission if (!Core::form_verify('add_acl', 'post')) { UI::access_denied(); exit;
$updatedOption = new Access($db); $updatedOption->Id = $_POST['id']; $updatedOption->Code = $_POST['code']; $updatedOption->Staff_Id = null; $updatedOption->Staff = ''; $updatedOption->Guest_Id = $_POST['guestid']; if ($updatedOption->update() == true) { header("location:access.php"); } else { echo "<script>alert('There was an error updating this item');window.location = 'access.php' </script>"; } } if (isset($_POST['delete'])) { $updatedOption = new Access($db); $updatedOption->Id = $_POST['id']; if ($updatedOption->delete() == true) { header("location:access.php"); } else { echo "<script>alert('There was an error deleting this item');window.location = 'access.php' </script>"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title></title>