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
         $command->setId($command_id);
48
         $command->setId($command_id);
49
         return CommandsDataAccess::editById($command_id, $command);
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
     {
78
     {
79
         return CommandsBusiness::deleteById($command_id);
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
 $route->post("/commands/add", "Commands", "add", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_ADD));
47
 $route->post("/commands/add", "Commands", "add", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_ADD));
48
 $route->post("/commands/$command_id/edit", "Commands", "edit", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EDIT));
48
 $route->post("/commands/$command_id/edit", "Commands", "edit", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EDIT));
49
 $route->post("/commands/$command_id/del", "Commands", "del", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_DEL));
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
 //sleep(1);
52
 //sleep(1);

Loading…
Cancel
Save