@@ -40,257 +40,257 @@ |
||
| 40 | 40 | * @package OC\AppFramework\routing |
| 41 | 41 | */ |
| 42 | 42 | class RouteConfig { |
| 43 | - /** @var DIContainer */ |
|
| 44 | - private $container; |
|
| 45 | - |
|
| 46 | - /** @var IRouter */ |
|
| 47 | - private $router; |
|
| 48 | - |
|
| 49 | - /** @var array */ |
|
| 50 | - private $routes; |
|
| 51 | - |
|
| 52 | - /** @var string */ |
|
| 53 | - private $appName; |
|
| 54 | - |
|
| 55 | - /** @var string[] */ |
|
| 56 | - private $controllerNameCache = []; |
|
| 57 | - |
|
| 58 | - protected $rootUrlApps = [ |
|
| 59 | - 'cloud_federation_api', |
|
| 60 | - 'core', |
|
| 61 | - 'files_sharing', |
|
| 62 | - 'files', |
|
| 63 | - 'settings', |
|
| 64 | - 'spreed', |
|
| 65 | - ]; |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * @param \OC\AppFramework\DependencyInjection\DIContainer $container |
|
| 69 | - * @param \OCP\Route\IRouter $router |
|
| 70 | - * @param array $routes |
|
| 71 | - * @internal param $appName |
|
| 72 | - */ |
|
| 73 | - public function __construct(DIContainer $container, IRouter $router, $routes) { |
|
| 74 | - $this->routes = $routes; |
|
| 75 | - $this->container = $container; |
|
| 76 | - $this->router = $router; |
|
| 77 | - $this->appName = $container['AppName']; |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * The routes and resource will be registered to the \OCP\Route\IRouter |
|
| 82 | - */ |
|
| 83 | - public function register() { |
|
| 84 | - |
|
| 85 | - // parse simple |
|
| 86 | - $this->processIndexRoutes($this->routes); |
|
| 87 | - |
|
| 88 | - // parse resources |
|
| 89 | - $this->processIndexResources($this->routes); |
|
| 90 | - |
|
| 91 | - /* |
|
| 43 | + /** @var DIContainer */ |
|
| 44 | + private $container; |
|
| 45 | + |
|
| 46 | + /** @var IRouter */ |
|
| 47 | + private $router; |
|
| 48 | + |
|
| 49 | + /** @var array */ |
|
| 50 | + private $routes; |
|
| 51 | + |
|
| 52 | + /** @var string */ |
|
| 53 | + private $appName; |
|
| 54 | + |
|
| 55 | + /** @var string[] */ |
|
| 56 | + private $controllerNameCache = []; |
|
| 57 | + |
|
| 58 | + protected $rootUrlApps = [ |
|
| 59 | + 'cloud_federation_api', |
|
| 60 | + 'core', |
|
| 61 | + 'files_sharing', |
|
| 62 | + 'files', |
|
| 63 | + 'settings', |
|
| 64 | + 'spreed', |
|
| 65 | + ]; |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * @param \OC\AppFramework\DependencyInjection\DIContainer $container |
|
| 69 | + * @param \OCP\Route\IRouter $router |
|
| 70 | + * @param array $routes |
|
| 71 | + * @internal param $appName |
|
| 72 | + */ |
|
| 73 | + public function __construct(DIContainer $container, IRouter $router, $routes) { |
|
| 74 | + $this->routes = $routes; |
|
| 75 | + $this->container = $container; |
|
| 76 | + $this->router = $router; |
|
| 77 | + $this->appName = $container['AppName']; |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * The routes and resource will be registered to the \OCP\Route\IRouter |
|
| 82 | + */ |
|
| 83 | + public function register() { |
|
| 84 | + |
|
| 85 | + // parse simple |
|
| 86 | + $this->processIndexRoutes($this->routes); |
|
| 87 | + |
|
| 88 | + // parse resources |
|
| 89 | + $this->processIndexResources($this->routes); |
|
| 90 | + |
|
| 91 | + /* |
|
| 92 | 92 | * OCS routes go into a different collection |
| 93 | 93 | */ |
| 94 | - $oldCollection = $this->router->getCurrentCollection(); |
|
| 95 | - $this->router->useCollection($oldCollection . '.ocs'); |
|
| 96 | - |
|
| 97 | - // parse ocs simple routes |
|
| 98 | - $this->processOCS($this->routes); |
|
| 99 | - |
|
| 100 | - // parse ocs simple routes |
|
| 101 | - $this->processOCSResources($this->routes); |
|
| 102 | - |
|
| 103 | - $this->router->useCollection($oldCollection); |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - private function processOCS(array $routes): void { |
|
| 107 | - $ocsRoutes = $routes['ocs'] ?? []; |
|
| 108 | - foreach ($ocsRoutes as $ocsRoute) { |
|
| 109 | - $this->processRoute($ocsRoute, 'ocs.'); |
|
| 110 | - } |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * Creates one route base on the give configuration |
|
| 115 | - * @param array $routes |
|
| 116 | - * @throws \UnexpectedValueException |
|
| 117 | - */ |
|
| 118 | - private function processIndexRoutes(array $routes): void { |
|
| 119 | - $simpleRoutes = $routes['routes'] ?? []; |
|
| 120 | - foreach ($simpleRoutes as $simpleRoute) { |
|
| 121 | - $this->processRoute($simpleRoute); |
|
| 122 | - } |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - protected function processRoute(array $route, string $routeNamePrefix = ''): void { |
|
| 126 | - $name = $route['name']; |
|
| 127 | - $postfix = $route['postfix'] ?? ''; |
|
| 128 | - $root = $this->buildRootPrefix($route, $routeNamePrefix); |
|
| 129 | - |
|
| 130 | - $url = $root . '/' . ltrim($route['url'], '/'); |
|
| 131 | - $verb = strtoupper($route['verb'] ?? 'GET'); |
|
| 132 | - |
|
| 133 | - $split = explode('#', $name, 2); |
|
| 134 | - if (count($split) !== 2) { |
|
| 135 | - throw new \UnexpectedValueException('Invalid route name'); |
|
| 136 | - } |
|
| 137 | - list($controller, $action) = $split; |
|
| 138 | - |
|
| 139 | - $controllerName = $this->buildControllerName($controller); |
|
| 140 | - $actionName = $this->buildActionName($action); |
|
| 141 | - |
|
| 142 | - $routeName = $routeNamePrefix . $this->appName . '.' . $controller . '.' . $action . $postfix; |
|
| 143 | - |
|
| 144 | - // register the route |
|
| 145 | - $handler = new RouteActionHandler($this->container, $controllerName, $actionName); |
|
| 146 | - |
|
| 147 | - $router = $this->router->create($routeName, $url) |
|
| 148 | - ->method($verb) |
|
| 149 | - ->action($handler); |
|
| 150 | - |
|
| 151 | - // optionally register requirements for route. This is used to |
|
| 152 | - // tell the route parser how url parameters should be matched |
|
| 153 | - if (array_key_exists('requirements', $route)) { |
|
| 154 | - $router->requirements($route['requirements']); |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - // optionally register defaults for route. This is used to |
|
| 158 | - // tell the route parser how url parameters should be default valued |
|
| 159 | - if (array_key_exists('defaults', $route)) { |
|
| 160 | - $router->defaults($route['defaults']); |
|
| 161 | - } |
|
| 162 | - } |
|
| 163 | - |
|
| 164 | - /** |
|
| 165 | - * For a given name and url restful OCS routes are created: |
|
| 166 | - * - index |
|
| 167 | - * - show |
|
| 168 | - * - create |
|
| 169 | - * - update |
|
| 170 | - * - destroy |
|
| 171 | - * |
|
| 172 | - * @param array $routes |
|
| 173 | - */ |
|
| 174 | - private function processOCSResources(array $routes): void { |
|
| 175 | - $this->processResources($routes['ocs-resources'] ?? [], 'ocs.'); |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - /** |
|
| 179 | - * For a given name and url restful routes are created: |
|
| 180 | - * - index |
|
| 181 | - * - show |
|
| 182 | - * - create |
|
| 183 | - * - update |
|
| 184 | - * - destroy |
|
| 185 | - * |
|
| 186 | - * @param array $routes |
|
| 187 | - */ |
|
| 188 | - private function processIndexResources(array $routes): void { |
|
| 189 | - $this->processResources($routes['resources'] ?? []); |
|
| 190 | - } |
|
| 191 | - |
|
| 192 | - /** |
|
| 193 | - * For a given name and url restful routes are created: |
|
| 194 | - * - index |
|
| 195 | - * - show |
|
| 196 | - * - create |
|
| 197 | - * - update |
|
| 198 | - * - destroy |
|
| 199 | - * |
|
| 200 | - * @param array $resources |
|
| 201 | - * @param string $routeNamePrefix |
|
| 202 | - */ |
|
| 203 | - protected function processResources(array $resources, string $routeNamePrefix = ''): void { |
|
| 204 | - // declaration of all restful actions |
|
| 205 | - $actions = [ |
|
| 206 | - ['name' => 'index', 'verb' => 'GET', 'on-collection' => true], |
|
| 207 | - ['name' => 'show', 'verb' => 'GET'], |
|
| 208 | - ['name' => 'create', 'verb' => 'POST', 'on-collection' => true], |
|
| 209 | - ['name' => 'update', 'verb' => 'PUT'], |
|
| 210 | - ['name' => 'destroy', 'verb' => 'DELETE'], |
|
| 211 | - ]; |
|
| 212 | - |
|
| 213 | - foreach ($resources as $resource => $config) { |
|
| 214 | - $root = $this->buildRootPrefix($config, $routeNamePrefix); |
|
| 215 | - |
|
| 216 | - // the url parameter used as id to the resource |
|
| 217 | - foreach ($actions as $action) { |
|
| 218 | - $url = $root . '/' . ltrim($config['url'], '/'); |
|
| 219 | - $method = $action['name']; |
|
| 220 | - |
|
| 221 | - $verb = strtoupper($action['verb'] ?? 'GET'); |
|
| 222 | - $collectionAction = $action['on-collection'] ?? false; |
|
| 223 | - if (!$collectionAction) { |
|
| 224 | - $url .= '/{id}'; |
|
| 225 | - } |
|
| 226 | - if (isset($action['url-postfix'])) { |
|
| 227 | - $url .= '/' . $action['url-postfix']; |
|
| 228 | - } |
|
| 229 | - |
|
| 230 | - $controller = $resource; |
|
| 231 | - |
|
| 232 | - $controllerName = $this->buildControllerName($controller); |
|
| 233 | - $actionName = $this->buildActionName($method); |
|
| 234 | - |
|
| 235 | - $routeName = $routeNamePrefix . $this->appName . '.' . strtolower($resource) . '.' . strtolower($method); |
|
| 236 | - |
|
| 237 | - $this->router->create($routeName, $url)->method($verb)->action( |
|
| 238 | - new RouteActionHandler($this->container, $controllerName, $actionName) |
|
| 239 | - ); |
|
| 240 | - } |
|
| 241 | - } |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - private function buildRootPrefix(array $route, string $routeNamePrefix): string { |
|
| 245 | - $defaultRoot = $this->appName === 'core' ? '' : '/apps/' . $this->appName; |
|
| 246 | - $root = $route['root'] ?? $defaultRoot; |
|
| 247 | - |
|
| 248 | - if ($routeNamePrefix !== '') { |
|
| 249 | - // In OCS all apps are whitelisted |
|
| 250 | - return $root; |
|
| 251 | - } |
|
| 252 | - |
|
| 253 | - if (!\in_array($this->appName, $this->rootUrlApps, true)) { |
|
| 254 | - // Only allow root URLS for some apps |
|
| 255 | - return $defaultRoot; |
|
| 256 | - } |
|
| 257 | - |
|
| 258 | - return $root; |
|
| 259 | - } |
|
| 260 | - |
|
| 261 | - /** |
|
| 262 | - * Based on a given route name the controller name is generated |
|
| 263 | - * @param string $controller |
|
| 264 | - * @return string |
|
| 265 | - */ |
|
| 266 | - private function buildControllerName(string $controller): string { |
|
| 267 | - if (!isset($this->controllerNameCache[$controller])) { |
|
| 268 | - $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)) . 'Controller'; |
|
| 269 | - } |
|
| 270 | - return $this->controllerNameCache[$controller]; |
|
| 271 | - } |
|
| 272 | - |
|
| 273 | - /** |
|
| 274 | - * Based on the action part of the route name the controller method name is generated |
|
| 275 | - * @param string $action |
|
| 276 | - * @return string |
|
| 277 | - */ |
|
| 278 | - private function buildActionName(string $action): string { |
|
| 279 | - return $this->underScoreToCamelCase($action); |
|
| 280 | - } |
|
| 281 | - |
|
| 282 | - /** |
|
| 283 | - * Underscored strings are converted to camel case strings |
|
| 284 | - * @param string $str |
|
| 285 | - * @return string |
|
| 286 | - */ |
|
| 287 | - private function underScoreToCamelCase(string $str): string { |
|
| 288 | - $pattern = '/_[a-z]?/'; |
|
| 289 | - return preg_replace_callback( |
|
| 290 | - $pattern, |
|
| 291 | - function ($matches) { |
|
| 292 | - return strtoupper(ltrim($matches[0], '_')); |
|
| 293 | - }, |
|
| 294 | - $str); |
|
| 295 | - } |
|
| 94 | + $oldCollection = $this->router->getCurrentCollection(); |
|
| 95 | + $this->router->useCollection($oldCollection . '.ocs'); |
|
| 96 | + |
|
| 97 | + // parse ocs simple routes |
|
| 98 | + $this->processOCS($this->routes); |
|
| 99 | + |
|
| 100 | + // parse ocs simple routes |
|
| 101 | + $this->processOCSResources($this->routes); |
|
| 102 | + |
|
| 103 | + $this->router->useCollection($oldCollection); |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + private function processOCS(array $routes): void { |
|
| 107 | + $ocsRoutes = $routes['ocs'] ?? []; |
|
| 108 | + foreach ($ocsRoutes as $ocsRoute) { |
|
| 109 | + $this->processRoute($ocsRoute, 'ocs.'); |
|
| 110 | + } |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * Creates one route base on the give configuration |
|
| 115 | + * @param array $routes |
|
| 116 | + * @throws \UnexpectedValueException |
|
| 117 | + */ |
|
| 118 | + private function processIndexRoutes(array $routes): void { |
|
| 119 | + $simpleRoutes = $routes['routes'] ?? []; |
|
| 120 | + foreach ($simpleRoutes as $simpleRoute) { |
|
| 121 | + $this->processRoute($simpleRoute); |
|
| 122 | + } |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + protected function processRoute(array $route, string $routeNamePrefix = ''): void { |
|
| 126 | + $name = $route['name']; |
|
| 127 | + $postfix = $route['postfix'] ?? ''; |
|
| 128 | + $root = $this->buildRootPrefix($route, $routeNamePrefix); |
|
| 129 | + |
|
| 130 | + $url = $root . '/' . ltrim($route['url'], '/'); |
|
| 131 | + $verb = strtoupper($route['verb'] ?? 'GET'); |
|
| 132 | + |
|
| 133 | + $split = explode('#', $name, 2); |
|
| 134 | + if (count($split) !== 2) { |
|
| 135 | + throw new \UnexpectedValueException('Invalid route name'); |
|
| 136 | + } |
|
| 137 | + list($controller, $action) = $split; |
|
| 138 | + |
|
| 139 | + $controllerName = $this->buildControllerName($controller); |
|
| 140 | + $actionName = $this->buildActionName($action); |
|
| 141 | + |
|
| 142 | + $routeName = $routeNamePrefix . $this->appName . '.' . $controller . '.' . $action . $postfix; |
|
| 143 | + |
|
| 144 | + // register the route |
|
| 145 | + $handler = new RouteActionHandler($this->container, $controllerName, $actionName); |
|
| 146 | + |
|
| 147 | + $router = $this->router->create($routeName, $url) |
|
| 148 | + ->method($verb) |
|
| 149 | + ->action($handler); |
|
| 150 | + |
|
| 151 | + // optionally register requirements for route. This is used to |
|
| 152 | + // tell the route parser how url parameters should be matched |
|
| 153 | + if (array_key_exists('requirements', $route)) { |
|
| 154 | + $router->requirements($route['requirements']); |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + // optionally register defaults for route. This is used to |
|
| 158 | + // tell the route parser how url parameters should be default valued |
|
| 159 | + if (array_key_exists('defaults', $route)) { |
|
| 160 | + $router->defaults($route['defaults']); |
|
| 161 | + } |
|
| 162 | + } |
|
| 163 | + |
|
| 164 | + /** |
|
| 165 | + * For a given name and url restful OCS routes are created: |
|
| 166 | + * - index |
|
| 167 | + * - show |
|
| 168 | + * - create |
|
| 169 | + * - update |
|
| 170 | + * - destroy |
|
| 171 | + * |
|
| 172 | + * @param array $routes |
|
| 173 | + */ |
|
| 174 | + private function processOCSResources(array $routes): void { |
|
| 175 | + $this->processResources($routes['ocs-resources'] ?? [], 'ocs.'); |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * For a given name and url restful routes are created: |
|
| 180 | + * - index |
|
| 181 | + * - show |
|
| 182 | + * - create |
|
| 183 | + * - update |
|
| 184 | + * - destroy |
|
| 185 | + * |
|
| 186 | + * @param array $routes |
|
| 187 | + */ |
|
| 188 | + private function processIndexResources(array $routes): void { |
|
| 189 | + $this->processResources($routes['resources'] ?? []); |
|
| 190 | + } |
|
| 191 | + |
|
| 192 | + /** |
|
| 193 | + * For a given name and url restful routes are created: |
|
| 194 | + * - index |
|
| 195 | + * - show |
|
| 196 | + * - create |
|
| 197 | + * - update |
|
| 198 | + * - destroy |
|
| 199 | + * |
|
| 200 | + * @param array $resources |
|
| 201 | + * @param string $routeNamePrefix |
|
| 202 | + */ |
|
| 203 | + protected function processResources(array $resources, string $routeNamePrefix = ''): void { |
|
| 204 | + // declaration of all restful actions |
|
| 205 | + $actions = [ |
|
| 206 | + ['name' => 'index', 'verb' => 'GET', 'on-collection' => true], |
|
| 207 | + ['name' => 'show', 'verb' => 'GET'], |
|
| 208 | + ['name' => 'create', 'verb' => 'POST', 'on-collection' => true], |
|
| 209 | + ['name' => 'update', 'verb' => 'PUT'], |
|
| 210 | + ['name' => 'destroy', 'verb' => 'DELETE'], |
|
| 211 | + ]; |
|
| 212 | + |
|
| 213 | + foreach ($resources as $resource => $config) { |
|
| 214 | + $root = $this->buildRootPrefix($config, $routeNamePrefix); |
|
| 215 | + |
|
| 216 | + // the url parameter used as id to the resource |
|
| 217 | + foreach ($actions as $action) { |
|
| 218 | + $url = $root . '/' . ltrim($config['url'], '/'); |
|
| 219 | + $method = $action['name']; |
|
| 220 | + |
|
| 221 | + $verb = strtoupper($action['verb'] ?? 'GET'); |
|
| 222 | + $collectionAction = $action['on-collection'] ?? false; |
|
| 223 | + if (!$collectionAction) { |
|
| 224 | + $url .= '/{id}'; |
|
| 225 | + } |
|
| 226 | + if (isset($action['url-postfix'])) { |
|
| 227 | + $url .= '/' . $action['url-postfix']; |
|
| 228 | + } |
|
| 229 | + |
|
| 230 | + $controller = $resource; |
|
| 231 | + |
|
| 232 | + $controllerName = $this->buildControllerName($controller); |
|
| 233 | + $actionName = $this->buildActionName($method); |
|
| 234 | + |
|
| 235 | + $routeName = $routeNamePrefix . $this->appName . '.' . strtolower($resource) . '.' . strtolower($method); |
|
| 236 | + |
|
| 237 | + $this->router->create($routeName, $url)->method($verb)->action( |
|
| 238 | + new RouteActionHandler($this->container, $controllerName, $actionName) |
|
| 239 | + ); |
|
| 240 | + } |
|
| 241 | + } |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + private function buildRootPrefix(array $route, string $routeNamePrefix): string { |
|
| 245 | + $defaultRoot = $this->appName === 'core' ? '' : '/apps/' . $this->appName; |
|
| 246 | + $root = $route['root'] ?? $defaultRoot; |
|
| 247 | + |
|
| 248 | + if ($routeNamePrefix !== '') { |
|
| 249 | + // In OCS all apps are whitelisted |
|
| 250 | + return $root; |
|
| 251 | + } |
|
| 252 | + |
|
| 253 | + if (!\in_array($this->appName, $this->rootUrlApps, true)) { |
|
| 254 | + // Only allow root URLS for some apps |
|
| 255 | + return $defaultRoot; |
|
| 256 | + } |
|
| 257 | + |
|
| 258 | + return $root; |
|
| 259 | + } |
|
| 260 | + |
|
| 261 | + /** |
|
| 262 | + * Based on a given route name the controller name is generated |
|
| 263 | + * @param string $controller |
|
| 264 | + * @return string |
|
| 265 | + */ |
|
| 266 | + private function buildControllerName(string $controller): string { |
|
| 267 | + if (!isset($this->controllerNameCache[$controller])) { |
|
| 268 | + $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)) . 'Controller'; |
|
| 269 | + } |
|
| 270 | + return $this->controllerNameCache[$controller]; |
|
| 271 | + } |
|
| 272 | + |
|
| 273 | + /** |
|
| 274 | + * Based on the action part of the route name the controller method name is generated |
|
| 275 | + * @param string $action |
|
| 276 | + * @return string |
|
| 277 | + */ |
|
| 278 | + private function buildActionName(string $action): string { |
|
| 279 | + return $this->underScoreToCamelCase($action); |
|
| 280 | + } |
|
| 281 | + |
|
| 282 | + /** |
|
| 283 | + * Underscored strings are converted to camel case strings |
|
| 284 | + * @param string $str |
|
| 285 | + * @return string |
|
| 286 | + */ |
|
| 287 | + private function underScoreToCamelCase(string $str): string { |
|
| 288 | + $pattern = '/_[a-z]?/'; |
|
| 289 | + return preg_replace_callback( |
|
| 290 | + $pattern, |
|
| 291 | + function ($matches) { |
|
| 292 | + return strtoupper(ltrim($matches[0], '_')); |
|
| 293 | + }, |
|
| 294 | + $str); |
|
| 295 | + } |
|
| 296 | 296 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * OCS routes go into a different collection |
| 93 | 93 | */ |
| 94 | 94 | $oldCollection = $this->router->getCurrentCollection(); |
| 95 | - $this->router->useCollection($oldCollection . '.ocs'); |
|
| 95 | + $this->router->useCollection($oldCollection.'.ocs'); |
|
| 96 | 96 | |
| 97 | 97 | // parse ocs simple routes |
| 98 | 98 | $this->processOCS($this->routes); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $postfix = $route['postfix'] ?? ''; |
| 128 | 128 | $root = $this->buildRootPrefix($route, $routeNamePrefix); |
| 129 | 129 | |
| 130 | - $url = $root . '/' . ltrim($route['url'], '/'); |
|
| 130 | + $url = $root.'/'.ltrim($route['url'], '/'); |
|
| 131 | 131 | $verb = strtoupper($route['verb'] ?? 'GET'); |
| 132 | 132 | |
| 133 | 133 | $split = explode('#', $name, 2); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $controllerName = $this->buildControllerName($controller); |
| 140 | 140 | $actionName = $this->buildActionName($action); |
| 141 | 141 | |
| 142 | - $routeName = $routeNamePrefix . $this->appName . '.' . $controller . '.' . $action . $postfix; |
|
| 142 | + $routeName = $routeNamePrefix.$this->appName.'.'.$controller.'.'.$action.$postfix; |
|
| 143 | 143 | |
| 144 | 144 | // register the route |
| 145 | 145 | $handler = new RouteActionHandler($this->container, $controllerName, $actionName); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | // the url parameter used as id to the resource |
| 217 | 217 | foreach ($actions as $action) { |
| 218 | - $url = $root . '/' . ltrim($config['url'], '/'); |
|
| 218 | + $url = $root.'/'.ltrim($config['url'], '/'); |
|
| 219 | 219 | $method = $action['name']; |
| 220 | 220 | |
| 221 | 221 | $verb = strtoupper($action['verb'] ?? 'GET'); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $url .= '/{id}'; |
| 225 | 225 | } |
| 226 | 226 | if (isset($action['url-postfix'])) { |
| 227 | - $url .= '/' . $action['url-postfix']; |
|
| 227 | + $url .= '/'.$action['url-postfix']; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | $controller = $resource; |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $controllerName = $this->buildControllerName($controller); |
| 233 | 233 | $actionName = $this->buildActionName($method); |
| 234 | 234 | |
| 235 | - $routeName = $routeNamePrefix . $this->appName . '.' . strtolower($resource) . '.' . strtolower($method); |
|
| 235 | + $routeName = $routeNamePrefix.$this->appName.'.'.strtolower($resource).'.'.strtolower($method); |
|
| 236 | 236 | |
| 237 | 237 | $this->router->create($routeName, $url)->method($verb)->action( |
| 238 | 238 | new RouteActionHandler($this->container, $controllerName, $actionName) |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | private function buildRootPrefix(array $route, string $routeNamePrefix): string { |
| 245 | - $defaultRoot = $this->appName === 'core' ? '' : '/apps/' . $this->appName; |
|
| 245 | + $defaultRoot = $this->appName === 'core' ? '' : '/apps/'.$this->appName; |
|
| 246 | 246 | $root = $route['root'] ?? $defaultRoot; |
| 247 | 247 | |
| 248 | 248 | if ($routeNamePrefix !== '') { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | private function buildControllerName(string $controller): string { |
| 267 | 267 | if (!isset($this->controllerNameCache[$controller])) { |
| 268 | - $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)) . 'Controller'; |
|
| 268 | + $this->controllerNameCache[$controller] = $this->underScoreToCamelCase(ucfirst($controller)).'Controller'; |
|
| 269 | 269 | } |
| 270 | 270 | return $this->controllerNameCache[$controller]; |
| 271 | 271 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $pattern = '/_[a-z]?/'; |
| 289 | 289 | return preg_replace_callback( |
| 290 | 290 | $pattern, |
| 291 | - function ($matches) { |
|
| 291 | + function($matches) { |
|
| 292 | 292 | return strtoupper(ltrim($matches[0], '_')); |
| 293 | 293 | }, |
| 294 | 294 | $str); |
@@ -35,60 +35,60 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | 37 | return [ |
| 38 | - 'resources' => [ |
|
| 39 | - 'AuthSettings' => ['url' => '/settings/personal/authtokens' , 'root' => ''], |
|
| 40 | - ], |
|
| 41 | - 'routes' => [ |
|
| 42 | - ['name' => 'AuthSettings#wipe', 'url' => '/settings/personal/authtokens/wipe/{id}', 'verb' => 'POST' , 'root' => ''], |
|
| 38 | + 'resources' => [ |
|
| 39 | + 'AuthSettings' => ['url' => '/settings/personal/authtokens' , 'root' => ''], |
|
| 40 | + ], |
|
| 41 | + 'routes' => [ |
|
| 42 | + ['name' => 'AuthSettings#wipe', 'url' => '/settings/personal/authtokens/wipe/{id}', 'verb' => 'POST' , 'root' => ''], |
|
| 43 | 43 | |
| 44 | - ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST' , 'root' => ''], |
|
| 45 | - ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST' , 'root' => ''], |
|
| 46 | - ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST' , 'root' => ''], |
|
| 47 | - ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST' , 'root' => ''], |
|
| 44 | + ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST' , 'root' => ''], |
|
| 45 | + ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST' , 'root' => ''], |
|
| 46 | + ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST' , 'root' => ''], |
|
| 47 | + ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST' , 'root' => ''], |
|
| 48 | 48 | |
| 49 | - ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET' , 'root' => ''], |
|
| 50 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET' , 'root' => ''], |
|
| 51 | - ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET' , 'root' => ''], |
|
| 52 | - ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 53 | - ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST' , 'root' => ''], |
|
| 54 | - ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST' , 'root' => ''], |
|
| 55 | - ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 56 | - ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST' , 'root' => ''], |
|
| 57 | - ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 58 | - ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 59 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => ''] , 'root' => ''], |
|
| 60 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => ''] , 'root' => ''], |
|
| 61 | - ['name' => 'AppSettings#force', 'url' => '/settings/apps/force', 'verb' => 'POST' , 'root' => ''], |
|
| 49 | + ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET' , 'root' => ''], |
|
| 50 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET' , 'root' => ''], |
|
| 51 | + ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET' , 'root' => ''], |
|
| 52 | + ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 53 | + ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST' , 'root' => ''], |
|
| 54 | + ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST' , 'root' => ''], |
|
| 55 | + ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 56 | + ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST' , 'root' => ''], |
|
| 57 | + ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 58 | + ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 59 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => ''] , 'root' => ''], |
|
| 60 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => ''] , 'root' => ''], |
|
| 61 | + ['name' => 'AppSettings#force', 'url' => '/settings/apps/force', 'verb' => 'POST' , 'root' => ''], |
|
| 62 | 62 | |
| 63 | - ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST' , 'root' => ''], |
|
| 64 | - ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT' , 'root' => ''], |
|
| 65 | - ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT' , 'root' => ''], |
|
| 66 | - ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET' , 'root' => ''], |
|
| 67 | - ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET' , 'root' => ''], |
|
| 68 | - ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET', 'requirements' => ['group' => '.+'] , 'root' => ''], |
|
| 69 | - ['name' => 'Users#setPreference', 'url' => '/settings/users/preferences/{key}', 'verb' => 'POST' , 'root' => ''], |
|
| 70 | - ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST' , 'root' => ''], |
|
| 71 | - ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET' , 'root' => ''], |
|
| 72 | - ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET' , 'root' => ''], |
|
| 73 | - ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET' , 'root' => ''], |
|
| 74 | - ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET' , 'root' => ''], |
|
| 75 | - ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET' , 'root' => ''], |
|
| 76 | - ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST' , 'root' => ''], |
|
| 77 | - ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 78 | - ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST' , 'root' => ''], |
|
| 79 | - ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 80 | - ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info'] , 'root' => ''], |
|
| 81 | - ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server'] , 'root' => ''], |
|
| 82 | - ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET' , 'root' => ''], |
|
| 83 | - ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST' , 'root' => ''], |
|
| 84 | - ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST' , 'root' => ''], |
|
| 85 | - ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET' , 'root' => ''], |
|
| 86 | - ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT' , 'root' => ''], |
|
| 63 | + ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST' , 'root' => ''], |
|
| 64 | + ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT' , 'root' => ''], |
|
| 65 | + ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT' , 'root' => ''], |
|
| 66 | + ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET' , 'root' => ''], |
|
| 67 | + ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET' , 'root' => ''], |
|
| 68 | + ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET', 'requirements' => ['group' => '.+'] , 'root' => ''], |
|
| 69 | + ['name' => 'Users#setPreference', 'url' => '/settings/users/preferences/{key}', 'verb' => 'POST' , 'root' => ''], |
|
| 70 | + ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST' , 'root' => ''], |
|
| 71 | + ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET' , 'root' => ''], |
|
| 72 | + ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET' , 'root' => ''], |
|
| 73 | + ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET' , 'root' => ''], |
|
| 74 | + ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET' , 'root' => ''], |
|
| 75 | + ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET' , 'root' => ''], |
|
| 76 | + ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST' , 'root' => ''], |
|
| 77 | + ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 78 | + ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST' , 'root' => ''], |
|
| 79 | + ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 80 | + ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info'] , 'root' => ''], |
|
| 81 | + ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server'] , 'root' => ''], |
|
| 82 | + ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET' , 'root' => ''], |
|
| 83 | + ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST' , 'root' => ''], |
|
| 84 | + ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST' , 'root' => ''], |
|
| 85 | + ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET' , 'root' => ''], |
|
| 86 | + ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT' , 'root' => ''], |
|
| 87 | 87 | |
| 88 | - ['name' => 'Help#help', 'url' => '/settings/help/{mode}', 'verb' => 'GET', 'defaults' => ['mode' => ''] , 'root' => ''], |
|
| 88 | + ['name' => 'Help#help', 'url' => '/settings/help/{mode}', 'verb' => 'GET', 'defaults' => ['mode' => ''] , 'root' => ''], |
|
| 89 | 89 | |
| 90 | - ['name' => 'WebAuthn#startRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'GET' , 'root' => ''], |
|
| 91 | - ['name' => 'WebAuthn#finishRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'POST' , 'root' => ''], |
|
| 92 | - ['name' => 'WebAuthn#deleteRegistration', 'url' => '/settings/api/personal/webauthn/registration/{id}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 93 | - ] |
|
| 90 | + ['name' => 'WebAuthn#startRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'GET' , 'root' => ''], |
|
| 91 | + ['name' => 'WebAuthn#finishRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'POST' , 'root' => ''], |
|
| 92 | + ['name' => 'WebAuthn#deleteRegistration', 'url' => '/settings/api/personal/webauthn/registration/{id}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 93 | + ] |
|
| 94 | 94 | ]; |
@@ -36,59 +36,59 @@ |
||
| 36 | 36 | |
| 37 | 37 | return [ |
| 38 | 38 | 'resources' => [ |
| 39 | - 'AuthSettings' => ['url' => '/settings/personal/authtokens' , 'root' => ''], |
|
| 39 | + 'AuthSettings' => ['url' => '/settings/personal/authtokens', 'root' => ''], |
|
| 40 | 40 | ], |
| 41 | 41 | 'routes' => [ |
| 42 | - ['name' => 'AuthSettings#wipe', 'url' => '/settings/personal/authtokens/wipe/{id}', 'verb' => 'POST' , 'root' => ''], |
|
| 42 | + ['name' => 'AuthSettings#wipe', 'url' => '/settings/personal/authtokens/wipe/{id}', 'verb' => 'POST', 'root' => ''], |
|
| 43 | 43 | |
| 44 | - ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST' , 'root' => ''], |
|
| 45 | - ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST' , 'root' => ''], |
|
| 46 | - ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST' , 'root' => ''], |
|
| 47 | - ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST' , 'root' => ''], |
|
| 44 | + ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST', 'root' => ''], |
|
| 45 | + ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST', 'root' => ''], |
|
| 46 | + ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST', 'root' => ''], |
|
| 47 | + ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST', 'root' => ''], |
|
| 48 | 48 | |
| 49 | - ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET' , 'root' => ''], |
|
| 50 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET' , 'root' => ''], |
|
| 51 | - ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET' , 'root' => ''], |
|
| 52 | - ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 53 | - ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST' , 'root' => ''], |
|
| 54 | - ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST' , 'root' => ''], |
|
| 55 | - ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 56 | - ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST' , 'root' => ''], |
|
| 57 | - ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 58 | - ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET' , 'root' => ''], |
|
| 59 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => ''] , 'root' => ''], |
|
| 60 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => ''] , 'root' => ''], |
|
| 61 | - ['name' => 'AppSettings#force', 'url' => '/settings/apps/force', 'verb' => 'POST' , 'root' => ''], |
|
| 49 | + ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET', 'root' => ''], |
|
| 50 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET', 'root' => ''], |
|
| 51 | + ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET', 'root' => ''], |
|
| 52 | + ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'GET', 'root' => ''], |
|
| 53 | + ['name' => 'AppSettings#enableApp', 'url' => '/settings/apps/enable/{appId}', 'verb' => 'POST', 'root' => ''], |
|
| 54 | + ['name' => 'AppSettings#enableApps', 'url' => '/settings/apps/enable', 'verb' => 'POST', 'root' => ''], |
|
| 55 | + ['name' => 'AppSettings#disableApp', 'url' => '/settings/apps/disable/{appId}', 'verb' => 'GET', 'root' => ''], |
|
| 56 | + ['name' => 'AppSettings#disableApps', 'url' => '/settings/apps/disable', 'verb' => 'POST', 'root' => ''], |
|
| 57 | + ['name' => 'AppSettings#updateApp', 'url' => '/settings/apps/update/{appId}', 'verb' => 'GET', 'root' => ''], |
|
| 58 | + ['name' => 'AppSettings#uninstallApp', 'url' => '/settings/apps/uninstall/{appId}', 'verb' => 'GET', 'root' => ''], |
|
| 59 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}', 'verb' => 'GET', 'defaults' => ['category' => ''], 'root' => ''], |
|
| 60 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps/{category}/{id}', 'verb' => 'GET', 'defaults' => ['category' => '', 'id' => ''], 'root' => ''], |
|
| 61 | + ['name' => 'AppSettings#force', 'url' => '/settings/apps/force', 'verb' => 'POST', 'root' => ''], |
|
| 62 | 62 | |
| 63 | - ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST' , 'root' => ''], |
|
| 64 | - ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT' , 'root' => ''], |
|
| 65 | - ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT' , 'root' => ''], |
|
| 66 | - ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET' , 'root' => ''], |
|
| 67 | - ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET' , 'root' => ''], |
|
| 68 | - ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET', 'requirements' => ['group' => '.+'] , 'root' => ''], |
|
| 69 | - ['name' => 'Users#setPreference', 'url' => '/settings/users/preferences/{key}', 'verb' => 'POST' , 'root' => ''], |
|
| 70 | - ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST' , 'root' => ''], |
|
| 71 | - ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET' , 'root' => ''], |
|
| 72 | - ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET' , 'root' => ''], |
|
| 73 | - ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET' , 'root' => ''], |
|
| 74 | - ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET' , 'root' => ''], |
|
| 75 | - ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET' , 'root' => ''], |
|
| 76 | - ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST' , 'root' => ''], |
|
| 77 | - ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 78 | - ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST' , 'root' => ''], |
|
| 79 | - ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 80 | - ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info'] , 'root' => ''], |
|
| 81 | - ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server'] , 'root' => ''], |
|
| 82 | - ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET' , 'root' => ''], |
|
| 83 | - ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST' , 'root' => ''], |
|
| 84 | - ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST' , 'root' => ''], |
|
| 85 | - ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET' , 'root' => ''], |
|
| 86 | - ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT' , 'root' => ''], |
|
| 63 | + ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST', 'root' => ''], |
|
| 64 | + ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT', 'root' => ''], |
|
| 65 | + ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT', 'root' => ''], |
|
| 66 | + ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET', 'root' => ''], |
|
| 67 | + ['name' => 'Users#usersList', 'url' => '/settings/users', 'verb' => 'GET', 'root' => ''], |
|
| 68 | + ['name' => 'Users#usersListByGroup', 'url' => '/settings/users/{group}', 'verb' => 'GET', 'requirements' => ['group' => '.+'], 'root' => ''], |
|
| 69 | + ['name' => 'Users#setPreference', 'url' => '/settings/users/preferences/{key}', 'verb' => 'POST', 'root' => ''], |
|
| 70 | + ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST', 'root' => ''], |
|
| 71 | + ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET', 'root' => ''], |
|
| 72 | + ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET', 'root' => ''], |
|
| 73 | + ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET', 'root' => ''], |
|
| 74 | + ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET', 'root' => ''], |
|
| 75 | + ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET', 'root' => ''], |
|
| 76 | + ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST', 'root' => ''], |
|
| 77 | + ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE', 'root' => ''], |
|
| 78 | + ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST', 'root' => ''], |
|
| 79 | + ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE', 'root' => ''], |
|
| 80 | + ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info'], 'root' => ''], |
|
| 81 | + ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server'], 'root' => ''], |
|
| 82 | + ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'root' => ''], |
|
| 83 | + ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST', 'root' => ''], |
|
| 84 | + ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST', 'root' => ''], |
|
| 85 | + ['name' => 'TwoFactorSettings#index', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'GET', 'root' => ''], |
|
| 86 | + ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT', 'root' => ''], |
|
| 87 | 87 | |
| 88 | - ['name' => 'Help#help', 'url' => '/settings/help/{mode}', 'verb' => 'GET', 'defaults' => ['mode' => ''] , 'root' => ''], |
|
| 88 | + ['name' => 'Help#help', 'url' => '/settings/help/{mode}', 'verb' => 'GET', 'defaults' => ['mode' => ''], 'root' => ''], |
|
| 89 | 89 | |
| 90 | - ['name' => 'WebAuthn#startRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'GET' , 'root' => ''], |
|
| 91 | - ['name' => 'WebAuthn#finishRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'POST' , 'root' => ''], |
|
| 92 | - ['name' => 'WebAuthn#deleteRegistration', 'url' => '/settings/api/personal/webauthn/registration/{id}', 'verb' => 'DELETE' , 'root' => ''], |
|
| 90 | + ['name' => 'WebAuthn#startRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'GET', 'root' => ''], |
|
| 91 | + ['name' => 'WebAuthn#finishRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'POST', 'root' => ''], |
|
| 92 | + ['name' => 'WebAuthn#deleteRegistration', 'url' => '/settings/api/personal/webauthn/registration/{id}', 'verb' => 'DELETE', 'root' => ''], |
|
| 93 | 93 | ] |
| 94 | 94 | ]; |