Ver código fonte

redirect to camotion:// for auto configuration

tags/0.1.1^0
Robin Thoni 9 anos atrás
pai
commit
e38c393767

+ 15
- 0
app/Http/Business/OtherBusiness.php Ver arquivo

@@ -0,0 +1,15 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: robin
5
+ * Date: 12/11/15
6
+ * Time: 1:09 AM
7
+ */
8
+
9
+namespace App\Http\Business;
10
+
11
+
12
+class OtherBusiness
13
+{
14
+
15
+}

+ 39
- 0
app/Http/Controller/OtherController.php Ver arquivo

@@ -0,0 +1,39 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: robin
5
+ * Date: 12/11/15
6
+ * Time: 1:08 AM
7
+ */
8
+
9
+namespace App\Http\Controller;
10
+
11
+
12
+use App\Http\Business\OtherBusiness;
13
+use Luticate\Utils\LuBusiness;
14
+use Luticate\Utils\LuController;
15
+
16
+class OtherController extends LuController
17
+{
18
+    /**
19
+     * @return LuBusiness
20
+     */
21
+    protected function getBusiness()
22
+    {
23
+        return new OtherBusiness();
24
+    }
25
+
26
+    public function configApp($name = "", $domain = "", $username = "", $password = "", $https = "true")
27
+    {
28
+        $config = [
29
+            "Name" => strval($name),
30
+            "Domain" => strval($domain),
31
+            "Username" => strval($username),
32
+            "Password" => strval($password),
33
+            "Https" => ($https == "true")
34
+        ];
35
+        header("Location: camotion://autoconfig/?config=" . urlencode(json_encode($config)));
36
+        http_response_code(301);
37
+        exit;
38
+    }
39
+}

+ 1
- 0
app/Http/routes.php Ver arquivo

@@ -50,4 +50,5 @@ $route->post("/commands/$command_id/edit", "Commands", "edit", array(CamotionPer
50 50
 $route->post("/commands/$command_id/del", "Commands", "del", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_DEL));
51 51
 $route->post("/commands/$command_id/exec", "Commands", "exec", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EXEC));
52 52
 
53
+$route->get("/other/config", "Other", "configApp");
53 54
 //sleep(1);

Carregando…
Cancelar
Salvar