|
@@ -36,52 +36,52 @@ discard block |
|
|
block discarded – undo |
|
36
|
36
|
|
|
37
|
37
|
$application = new Application(); |
|
38
|
38
|
$application->registerRoutes($this, [ |
|
39
|
|
- 'routes' => [ |
|
40
|
|
- ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'], |
|
41
|
|
- ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'], |
|
42
|
|
- ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'], |
|
43
|
|
- ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'], |
|
44
|
|
- ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'], |
|
45
|
|
- ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'], |
|
46
|
|
- ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'], |
|
47
|
|
- ['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'], |
|
48
|
|
- ['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'], |
|
49
|
|
- ['name' => 'CSRFToken#index', 'url' => '/csrftoken', 'verb' => 'GET'], |
|
50
|
|
- ['name' => 'login#tryLogin', 'url' => '/login', 'verb' => 'POST'], |
|
51
|
|
- ['name' => 'login#confirmPassword', 'url' => '/login/confirm', 'verb' => 'POST'], |
|
52
|
|
- ['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'], |
|
53
|
|
- ['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'], |
|
54
|
|
- ['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', 'verb' => 'GET'], |
|
55
|
|
- ['name' => 'ClientFlowLogin#redirectPage', 'url' => '/login/flow/redirect', 'verb' => 'GET'], |
|
56
|
|
- ['name' => 'ClientFlowLogin#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'], |
|
57
|
|
- ['name' => 'ClientFlowLogin#grantPage', 'url' => '/login/flow/grant', 'verb' => 'GET'], |
|
58
|
|
- ['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'], |
|
59
|
|
- ['name' => 'TwoFactorChallenge#showChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'GET'], |
|
60
|
|
- ['name' => 'TwoFactorChallenge#solveChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'POST'], |
|
61
|
|
- ['name' => 'OCJS#getConfig', 'url' => '/core/js/oc.js', 'verb' => 'GET'], |
|
62
|
|
- ['name' => 'Preview#getPreviewByFileId', 'url' => '/core/preview', 'verb' => 'GET'], |
|
63
|
|
- ['name' => 'Preview#getPreview', 'url' => '/core/preview.png', 'verb' => 'GET'], |
|
64
|
|
- ['name' => 'Svg#getSvgFromCore', 'url' => '/svg/core/{folder}/{fileName}', 'verb' => 'GET'], |
|
65
|
|
- ['name' => 'Svg#getSvgFromApp', 'url' => '/svg/{app}/{fileName}', 'verb' => 'GET'], |
|
66
|
|
- ['name' => 'Css#getCss', 'url' => '/css/{appName}/{fileName}', 'verb' => 'GET'], |
|
67
|
|
- ['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'], |
|
68
|
|
- ['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'], |
|
69
|
|
- ['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'], |
|
70
|
|
- ['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'], |
|
71
|
|
- ['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'], |
|
72
|
|
- ], |
|
73
|
|
- 'ocs' => [ |
|
74
|
|
- ['root' => '/cloud', 'name' => 'OCS#getCapabilities', 'url' => '/capabilities', 'verb' => 'GET'], |
|
75
|
|
- ['root' => '', 'name' => 'OCS#getConfig', 'url' => '/config', 'verb' => 'GET'], |
|
76
|
|
- ['root' => '/person', 'name' => 'OCS#personCheck', 'url' => '/check', 'verb' => 'POST'], |
|
77
|
|
- ['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'], |
|
78
|
|
- ['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'], |
|
79
|
|
- ['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'], |
|
80
|
|
- ['root' => '/core', 'name' => 'AutoComplete#get', 'url' => '/autocomplete/get', 'verb' => 'GET'], |
|
81
|
|
- ['root' => '/core', 'name' => 'WhatsNew#get', 'url' => '/whatsnew', 'verb' => 'GET'], |
|
82
|
|
- ['root' => '/core', 'name' => 'WhatsNew#dismiss', 'url' => '/whatsnew', 'verb' => 'POST'], |
|
83
|
|
- ['root' => '/core', 'name' => 'AppPassword#getAppPassword', 'url' => '/getapppassword', 'verb' => 'GET'], |
|
84
|
|
- ], |
|
|
39
|
+ 'routes' => [ |
|
|
40
|
+ ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'], |
|
|
41
|
+ ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'], |
|
|
42
|
+ ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'], |
|
|
43
|
+ ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'], |
|
|
44
|
+ ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'], |
|
|
45
|
+ ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'], |
|
|
46
|
+ ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'], |
|
|
47
|
+ ['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'], |
|
|
48
|
+ ['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'], |
|
|
49
|
+ ['name' => 'CSRFToken#index', 'url' => '/csrftoken', 'verb' => 'GET'], |
|
|
50
|
+ ['name' => 'login#tryLogin', 'url' => '/login', 'verb' => 'POST'], |
|
|
51
|
+ ['name' => 'login#confirmPassword', 'url' => '/login/confirm', 'verb' => 'POST'], |
|
|
52
|
+ ['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'], |
|
|
53
|
+ ['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'], |
|
|
54
|
+ ['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', 'verb' => 'GET'], |
|
|
55
|
+ ['name' => 'ClientFlowLogin#redirectPage', 'url' => '/login/flow/redirect', 'verb' => 'GET'], |
|
|
56
|
+ ['name' => 'ClientFlowLogin#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'], |
|
|
57
|
+ ['name' => 'ClientFlowLogin#grantPage', 'url' => '/login/flow/grant', 'verb' => 'GET'], |
|
|
58
|
+ ['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'], |
|
|
59
|
+ ['name' => 'TwoFactorChallenge#showChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'GET'], |
|
|
60
|
+ ['name' => 'TwoFactorChallenge#solveChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'POST'], |
|
|
61
|
+ ['name' => 'OCJS#getConfig', 'url' => '/core/js/oc.js', 'verb' => 'GET'], |
|
|
62
|
+ ['name' => 'Preview#getPreviewByFileId', 'url' => '/core/preview', 'verb' => 'GET'], |
|
|
63
|
+ ['name' => 'Preview#getPreview', 'url' => '/core/preview.png', 'verb' => 'GET'], |
|
|
64
|
+ ['name' => 'Svg#getSvgFromCore', 'url' => '/svg/core/{folder}/{fileName}', 'verb' => 'GET'], |
|
|
65
|
+ ['name' => 'Svg#getSvgFromApp', 'url' => '/svg/{app}/{fileName}', 'verb' => 'GET'], |
|
|
66
|
+ ['name' => 'Css#getCss', 'url' => '/css/{appName}/{fileName}', 'verb' => 'GET'], |
|
|
67
|
+ ['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'], |
|
|
68
|
+ ['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'], |
|
|
69
|
+ ['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'], |
|
|
70
|
+ ['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'], |
|
|
71
|
+ ['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'], |
|
|
72
|
+ ], |
|
|
73
|
+ 'ocs' => [ |
|
|
74
|
+ ['root' => '/cloud', 'name' => 'OCS#getCapabilities', 'url' => '/capabilities', 'verb' => 'GET'], |
|
|
75
|
+ ['root' => '', 'name' => 'OCS#getConfig', 'url' => '/config', 'verb' => 'GET'], |
|
|
76
|
+ ['root' => '/person', 'name' => 'OCS#personCheck', 'url' => '/check', 'verb' => 'POST'], |
|
|
77
|
+ ['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'], |
|
|
78
|
+ ['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'], |
|
|
79
|
+ ['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'], |
|
|
80
|
+ ['root' => '/core', 'name' => 'AutoComplete#get', 'url' => '/autocomplete/get', 'verb' => 'GET'], |
|
|
81
|
+ ['root' => '/core', 'name' => 'WhatsNew#get', 'url' => '/whatsnew', 'verb' => 'GET'], |
|
|
82
|
+ ['root' => '/core', 'name' => 'WhatsNew#dismiss', 'url' => '/whatsnew', 'verb' => 'POST'], |
|
|
83
|
+ ['root' => '/core', 'name' => 'AppPassword#getAppPassword', 'url' => '/getapppassword', 'verb' => 'GET'], |
|
|
84
|
+ ], |
|
85
|
85
|
]); |
|
86
|
86
|
|
|
87
|
87
|
// Post installation check |
|
@@ -90,12 +90,12 @@ discard block |
|
|
block discarded – undo |
|
90
|
90
|
// Core ajax actions |
|
91
|
91
|
// Routing |
|
92
|
92
|
$this->create('core_ajax_update', '/core/ajax/update.php') |
|
93
|
|
- ->actionInclude('core/ajax/update.php'); |
|
|
93
|
+ ->actionInclude('core/ajax/update.php'); |
|
94
|
94
|
|
|
95
|
95
|
// File routes |
|
96
|
96
|
$this->create('files.viewcontroller.showFile', '/f/{fileid}')->action(function($urlParams) { |
|
97
|
|
- $app = new \OCA\Files\AppInfo\Application($urlParams); |
|
98
|
|
- $app->dispatch('ViewController', 'index'); |
|
|
97
|
+ $app = new \OCA\Files\AppInfo\Application($urlParams); |
|
|
98
|
+ $app->dispatch('ViewController', 'index'); |
|
99
|
99
|
}); |
|
100
|
100
|
|
|
101
|
101
|
// Call routes |
|
@@ -104,12 +104,12 @@ discard block |
|
|
block discarded – undo |
|
104
|
104
|
* @suppress PhanUndeclaredClassMethod |
|
105
|
105
|
*/ |
|
106
|
106
|
$this->create('spreed.pagecontroller.showCall', '/call/{token}')->action(function($urlParams) { |
|
107
|
|
- if (class_exists(\OCA\Spreed\AppInfo\Application::class, false)) { |
|
108
|
|
- $app = new \OCA\Spreed\AppInfo\Application($urlParams); |
|
109
|
|
- $app->dispatch('PageController', 'index'); |
|
110
|
|
- } else { |
|
111
|
|
- throw new \OC\HintException('App spreed is not enabled'); |
|
112
|
|
- } |
|
|
107
|
+ if (class_exists(\OCA\Spreed\AppInfo\Application::class, false)) { |
|
|
108
|
+ $app = new \OCA\Spreed\AppInfo\Application($urlParams); |
|
|
109
|
+ $app->dispatch('PageController', 'index'); |
|
|
110
|
+ } else { |
|
|
111
|
+ throw new \OC\HintException('App spreed is not enabled'); |
|
|
112
|
+ } |
|
113
|
113
|
}); |
|
114
|
114
|
|
|
115
|
115
|
// OCM routes |
|
@@ -118,12 +118,12 @@ discard block |
|
|
block discarded – undo |
|
118
|
118
|
* @suppress PhanUndeclaredClassMethod |
|
119
|
119
|
*/ |
|
120
|
120
|
$this->create('cloud_federation_api.requesthandlercontroller.addShare', '/ocm/shares')->post()->action(function($urlParams) { |
|
121
|
|
- if (class_exists(\OCA\CloudFederationAPI\AppInfo\Application::class, false)) { |
|
122
|
|
- $app = new \OCA\CloudFederationAPI\AppInfo\Application($urlParams); |
|
123
|
|
- $app->dispatch('RequestHandlerController', 'addShare'); |
|
124
|
|
- } else { |
|
125
|
|
- throw new \OC\HintException('Cloud Federation API not enabled'); |
|
126
|
|
- } |
|
|
121
|
+ if (class_exists(\OCA\CloudFederationAPI\AppInfo\Application::class, false)) { |
|
|
122
|
+ $app = new \OCA\CloudFederationAPI\AppInfo\Application($urlParams); |
|
|
123
|
+ $app->dispatch('RequestHandlerController', 'addShare'); |
|
|
124
|
+ } else { |
|
|
125
|
+ throw new \OC\HintException('Cloud Federation API not enabled'); |
|
|
126
|
+ } |
|
127
|
127
|
}); |
|
128
|
128
|
|
|
129
|
129
|
/** |
|
@@ -131,53 +131,53 @@ discard block |
|
|
block discarded – undo |
|
131
|
131
|
* @suppress PhanUndeclaredClassMethod |
|
132
|
132
|
*/ |
|
133
|
133
|
$this->create('cloud_federation_api.requesthandlercontroller.receiveNotification', '/ocm/notifications')->post()->action(function($urlParams) { |
|
134
|
|
- if (class_exists(\OCA\CloudFederationAPI\AppInfo\Application::class, false)) { |
|
135
|
|
- $app = new \OCA\CloudFederationAPI\AppInfo\Application($urlParams); |
|
136
|
|
- $app->dispatch('RequestHandlerController', 'receiveNotification'); |
|
137
|
|
- } else { |
|
138
|
|
- throw new \OC\HintException('Cloud Federation API not enabled'); |
|
139
|
|
- } |
|
|
134
|
+ if (class_exists(\OCA\CloudFederationAPI\AppInfo\Application::class, false)) { |
|
|
135
|
+ $app = new \OCA\CloudFederationAPI\AppInfo\Application($urlParams); |
|
|
136
|
+ $app->dispatch('RequestHandlerController', 'receiveNotification'); |
|
|
137
|
+ } else { |
|
|
138
|
+ throw new \OC\HintException('Cloud Federation API not enabled'); |
|
|
139
|
+ } |
|
140
|
140
|
}); |
|
141
|
141
|
|
|
142
|
142
|
|
|
143
|
143
|
// Sharing routes |
|
144
|
144
|
$this->create('files_sharing.sharecontroller.showShare', '/s/{token}')->action(function($urlParams) { |
|
145
|
|
- if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
146
|
|
- $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
147
|
|
- $app->dispatch('ShareController', 'showShare'); |
|
148
|
|
- } else { |
|
149
|
|
- throw new \OC\HintException('App file sharing is not enabled'); |
|
150
|
|
- } |
|
|
145
|
+ if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
|
146
|
+ $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
|
147
|
+ $app->dispatch('ShareController', 'showShare'); |
|
|
148
|
+ } else { |
|
|
149
|
+ throw new \OC\HintException('App file sharing is not enabled'); |
|
|
150
|
+ } |
|
151
|
151
|
}); |
|
152
|
152
|
$this->create('files_sharing.sharecontroller.authenticate', '/s/{token}/authenticate/{redirect}')->post()->action(function($urlParams) { |
|
153
|
|
- if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
154
|
|
- $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
155
|
|
- $app->dispatch('ShareController', 'authenticate'); |
|
156
|
|
- } else { |
|
157
|
|
- throw new \OC\HintException('App file sharing is not enabled'); |
|
158
|
|
- } |
|
|
153
|
+ if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
|
154
|
+ $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
|
155
|
+ $app->dispatch('ShareController', 'authenticate'); |
|
|
156
|
+ } else { |
|
|
157
|
+ throw new \OC\HintException('App file sharing is not enabled'); |
|
|
158
|
+ } |
|
159
|
159
|
}); |
|
160
|
160
|
$this->create('files_sharing.sharecontroller.showAuthenticate', '/s/{token}/authenticate/{redirect}')->get()->action(function($urlParams) { |
|
161
|
|
- if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
162
|
|
- $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
163
|
|
- $app->dispatch('ShareController', 'showAuthenticate'); |
|
164
|
|
- } else { |
|
165
|
|
- throw new \OC\HintException('App file sharing is not enabled'); |
|
166
|
|
- } |
|
|
161
|
+ if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
|
162
|
+ $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
|
163
|
+ $app->dispatch('ShareController', 'showAuthenticate'); |
|
|
164
|
+ } else { |
|
|
165
|
+ throw new \OC\HintException('App file sharing is not enabled'); |
|
|
166
|
+ } |
|
167
|
167
|
}); |
|
168
|
168
|
$this->create('files_sharing.sharecontroller.downloadShare', '/s/{token}/download')->get()->action(function($urlParams) { |
|
169
|
|
- if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
170
|
|
- $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
171
|
|
- $app->dispatch('ShareController', 'downloadShare'); |
|
172
|
|
- } else { |
|
173
|
|
- throw new \OC\HintException('App file sharing is not enabled'); |
|
174
|
|
- } |
|
|
169
|
+ if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
|
170
|
+ $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
|
171
|
+ $app->dispatch('ShareController', 'downloadShare'); |
|
|
172
|
+ } else { |
|
|
173
|
+ throw new \OC\HintException('App file sharing is not enabled'); |
|
|
174
|
+ } |
|
175
|
175
|
}); |
|
176
|
176
|
$this->create('files_sharing.publicpreview.directLink', '/s/{token}/preview')->get()->action(function($urlParams) { |
|
177
|
|
- if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
178
|
|
- $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
179
|
|
- $app->dispatch('PublicPreviewController', 'directLink'); |
|
180
|
|
- } else { |
|
181
|
|
- throw new \OC\HintException('App file sharing is not enabled'); |
|
182
|
|
- } |
|
|
177
|
+ if (class_exists(\OCA\Files_Sharing\AppInfo\Application::class, false)) { |
|
|
178
|
+ $app = new \OCA\Files_Sharing\AppInfo\Application($urlParams); |
|
|
179
|
+ $app->dispatch('PublicPreviewController', 'directLink'); |
|
|
180
|
+ } else { |
|
|
181
|
+ throw new \OC\HintException('App file sharing is not enabled'); |
|
|
182
|
+ } |
|
183
|
183
|
}); |