소스 검색

redirect to camotion:// for auto configuration

tags/0.1.1^0
Robin Thoni 9 년 전
부모
커밋
e38c393767
3개의 변경된 파일55개의 추가작업 그리고 0개의 파일을 삭제
  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 파일 보기

@@ -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 파일 보기

@@ -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 파일 보기

@@ -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…
취소
저장