diff --git a/src/Wallabag/CoreBundle/Controller/DeveloperController.php b/src/Wallabag/CoreBundle/Controller/DeveloperController.php new file mode 100644 index 000000000..3cb868814 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/DeveloperController.php @@ -0,0 +1,38 @@ +render('WallabagCoreBundle:Developer:index.html.twig'); + } + + /** + * @param Request $request + * + * @Route("/developer/client/create", name="create_client") + */ + public function createClientAction(Request $request) + { + $clientManager = $this->container->get('fos_oauth_server.client_manager.default'); + $client = $clientManager->createClient(); + $client->setRedirectUris(array('http://www.example.com')); + $client->setAllowedGrantTypes(array('token', 'authorization_code')); + $clientManager->updateClient($client); + + return $this->render('WallabagCoreBundle:Developer:client.html.twig', array( + 'client_id' => $client->getPublicId(), + )); + } +} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig new file mode 100644 index 000000000..edebc7ee7 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig @@ -0,0 +1,9 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}New client{% endtrans %}{% endblock %} + +{% block content %} + + Client ID: {{ client_id }} + +{% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig new file mode 100644 index 000000000..9e06005f4 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig @@ -0,0 +1,9 @@ +{% extends "WallabagCoreBundle::layout.html.twig" %} + +{% block title %}{% trans %}Developer{% endtrans %}{% endblock %} + +{% block content %} + + Create a new client + +{% endblock %} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index d7bfa7aed..46aab5dca 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig @@ -116,6 +116,7 @@

{% trans %}powered by{% endtrans %} wallabag

{% trans %}About{% endtrans %} + {% trans %}Developer{% endtrans %}