]> git.mxchange.org Git - friendica.git/blobdiff - mod/amcd.php
Merge pull request #3483 from rabuzarus/20170522_-_frio_event_button_fix
[friendica.git] / mod / amcd.php
index 01c6b92da540049d1b77efa176faf3e2803cc0b6..0eb295a816058a771a8ab18e51995a9cdd0bb182 100644 (file)
@@ -1,10 +1,16 @@
 <?php
 
-function amcd_content(&$a) {
-header("Content-type: text/json");
-echo <<< EOT
+use Friendica\App;
+
+function amcd_content(App $a) {
+       echo <<< JSON
 {
-  "methods": {
+  "version":1,
+  "sessionstatus":{
+    "method":"GET",
+    "path":"/session"
+  },
+  "auth-methods": {
     "username-password-form": {
       "connect": {
         "method":"POST",
@@ -12,15 +18,33 @@ echo <<< EOT
         "params": {
           "username":"login-name",
           "password":"password"
-        }
+        },
+        "onsuccess": { "action":"reload" }
+      },
+      "disconnect": {
+        "method":"GET",
+        "path":"\/logout"
+      }
+    }
+  }
+  "methods": {
+    "username-password-form": {
+      "connect": {
+        "method":"POST",
+        "path":"\/login",
+        "params": {
+          "username":"login-name",
+          "password":"password"
+        },
+        "onsuccess": { "action":"reload" }
       },
       "disconnect": {
         "method":"GET",
-        "path":"/logout"
+        "path":"\/logout"
       }
     }
   }
 }
-EOT;
-killme();
+JSON;
+       killme();
 }
\ No newline at end of file