]> git.mxchange.org Git - friendica.git/blob - src/Module/AccountManagementControlDocument.php
Added parameter to rawContent
[friendica.git] / src / Module / AccountManagementControlDocument.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\BaseModule;
6
7 /**
8  * Static definition for the Firefox Account Manager
9  *
10  * @see https://wiki.mozilla.org/Labs/Weave/Identity/Account_Manager/Spec/3#Contents_of_the_Account_Management_Control_Document
11  */
12 class AccountManagementControlDocument extends BaseModule
13 {
14         public static function rawContent($parameters)
15         {
16                 $output = [
17                         'version' => 1,
18                         'sessionstatus' => [
19                                 'method' => 'GET',
20                                 'path' => '/session',
21                         ],
22                         'auth-methods' => [
23                                 'username-password-form' => [
24                                         'connect' => [
25                                                 'method' => 'POST',
26                                                 'path' => '/login',
27                                                 'params' => [
28                                                         'username' => 'login-name',
29                                                         'password' => 'password',
30                                                 ],
31                                                 'onsuccess' => [
32                                                         'action' => 'reload',
33                                                 ],
34                                         ],
35                                         'disconnect' => [
36                                                 'method' => 'GET',
37                                                 'path' => '/logout',
38                                         ],
39                                 ],
40                         ],
41                         'methods' => [
42                                 'username-password-form' => [
43                                         'connect' => [
44                                                 'method' => 'POST',
45                                                 'path' => '/login',
46                                                 'params' => [
47                                                         'username' => 'login-name',
48                                                         'password' => 'password',
49                                                 ],
50                                                 'onsuccess' => [
51                                                         'action' => 'reload',
52                                                 ],
53                                         ],
54                                         'disconnect' => [
55                                                 'method' => 'GET',
56                                                 'path' => '/logout',
57                                         ],
58                                 ],
59                         ],
60                 ];
61
62                 echo json_encode($output);
63                 exit();
64         }
65 }