From 1f39899416ca012d50d261d88b6c2bc86a673212 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 12 Jun 2016 20:50:57 -0400 Subject: Update Obj controller This commit makes the Obj controller compatable with changes introduced in the previous commit. --- app/controller/obj.control.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/controller/obj.control.php b/app/controller/obj.control.php index 74288ee..2154d16 100644 --- a/app/controller/obj.control.php +++ b/app/controller/obj.control.php @@ -16,7 +16,6 @@ require_once "class/controller.class.php"; require_once "model/obj.mod.php"; -require_once "class/object.class.php"; /* * Object viewer, Used to view groups, pads, and more! @@ -28,23 +27,21 @@ class Obj extends Controller */ function handle($argv) { - $mod = new ObjModel(); - $obj = new DBObject($argv[0]); + $mod = new ObjModel($argv[0]); - if (!$obj->canAccess($this->getCurrentUser())) + if (!$mod->obj->canAccess($this->getCurrentUser())) throw new Exception("You do not have permission to access this object"); - switch ($obj->type) + switch ($mod->obj->type) { case "group": - $this->action_group($mod, $obj->guid); + $this->action_group($mod); break; } } - function action_group($mod, $guid) + function action_group($mod) { - $mod->initGroup($guid); include "view/obj/group.view.php"; } } -- cgit v1.2.3