From 3582f649b696ef5413e77ce1e3723d2ec36a4927 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 16 Feb 2017 16:55:31 +0200 Subject: [PATCH] registration --- app/library/App/Controllers/UserController.php | 4 ++++ app/library/App/Resources/UserResource.php | 5 +++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/app/library/App/Controllers/UserController.php b/app/library/App/Controllers/UserController.php index d388366..ee73588 100755 --- a/app/library/App/Controllers/UserController.php +++ b/app/library/App/Controllers/UserController.php @@ -33,6 +33,10 @@ class UserController extends CrudResourceController return $this->createArrayResponse($response, 'data'); } + public function register() { + parent::create(); + } + public function whitelist() { return [ diff --git a/app/library/App/Resources/UserResource.php b/app/library/App/Resources/UserResource.php index 2779e9e..75db1da 100755 --- a/app/library/App/Resources/UserResource.php +++ b/app/library/App/Resources/UserResource.php @@ -39,6 +39,11 @@ class UserResource extends ApiResource { 'token' => 'co126bbm40wqp41i3bo7pj1gfsvt9lp6', 'expires' => 1451139067 ]) + ) + ->endpoint(ApiEndpoint::post('/register', 'register') + ->allow(AclRoles::UNAUTHORIZED) + ->deny(AclRoles::AUTHORIZED) + ->description('Register new user') ); } } \ No newline at end of file -- libgit2 0.21.4