Browse Source

command dummy exec

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
90559639ff

+ 6
- 0
app/Http/Business/CommandsBusiness.php View File

@@ -48,4 +48,10 @@ class CommandsBusiness extends LuBusiness {
48 48
         $command->setId($command_id);
49 49
         return CommandsDataAccess::editById($command_id, $command);
50 50
     }
51
+
52
+    public static function exec($command_id)
53
+    {
54
+        self::getById($command_id);
55
+        return true;
56
+    }
51 57
 }

+ 10
- 0
app/Http/Controller/CommandsController.php View File

@@ -78,4 +78,14 @@ class CommandsController extends LuController {
78 78
     {
79 79
         return CommandsBusiness::deleteById($command_id);
80 80
     }
81
+
82
+    /**
83
+     * Execute a command
84
+     * @param $command_id int The command id
85
+     * @return mixed
86
+     */
87
+    public function exec($command_id)
88
+    {
89
+        return CommandsBusiness::exec($command_id);
90
+    }
81 91
 }

+ 1
- 0
app/Http/routes.php View File

@@ -47,5 +47,6 @@ $route->get("/commands/$command_id", "Commands", "get", CamotionPermissions::COM
47 47
 $route->post("/commands/add", "Commands", "add", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_ADD));
48 48
 $route->post("/commands/$command_id/edit", "Commands", "edit", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EDIT));
49 49
 $route->post("/commands/$command_id/del", "Commands", "del", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_DEL));
50
+$route->post("/commands/$command_id/exec", "Commands", "exec", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EXEC));
50 51
 
51 52
 //sleep(1);

Loading…
Cancel
Save