Use router parameters in Diaspora\Receive
This commit is contained in:
parent
8af86af3d9
commit
02e08d5fbc
|
@ -51,21 +51,10 @@ class Receive extends BaseModule
|
||||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
|
throw new HTTPException\ForbiddenException(DI::l10n()->t('Access denied.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$args = DI::args();
|
if ($parameters['type'] === 'public') {
|
||||||
|
self::receivePublic();
|
||||||
$type = $args->get(1);
|
} else if ($parameters['type'] === 'users') {
|
||||||
|
self::receiveUser($parameters['guid']);
|
||||||
switch ($type) {
|
|
||||||
case 'public':
|
|
||||||
self::receivePublic();
|
|
||||||
break;
|
|
||||||
case 'users':
|
|
||||||
self::receiveUser($args->get(2));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
self::$logger->info('Wrong call.');
|
|
||||||
throw new HTTPException\BadRequestException('wrong call.');
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -409,8 +409,8 @@ return [
|
||||||
],
|
],
|
||||||
|
|
||||||
'/receive' => [
|
'/receive' => [
|
||||||
'/public' => [Module\Diaspora\Receive::class, [R::POST]],
|
'/{type:public}' => [Module\Diaspora\Receive::class, [ R::POST]],
|
||||||
'/users/{guid}' => [Module\Diaspora\Receive::class, [R::POST]],
|
'/{type:users}/{guid}' => [Module\Diaspora\Receive::class, [ R::POST]],
|
||||||
],
|
],
|
||||||
|
|
||||||
'/settings' => [
|
'/settings' => [
|
||||||
|
|
Loading…
Reference in a new issue