diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2018-09-20 09:42:52 +0200 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2018-09-20 09:42:52 +0200 |
commit | 04972c611830d355dff97468564a941876aeeb3f (patch) | |
tree | 247e2d5fdcada8d9ba1d204962d7a4c47260382c /appinfo | |
parent | 4ee727060a397c68d5512e2b6c042f6dd825b733 (diff) |
OAuth2+test
Diffstat (limited to 'appinfo')
-rw-r--r-- | appinfo/app.php | 37 | ||||
-rw-r--r-- | appinfo/autoload.php | 38 | ||||
-rw-r--r-- | appinfo/database.xml | 113 | ||||
-rw-r--r-- | appinfo/info.xml | 49 | ||||
-rw-r--r-- | appinfo/routes.php | 29 |
5 files changed, 240 insertions, 26 deletions
diff --git a/appinfo/app.php b/appinfo/app.php new file mode 100644 index 00000000..bc36b6e8 --- /dev/null +++ b/appinfo/app.php @@ -0,0 +1,37 @@ +<?php +declare(strict_types=1); + + +/** + * Nextcloud - Social Support + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Maxence Lange <maxence@artificial-owl.com> + * @copyright 2018, Maxence Lange <maxence@artificial-owl.com> + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCA\Social\AppInfo; + +require_once __DIR__ . '/autoload.php'; +require_once(__DIR__ . '/../lib/autoload.php'); + +//$app = new Application(); +//$app->registerNavigation(); + diff --git a/appinfo/autoload.php b/appinfo/autoload.php new file mode 100644 index 00000000..586cecf3 --- /dev/null +++ b/appinfo/autoload.php @@ -0,0 +1,38 @@ +<?php +declare(strict_types=1); + + +/** + * Nextcloud - Social Support + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Maxence Lange <maxence@artificial-owl.com> + * @copyright 2018, Maxence Lange <maxence@artificial-owl.com> + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + + +namespace OCA\Social\AppInfo; + +$composerDir = __DIR__ . '/../vendor/'; + +if (is_dir($composerDir) && file_exists($composerDir . 'autoload.php')) { + require_once $composerDir . 'autoload.php'; +} + diff --git a/appinfo/database.xml b/appinfo/database.xml new file mode 100644 index 00000000..4ee64cb4 --- /dev/null +++ b/appinfo/database.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<database> + <name>*dbname*</name> + <create>true</create> + <overwrite>false</overwrite> + <charset>utf8</charset> + + <table> + <name>*dbprefix*social_services</name> + <declaration> + <field> + <name>id</name> + <type>integer</type> + <length>7</length> + <unsigned>true</unsigned> + <notnull>true</notnull> + <autoincrement>true</autoincrement> + <primary>true</primary> + </field> + + <field> + <name>type</name> + <type>text</type> + <length>15</length> + </field> + + <field> + <name>address</name> + <type>text</type> + <length>128</length> + </field> + + <field> + <name>config</name> + <type>text</type> + <length>3000</length> + </field> + + <field> + <name>status</name> + <type>integer</type> + <length>1</length> + </field> + + <field> + <name>creation</name> + <type>timestamp</type> + </field> + + </declaration> + </table> + + <table> + <name>*dbprefix*social_accounts</name> + <declaration> + + <field> + <name>id</name> + <type>integer</type> + <length>7</length> + <unsigned>true</unsigned> + <notnull>true</notnull> + <autoincrement>true</autoincrement> + <primary>true</primary> + </field> + + <field> + <name>service_id</name> + <type>integer</type> + <length>7</length> + <notnull>true</notnull> + </field> + + <field> + <name>user_id</name> + <type>text</type> + <length>63</length> + </field> + + <field> + <name>account</name> + <type>text</type> + <length>127</length> + </field> + + <field> + <name>status</name> + <type>integer</type> + <length>1</length> + </field> + + <field> + <name>auth</name> + <type>text</type> + <length>2000</length> + </field> + + <field> + <name>config</name> + <type>text</type> + <length>2000</length> + </field> + + <field> + <name>creation</name> + <type>timestamp</type> + </field> + + </declaration> + </table> + +</database> + diff --git a/appinfo/info.xml b/appinfo/info.xml index 3e339505..e232b247 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -1,24 +1,29 @@ <?xml version="1.0"?> -<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd"> - <id>social</id> - <name>Social</name> - <summary>🎉 Nextcloud becomes part of the federated social networks!</summary> - <description><![CDATA[test]]></description> - <version>0.0.1</version> - <licence>agpl</licence> - <author mail="jus@bitgrid.net" >Julius Härtl</author> - <author mail="hey@jancborchardt.net" homepage="https://jancborchardt.net">Jan-Christoph Borchardt</author> - <namespace>Social</namespace> - <category>social</category> - <bugs>https://github.com/nextcloud/social</bugs> - <dependencies> - <nextcloud min-version="14" max-version="15"/> - </dependencies> - <navigations> - <navigation> - <name>Social</name> - <route>social.page.index</route> - </navigation> - </navigations> +<info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd"> + <id>social</id> + <name>Social</name> + <summary>🎉 Nextcloud becomes part of the federated social networks!</summary> + <description><![CDATA[test]]></description> + <version>0.0.9</version> + <licence>agpl</licence> + <author mail="maxence@artificial-owl.com">Maxence Lange</author> + <author mail="jus@bitgrid.net">Julius Härtl</author> + <author mail="hey@jancborchardt.net" homepage="https://jancborchardt.net">Jan-Christoph Borchardt</author> + <namespace>Social</namespace> + <category>social</category> + <website>https://github.com/nextcloud/social</website> + <repository type="git">https://github.com/nextcloud/social.git</repository> + <bugs>https://github.com/nextcloud/social/issues</bugs> + <screenshot>https://raw.githubusercontent.com/nextcloud/social/master/screenshots/screenshot.png</screenshot> + <dependencies> + <nextcloud min-version="14" max-version="15"/> + </dependencies> + <navigations> + <navigation> + <name>Social</name> + <route>social.Navigation.navigate</route> + </navigation> + </navigations> + </info> diff --git a/appinfo/routes.php b/appinfo/routes.php index d463e957..e0f7a657 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -8,8 +8,29 @@ * it's instantiated in there */ return [ - 'routes' => [ - ['name' => 'page#index', 'url' => '/', 'verb' => 'GET'], - ['name' => 'page#mail', 'url' => '/mail', 'verb' => 'GET'], - ] + 'routes' => [ + ['name' => 'Navigation#navigate', 'url' => '/', 'verb' => 'GET'], + + [ + 'name' => 'ServiceAccounts#getAvailableAccounts', 'url' => '/user/accounts', + 'verb' => 'GET' + ], + [ + 'name' => 'ServiceAccounts#create', 'url' => '/user/account', + 'verb' => 'POST' + ], + [ + 'name' => 'ActivityStreams#test', 'url' => '/user/account/{accountId}/test', + 'verb' => 'GET' + ], + +// [ +// 'name' => 'OAuth2#getAuthUrl', 'url' => '/client/oauth2/auth/{serviceId}/', +// 'verb' => 'GET' +// ], + [ + 'name' => 'OAuth2#setCode', 'url' => '/client/oauth2/redirect/{serviceId}/', + 'verb' => 'GET' + ] + ] ]; |