Browse Source

redirect to camotion:// for auto configuration

tags/0.1.1^0
Robin Thoni 8 years ago
parent
commit
e38c393767
3 changed files with 55 additions and 0 deletions
  1. 15
    0
      app/Http/Business/OtherBusiness.php
  2. 39
    0
      app/Http/Controller/OtherController.php
  3. 1
    0
      app/Http/routes.php

+ 15
- 0
app/Http/Business/OtherBusiness.php View File

@@ -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 View File

@@ -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 View File

@@ -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);

Loading…
Cancel
Save