]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #10237 from annando/oauth-flow
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 13 May 2021 15:27:30 +0000 (11:27 -0400)
committerGitHub <noreply@github.com>
Thu, 13 May 2021 15:27:30 +0000 (11:27 -0400)
Refine OAuth flow

15 files changed:
database.sql
doc/API-Mastodon.md
mod/settings.php
src/Factory/Api/Mastodon/Card.php
src/Model/Item.php
src/Module/Api/Mastodon/Apps.php
src/Module/BaseApi.php
src/Module/OAuth/Authorize.php
src/Module/OAuth/Token.php
src/Object/Api/Mastodon/Token.php [new file with mode: 0644]
static/dbstructure.config.php
static/dbview.config.php
view/lang/C/messages.po
view/templates/settings/oauth.tpl
view/theme/frio/templates/settings/oauth.tpl

index bbcd479bc9a24c8301a29f4fc77e86d82e5ac134..0dcf9afe80b0b782d77979de8d908038297ec3a9 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2021.06-dev (Siberian Iris)
--- DB_UPDATE_VERSION 1416
+-- DB_UPDATE_VERSION 1417
 -- ------------------------------------------
 
 
@@ -375,6 +375,9 @@ CREATE TABLE IF NOT EXISTS `application` (
        `redirect_uri` varchar(255) NOT NULL COMMENT '',
        `website` varchar(255) COMMENT '',
        `scopes` varchar(255) COMMENT '',
+       `read` boolean COMMENT 'Read scope',
+       `write` boolean COMMENT 'Write scope',
+       `follow` boolean COMMENT 'Follow scope',
         PRIMARY KEY(`id`),
         UNIQUE INDEX `client_id` (`client_id`)
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='OAuth application';
@@ -387,7 +390,11 @@ CREATE TABLE IF NOT EXISTS `application-token` (
        `uid` mediumint unsigned NOT NULL COMMENT 'Owner User id',
        `code` varchar(64) NOT NULL COMMENT '',
        `access_token` varchar(64) NOT NULL COMMENT '',
-       `created_at` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'creation time',
+       `created_at` datetime NOT NULL COMMENT 'creation time',
+       `scopes` varchar(255) COMMENT '',
+       `read` boolean COMMENT 'Read scope',
+       `write` boolean COMMENT 'Write scope',
+       `follow` boolean COMMENT 'Follow scope',
         PRIMARY KEY(`application-id`,`uid`),
         INDEX `uid_id` (`uid`,`application-id`),
        FOREIGN KEY (`application-id`) REFERENCES `application` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
@@ -1500,6 +1507,28 @@ CREATE TABLE IF NOT EXISTS `workerqueue` (
         INDEX `done_pid_priority_created` (`done`,`pid`,`priority`,`created`)
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Background tasks queue entries';
 
+--
+-- VIEW application-view
+--
+DROP VIEW IF EXISTS `application-view`;
+CREATE VIEW `application-view` AS SELECT 
+       `application`.`id` AS `id`,
+       `application-token`.`uid` AS `uid`,
+       `application`.`name` AS `name`,
+       `application`.`redirect_uri` AS `redirect_uri`,
+       `application`.`website` AS `website`,
+       `application`.`client_id` AS `client_id`,
+       `application`.`client_secret` AS `client_secret`,
+       `application-token`.`code` AS `code`,
+       `application-token`.`access_token` AS `access_token`,
+       `application-token`.`created_at` AS `created_at`,
+       `application-token`.`scopes` AS `scopes`,
+       `application-token`.`read` AS `read`,
+       `application-token`.`write` AS `write`,
+       `application-token`.`follow` AS `follow`
+       FROM `application-token`
+                       INNER JOIN `application` ON `application-token`.`application-id` = `application`.`id`;
+
 --
 -- VIEW post-user-view
 --
index 7f5b55797aeae5f02ab088601f64f7b55dbd4937..18af62be68713f1576a9ff6c19e3044f34a8b038 100644 (file)
@@ -9,6 +9,21 @@ Friendica provides the following endpoints defined in [the official Mastodon API
 
 Authentication is the same as described in [Using the APIs](help/api#Authentication).
 
+## Clients
+
+Supported mobile apps:
+
+- Tusky
+- Husky
+- twitlatte
+
+Unsupported mobile apps:
+
+- [Subway Tooter](https://github.com/tateisu/SubwayTooter) Uses the wrong grant_type when requesting a token, possibly a problem in the server type detection of the app. See issue https://github.com/tateisu/SubwayTooter/issues/156
+- [Mammut](https://github.com/jamiesanson/Mammut) States that the instance doesn't exist. Most likely an issue in the vitality check of the app, see issue https://github.com/jamiesanson/Mammut/issues/19
+- [AndStatus](https://github.com/andstatus/andstatus) Doesn't provide all data at token request, see issue https://github.com/andstatus/andstatus/issues/537
+- [Fedilab](https://framagit.org/tom79/fedilab) Automatically uses the legacy API, see issue: https://framagit.org/tom79/fedilab/-/issues/520
+
 ## Entities
 
 These endpoints use the [Mastodon API entities](https://docs.joinmastodon.org/entities/).
index c8dbcb9105bf4443d67d1aa711f8159af46909d5..3a3f0b65dccf974004433a96c4a0dff60a1e1555 100644 (file)
@@ -500,77 +500,26 @@ function settings_content(App $a)
        }
 
        if (($a->argc > 1) && ($a->argv[1] === 'oauth')) {
-               if (($a->argc > 2) && ($a->argv[2] === 'add')) {
-                       $tpl = Renderer::getMarkupTemplate('settings/oauth_edit.tpl');
-                       $o .= Renderer::replaceMacros($tpl, [
-                               '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
-                               '$title'        => DI::l10n()->t('Add application'),
-                               '$submit'       => DI::l10n()->t('Save Settings'),
-                               '$cancel'       => DI::l10n()->t('Cancel'),
-                               '$name'         => ['name', DI::l10n()->t('Name'), '', ''],
-                               '$key'          => ['key', DI::l10n()->t('Consumer Key'), '', ''],
-                               '$secret'       => ['secret', DI::l10n()->t('Consumer Secret'), '', ''],
-                               '$redirect'     => ['redirect', DI::l10n()->t('Redirect'), '', ''],
-                               '$icon'         => ['icon', DI::l10n()->t('Icon url'), '', ''],
-                       ]);
-                       return $o;
-               }
-
-               if (($a->argc > 3) && ($a->argv[2] === 'edit')) {
-                       $r = q("SELECT * FROM clients WHERE client_id='%s' AND uid=%d",
-                                       DBA::escape($a->argv[3]),
-                                       local_user());
-
-                       if (!DBA::isResult($r)) {
-                               notice(DI::l10n()->t("You can't edit this application."));
-                               return;
-                       }
-                       $app = $r[0];
-
-                       $tpl = Renderer::getMarkupTemplate('settings/oauth_edit.tpl');
-                       $o .= Renderer::replaceMacros($tpl, [
-                               '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
-                               '$title'        => DI::l10n()->t('Add application'),
-                               '$submit'       => DI::l10n()->t('Update'),
-                               '$cancel'       => DI::l10n()->t('Cancel'),
-                               '$name'         => ['name', DI::l10n()->t('Name'), $app['name'] , ''],
-                               '$key'          => ['key', DI::l10n()->t('Consumer Key'), $app['client_id'], ''],
-                               '$secret'       => ['secret', DI::l10n()->t('Consumer Secret'), $app['pw'], ''],
-                               '$redirect'     => ['redirect', DI::l10n()->t('Redirect'), $app['redirect_uri'], ''],
-                               '$icon'         => ['icon', DI::l10n()->t('Icon url'), $app['icon'], ''],
-                       ]);
-                       return $o;
-               }
-
                if (($a->argc > 3) && ($a->argv[2] === 'delete')) {
                        BaseModule::checkFormSecurityTokenRedirectOnError('/settings/oauth', 'settings_oauth', 't');
 
-                       DBA::delete('clients', ['client_id' => $a->argv[3], 'uid' => local_user()]);
+                       DBA::delete('application-token', ['application-id' => $a->argv[3], 'uid' => local_user()]);
                        DI::baseUrl()->redirect('settings/oauth/', true);
                        return;
                }
 
-               /// @TODO validate result with DBA::isResult()
-               $r = q("SELECT clients.*, tokens.id as oauth_token, (clients.uid=%d) AS my
-                               FROM clients
-                               LEFT JOIN tokens ON clients.client_id=tokens.client_id
-                               WHERE clients.uid IN (%d, 0)",
-                               local_user(),
-                               local_user());
-
+               $applications = DBA::selectToArray('application-view', ['id', 'uid', 'name', 'website', 'scopes', 'created_at'], ['uid' => local_user()]);
 
                $tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("settings_oauth"),
-                       '$baseurl'      => DI::baseUrl()->get(true),
-                       '$title'        => DI::l10n()->t('Connected Apps'),
-                       '$add'          => DI::l10n()->t('Add application'),
-                       '$edit'         => DI::l10n()->t('Edit'),
-                       '$delete'               => DI::l10n()->t('Delete'),
-                       '$consumerkey' => DI::l10n()->t('Client key starts with'),
-                       '$noname'       => DI::l10n()->t('No name'),
-                       '$remove'       => DI::l10n()->t('Remove authorization'),
-                       '$apps'         => $r,
+                       '$baseurl'             => DI::baseUrl()->get(true),
+                       '$title'               => DI::l10n()->t('Connected Apps'),
+                       '$name'                => DI::l10n()->t('Name'),
+                       '$website'             => DI::l10n()->t('Home Page'),
+                       '$created_at'          => DI::l10n()->t('Created'),
+                       '$delete'              => DI::l10n()->t('Remove authorization'),
+                       '$apps'                => $applications,
                ]);
                return $o;
        }
index 1505fa85292cda475d805e1c5b529608ff69950f..f7512b3903275d3ec26c813ed8718efa50236a10 100644 (file)
@@ -37,7 +37,7 @@ class Card extends BaseFactory
         */
        public function createFromUriId(int $uriId)
        {
-               $item = Post::selectFirst(['nody'], ['uri-id' => $uriId]);
+               $item = Post::selectFirst(['body'], ['uri-id' => $uriId]);
                if (!empty($item['body'])) {
                        $data = BBCode::getAttachmentData($item['body']);
                } else {
index 2ce05589de4b655ca5295cb7d225178c5b0c27c2..c57e6799b0894072df35e990e939e9e67a023e01 100644 (file)
@@ -2914,11 +2914,11 @@ class Item
                                $data['description'] = '';
                        }
 
-                       if (!empty($data['author_name']) && !empty($data['provider_name'])) {
+                       if (($data['author_name'] ?? '') == ($data['provider_name'] ?? '')) {
                                $data['author_name'] = '';
                        }
 
-                       if (!empty($data['author_url']) && !empty($data['provider_url'])) {
+                       if (($data['author_url'] ?? '') == ($data['provider_url'] ?? '')) {
                                $data['author_url'] = '';
                        }
                } elseif (preg_match("/.*(\[attachment.*?\].*?\[\/attachment\]).*/ism", $body, $match)) {
index 7b13b170180913fc423cbb791be086b2ead21308..8205691dca47c9c0d133249e6237d0d19a3ab5f1 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Module\BaseApi;
+use Friendica\Util\Network;
 
 /**
  * Apps class to register new OAuth clients
@@ -37,9 +38,20 @@ class Apps extends BaseApi
         */
        public static function post(array $parameters = [])
        {
+               // Workaround for AndStatus, see issue https://github.com/andstatus/andstatus/issues/538
+               if (empty($_REQUEST['client_name']) || empty($_REQUEST['redirect_uris'])) {
+                       $postdata = Network::postdata();
+                       if (!empty($postdata)) {
+                               $_REQUEST = json_decode($postdata, true);
+                               if (empty($_REQUEST)) {
+                                       DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Missing parameters'));
+                               }
+                       }
+               }
+
                $name     = $_REQUEST['client_name'] ?? '';
                $redirect = $_REQUEST['redirect_uris'] ?? '';
-               $scopes   = $_REQUEST['scopes'] ?? '';
+               $scopes   = $_REQUEST['scopes'] ?? 'read';
                $website  = $_REQUEST['website'] ?? '';
 
                if (empty($name) || empty($redirect)) {
@@ -55,6 +67,10 @@ class Apps extends BaseApi
                        $fields['scopes'] = $scopes;
                }
 
+               $fields['read']   = (stripos($scopes, 'read') !== false);
+               $fields['write']  = (stripos($scopes, 'write') !== false);
+               $fields['follow'] = (stripos($scopes, 'follow') !== false);
+
                if (!empty($website)) {
                        $fields['website'] = $website;
                }
index b4f228a6ee8aa8c895233cf6d8a0971e5b0ee9ea..a53c008c62cf7e9b57e85f4208dd30f6158e9e28 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Module;
 
+use Exception;
 use Friendica\BaseModule;
 use Friendica\Core\Logger;
 use Friendica\Core\System;
@@ -206,19 +207,13 @@ class BaseApi extends BaseModule
        /**
         * Get the application record via the proved request header fields
         *
+        * @param string $client_id
+        * @param string $client_secret
+        * @param string $redirect_uri
         * @return array application record
         */
-       public static function getApplication()
+       public static function getApplication(string $client_id, string $client_secret, string $redirect_uri)
        {
-               $redirect_uri  = $_REQUEST['redirect_uri'] ?? '';
-               $client_id     = $_REQUEST['client_id'] ?? '';
-               $client_secret = $_REQUEST['client_secret'] ?? '';
-
-               if ((empty($redirect_uri) && empty($client_secret)) || empty($client_id)) {
-                       Logger::warning('Incomplete request', ['request' => $_REQUEST]);
-                       return [];
-               }
-
                $condition = ['client_id' => $client_id];
                if (!empty($client_secret)) {
                        $condition['client_secret'] = $client_secret;
@@ -262,16 +257,19 @@ class BaseApi extends BaseModule
        /**
         * Create and fetch an token for the application and user
         *
-        * @param array $application
+        * @param array   $application
         * @param integer $uid
+        * @param string  $scope
         * @return array application record
         */
-       public static function createTokenForUser(array $application, int $uid)
+       public static function createTokenForUser(array $application, int $uid, string $scope)
        {
                $code         = bin2hex(random_bytes(32));
                $access_token = bin2hex(random_bytes(32));
 
-               $fields = ['application-id' => $application['id'], 'uid' => $uid, 'code' => $code, 'access_token' => $access_token, 'created_at' => DateTimeFormat::utcNow(DateTimeFormat::MYSQL)];
+               $fields = ['application-id' => $application['id'], 'uid' => $uid, 'code' => $code, 'access_token' => $access_token, 'scopes' => $scope,
+                       'read' => (stripos($scope, 'read') !== false), 'write' => (stripos($scope, 'write') !== false),
+                       'follow' => (stripos($scope, 'follow') !== false), 'created_at' => DateTimeFormat::utcNow(DateTimeFormat::MYSQL)];
                if (!DBA::insert('application-token', $fields, Database::INSERT_UPDATE)) {
                        return [];
                }
index 7d9f67ad356a7693d6151858d3d00be6250b0495..57efe70c6387409bf16c780a333321c7351c4ec2 100644 (file)
@@ -27,6 +27,7 @@ use Friendica\Module\BaseApi;
 
 /**
  * @see https://docs.joinmastodon.org/spec/oauth/
+ * @see https://aaronparecki.com/oauth-2-simplified/
  */
 class Authorize extends BaseApi
 {
@@ -37,16 +38,29 @@ class Authorize extends BaseApi
        public static function rawContent(array $parameters = [])
        {
                $response_type = $_REQUEST['response_type'] ?? '';
+               $client_id     = $_REQUEST['client_id'] ?? '';
+               $client_secret = $_REQUEST['client_secret'] ?? ''; // Isn't normally provided. We will use it if present.
+               $redirect_uri  = $_REQUEST['redirect_uri'] ?? '';
+               $scope         = $_REQUEST['scope'] ?? 'read';
+               $state         = $_REQUEST['state'] ?? '';
+
                if ($response_type != 'code') {
-                       Logger::warning('Wrong or missing response type', ['response_type' => $response_type]);
-                       DI::mstdnError()->UnprocessableEntity();
+                       Logger::warning('Unsupported or missing response type', ['request' => $_REQUEST]);
+                       DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Unsupported or missing response type'));
                }
 
-               $application = self::getApplication();
+               if (empty($client_id) || empty($redirect_uri)) {
+                       Logger::warning('Incomplete request data', ['request' => $_REQUEST]);
+                       DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Incomplete request data'));
+               }
+
+               $application = self::getApplication($client_id, $client_secret, $redirect_uri);
                if (empty($application)) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
+               // @todo Compare the application scope and requested scope
+
                $request = $_REQUEST;
                unset($request['pagename']);
                $redirect = 'oauth/authorize?' . http_build_query($request);
@@ -66,11 +80,11 @@ class Authorize extends BaseApi
 
                DI::session()->remove('oauth_acknowledge');
 
-               $token = self::createTokenForUser($application, $uid);
+               $token = self::createTokenForUser($application, $uid, $scope);
                if (!$token) {
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               DI::app()->redirect($application['redirect_uri'] . '?code=' . $token['code']);
+               DI::app()->redirect($application['redirect_uri'] . '?' . http_build_query(['code' => $token['code'], 'state' => $state]));
        }
 }
index 17f2e2b8200aa3f24843818f2f68b717a048c6e1..c3aaac6d1e329e1cf8c80a4f64fb3ba70a665878 100644 (file)
@@ -29,39 +29,44 @@ use Friendica\Module\BaseApi;
 
 /**
  * @see https://docs.joinmastodon.org/spec/oauth/
+ * @see https://aaronparecki.com/oauth-2-simplified/
  */
 class Token extends BaseApi
 {
        public static function post(array $parameters = [])
        {
-               $client_secret = $_REQUEST['client_secret'] ?? '';
-               $code          = $_REQUEST['code'] ?? '';
                $grant_type    = $_REQUEST['grant_type'] ?? '';
+               $code          = $_REQUEST['code'] ?? '';
+               $redirect_uri  = $_REQUEST['redirect_uri'] ?? '';
+               $client_id     = $_REQUEST['client_id'] ?? '';
+               $client_secret = $_REQUEST['client_secret'] ?? '';
 
                if ($grant_type != 'authorization_code') {
                        Logger::warning('Unsupported or missing grant type', ['request' => $_REQUEST]);
                        DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Unsupported or missing grant type'));
                }
 
-               $application = self::getApplication();
-               if (empty($application)) {
-                       DI::mstdnError()->UnprocessableEntity();
+               if (empty($client_id) || empty($client_secret) || empty($redirect_uri)) {
+                       Logger::warning('Incomplete request data', ['request' => $_REQUEST]);
+                       DI::mstdnError()->UnprocessableEntity(DI::l10n()->t('Incomplete request data'));
                }
 
-               if ($application['client_secret'] != $client_secret) {
-                       Logger::warning('Wrong client secret', $client_secret);
-                       DI::mstdnError()->Unauthorized();
+               $application = self::getApplication($client_id, $client_secret, $redirect_uri);
+               if (empty($application)) {
+                       DI::mstdnError()->UnprocessableEntity();
                }
 
-               $condition = ['application-id' => $application['id'], 'code' => $code];
+               // For security reasons only allow freshly created tokens
+               $condition = ["`application-id` = ? AND `code` = ? AND `created_at` > UTC_TIMESTAMP() - INTERVAL ? MINUTE", $application['id'], $code, 5];
 
                $token = DBA::selectFirst('application-token', ['access_token', 'created_at'], $condition);
                if (!DBA::isResult($token)) {
-                       Logger::warning('Token not found', $condition);
+                       Logger::warning('Token not found or outdated', $condition);
                        DI::mstdnError()->Unauthorized();
                }
 
-               // @todo Use entity class
-               System::jsonExit(['access_token' => $token['access_token'], 'token_type' => 'Bearer', 'scope' => $application['scopes'], 'created_at' => $token['created_at']]);
+               $object = new \Friendica\Object\Api\Mastodon\Token($token['access_token'], 'Bearer', $application['scopes'], $token['created_at']);
+
+               System::jsonExit($object->toArray());
        }
 }
diff --git a/src/Object/Api/Mastodon/Token.php b/src/Object/Api/Mastodon/Token.php
new file mode 100644 (file)
index 0000000..1c78d69
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2021, the Friendica project
+ *
+ * @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 <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Object\Api\Mastodon;
+
+use Friendica\BaseDataTransferObject;
+use Friendica\Util\DateTimeFormat;
+
+/**
+ * Class Error
+ *
+ * @see https://docs.joinmastodon.org/entities/error
+ */
+class Token extends BaseDataTransferObject
+{
+       /** @var string */
+       protected $access_token;
+       /** @var string */
+       protected $token_type;
+       /** @var string */
+       protected $scope;
+       /** @var string (Datetime) */
+       protected $created_at;
+
+       /**
+        * Creates a token record
+        *
+        * @param string $access_token
+        * @param string $token_type
+        * @param string $scope
+        * @param string $created_at
+        */
+       public function __construct(string $access_token, string $token_type, string $scope, string $created_at)
+       {
+               $this->access_token = $access_token;
+               $this->token_type   = $token_type;
+               $this->scope        = $scope;
+               $this->created_at   = DateTimeFormat::utc($created_at, DateTimeFormat::ATOM);
+       }
+}
index 41515681e4a17a9050d624f13001a885f18e82a7..a074ef0b82cf35ebc0a6fbe94a979fae40409282 100644 (file)
@@ -55,7 +55,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1416);
+       define('DB_UPDATE_VERSION', 1417);
 }
 
 return [
@@ -436,6 +436,9 @@ return [
                        "redirect_uri" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
                        "website" => ["type" => "varchar(255)", "comment" => ""],
                        "scopes" => ["type" => "varchar(255)", "comment" => ""],
+                       "read" => ["type" => "boolean", "comment" => "Read scope"],
+                       "write" => ["type" => "boolean", "comment" => "Write scope"],
+                       "follow" => ["type" => "boolean", "comment" => "Follow scope"],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
@@ -449,7 +452,11 @@ return [
                        "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
                        "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
                        "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
-                       "created_at" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
+                       "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"],
+                       "scopes" => ["type" => "varchar(255)", "comment" => ""],
+                       "read" => ["type" => "boolean", "comment" => "Read scope"],
+                       "write" => ["type" => "boolean", "comment" => "Write scope"],
+                       "follow" => ["type" => "boolean", "comment" => "Follow scope"],
                ],
                "indexes" => [
                        "PRIMARY" => ["application-id", "uid"],
index 94b81411b4f8707e4746674bf76e229879cec40f..324f7f92675c6ac6512f60cd6b70011dc3a2b18b 100644 (file)
  */
 
  return [
+       "application-view" => [
+               "fields" => [
+                       "id" => ["application", "id"],
+                       "uid" => ["application-token", "uid"],
+                       "name" => ["application", "name"],
+                       "redirect_uri" => ["application", "redirect_uri"],
+                       "website" => ["application", "website"],
+                       "client_id" => ["application", "client_id"],
+                       "client_secret" => ["application", "client_secret"],
+                       "code" => ["application-token", "code"],
+                       "access_token" => ["application-token", "access_token"],
+                       "created_at" => ["application-token", "created_at"],
+                       "scopes" => ["application-token", "scopes"],
+                       "read" => ["application-token", "read"],
+                       "write" => ["application-token", "write"],
+                       "follow" => ["application-token", "follow"],
+               ],
+               "query" => "FROM `application-token`
+                       INNER JOIN `application` ON `application-token`.`application-id` = `application`.`id`"
+       ],
        "post-user-view" => [
                "fields" => [
                        "id" => ["post-user", "id"],
index c79794ab3d093474d6305c3b8915b9b5040feffd..e6e0e55db14cf51cf97d38b6a6118be2478bee84 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 2021.06-dev\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-05-13 14:29+0200\n"
+"POT-Creation-Date: 2021-05-13 15:15+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -75,10 +75,10 @@ msgstr ""
 msgid "Select"
 msgstr ""
 
-#: include/conversation.php:565 mod/photos.php:1471 mod/settings.php:569
-#: mod/settings.php:711 src/Module/Admin/Users/Active.php:139
-#: src/Module/Admin/Users/Blocked.php:140 src/Module/Admin/Users/Index.php:153
-#: src/Module/Contact.php:894 src/Module/Contact.php:1198
+#: include/conversation.php:565 mod/photos.php:1471 mod/settings.php:660
+#: src/Module/Admin/Users/Active.php:139 src/Module/Admin/Users/Blocked.php:140
+#: src/Module/Admin/Users/Index.php:153 src/Module/Contact.php:894
+#: src/Module/Contact.php:1198
 msgid "Delete"
 msgstr ""
 
@@ -478,9 +478,9 @@ msgstr ""
 
 #: include/conversation.php:1243 mod/dfrn_request.php:642 mod/editpost.php:128
 #: mod/fbrowser.php:105 mod/fbrowser.php:134 mod/follow.php:152
-#: mod/photos.php:1037 mod/photos.php:1143 mod/settings.php:509
-#: mod/settings.php:535 mod/tagrm.php:37 mod/tagrm.php:127 mod/unfollow.php:100
-#: src/Module/Contact.php:467 src/Module/RemoteFollow.php:110
+#: mod/photos.php:1037 mod/photos.php:1143 mod/tagrm.php:37 mod/tagrm.php:127
+#: mod/unfollow.php:100 src/Module/Contact.php:467
+#: src/Module/RemoteFollow.php:110
 msgid "Cancel"
 msgstr ""
 
@@ -833,10 +833,10 @@ msgstr ""
 #: mod/unfollow.php:82 mod/wall_attach.php:78 mod/wall_attach.php:81
 #: mod/wall_upload.php:99 mod/wall_upload.php:102 mod/wallmessage.php:35
 #: mod/wallmessage.php:59 mod/wallmessage.php:96 mod/wallmessage.php:120
-#: src/Module/Attach.php:56 src/Module/BaseApi.php:64 src/Module/BaseApi.php:70
-#: src/Module/BaseApi.php:77 src/Module/BaseApi.php:83
-#: src/Module/BaseApi.php:90 src/Module/BaseApi.php:96
-#: src/Module/BaseApi.php:103 src/Module/BaseApi.php:109
+#: src/Module/Attach.php:56 src/Module/BaseApi.php:65 src/Module/BaseApi.php:71
+#: src/Module/BaseApi.php:78 src/Module/BaseApi.php:84
+#: src/Module/BaseApi.php:91 src/Module/BaseApi.php:97
+#: src/Module/BaseApi.php:104 src/Module/BaseApi.php:110
 #: src/Module/BaseNotifications.php:88 src/Module/Contact.php:385
 #: src/Module/Contact/Advanced.php:43 src/Module/Delegation.php:118
 #: src/Module/FollowConfirm.php:16 src/Module/FriendSuggest.php:44
@@ -2079,7 +2079,7 @@ msgstr[1] ""
 msgid "Missing some important data!"
 msgstr ""
 
-#: mod/settings.php:92 mod/settings.php:534 src/Module/Contact.php:890
+#: mod/settings.php:92 src/Module/Contact.php:890
 msgid "Update"
 msgstr ""
 
@@ -2147,21 +2147,11 @@ msgstr ""
 msgid "Settings were not updated."
 msgstr ""
 
-#: mod/settings.php:507 mod/settings.php:533 mod/settings.php:567
-msgid "Add application"
-msgstr ""
-
-#: mod/settings.php:508 mod/settings.php:615 mod/settings.php:713
-#: mod/settings.php:848 src/Module/Admin/Addons/Index.php:69
-#: src/Module/Admin/Features.php:87 src/Module/Admin/Logs/Settings.php:82
-#: src/Module/Admin/Site.php:582 src/Module/Admin/Themes/Index.php:113
-#: src/Module/Admin/Tos.php:66 src/Module/Settings/Delegation.php:170
-#: src/Module/Settings/Display.php:189
-msgid "Save Settings"
+#: mod/settings.php:517
+msgid "Connected Apps"
 msgstr ""
 
-#: mod/settings.php:510 mod/settings.php:536
-#: src/Module/Admin/Blocklist/Contact.php:90
+#: mod/settings.php:518 src/Module/Admin/Blocklist/Contact.php:90
 #: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:130
 #: src/Module/Admin/Users/Create.php:71 src/Module/Admin/Users/Deleted.php:88
 #: src/Module/Admin/Users/Index.php:142 src/Module/Admin/Users/Index.php:162
@@ -2169,100 +2159,80 @@ msgstr ""
 msgid "Name"
 msgstr ""
 
-#: mod/settings.php:511 mod/settings.php:537
-msgid "Consumer Key"
-msgstr ""
-
-#: mod/settings.php:512 mod/settings.php:538
-msgid "Consumer Secret"
-msgstr ""
-
-#: mod/settings.php:513 mod/settings.php:539
-msgid "Redirect"
-msgstr ""
-
-#: mod/settings.php:514 mod/settings.php:540
-msgid "Icon url"
-msgstr ""
-
-#: mod/settings.php:525
-msgid "You can't edit this application."
-msgstr ""
-
-#: mod/settings.php:566
-msgid "Connected Apps"
-msgstr ""
-
-#: mod/settings.php:568 src/Object/Post.php:192 src/Object/Post.php:194
-msgid "Edit"
-msgstr ""
-
-#: mod/settings.php:570
-msgid "Client key starts with"
+#: mod/settings.php:519 src/Content/Nav.php:216
+msgid "Home Page"
 msgstr ""
 
-#: mod/settings.php:571
-msgid "No name"
+#: mod/settings.php:520 src/Module/Admin/Queue.php:78
+msgid "Created"
 msgstr ""
 
-#: mod/settings.php:572
+#: mod/settings.php:521
 msgid "Remove authorization"
 msgstr ""
 
-#: mod/settings.php:583
+#: mod/settings.php:532
 msgid "No Addon settings configured"
 msgstr ""
 
-#: mod/settings.php:592
+#: mod/settings.php:541
 msgid "Addon Settings"
 msgstr ""
 
-#: mod/settings.php:613
+#: mod/settings.php:562
 msgid "Additional Features"
 msgstr ""
 
-#: mod/settings.php:638
+#: mod/settings.php:564 mod/settings.php:662 mod/settings.php:797
+#: src/Module/Admin/Addons/Index.php:69 src/Module/Admin/Features.php:87
+#: src/Module/Admin/Logs/Settings.php:82 src/Module/Admin/Site.php:582
+#: src/Module/Admin/Themes/Index.php:113 src/Module/Admin/Tos.php:66
+#: src/Module/Settings/Delegation.php:170 src/Module/Settings/Display.php:189
+msgid "Save Settings"
+msgstr ""
+
+#: mod/settings.php:587
 msgid "Diaspora (Socialhome, Hubzilla)"
 msgstr ""
 
-#: mod/settings.php:638 mod/settings.php:639
+#: mod/settings.php:587 mod/settings.php:588
 msgid "enabled"
 msgstr ""
 
-#: mod/settings.php:638 mod/settings.php:639
+#: mod/settings.php:587 mod/settings.php:588
 msgid "disabled"
 msgstr ""
 
-#: mod/settings.php:638 mod/settings.php:639
+#: mod/settings.php:587 mod/settings.php:588
 #, php-format
 msgid "Built-in support for %s connectivity is %s"
 msgstr ""
 
-#: mod/settings.php:639
+#: mod/settings.php:588
 msgid "OStatus (GNU Social)"
 msgstr ""
 
-#: mod/settings.php:670
+#: mod/settings.php:619
 msgid "Email access is disabled on this site."
 msgstr ""
 
-#: mod/settings.php:675 mod/settings.php:711
+#: mod/settings.php:624 mod/settings.php:660
 msgid "None"
 msgstr ""
 
-#: mod/settings.php:681 src/Module/BaseSettings.php:80
+#: mod/settings.php:630 src/Module/BaseSettings.php:80
 msgid "Social Networks"
 msgstr ""
 
-#: mod/settings.php:686
+#: mod/settings.php:635
 msgid "General Social Media Settings"
 msgstr ""
 
-#: mod/settings.php:687
+#: mod/settings.php:636
 msgid "Accept only top level posts by contacts you follow"
 msgstr ""
 
-#: mod/settings.php:687
+#: mod/settings.php:636
 msgid ""
 "The system does an auto completion of threads when a comment arrives. This "
 "has got the side effect that you can receive posts that had been started by "
@@ -2271,11 +2241,11 @@ msgid ""
 "posts from people you really do follow."
 msgstr ""
 
-#: mod/settings.php:688
+#: mod/settings.php:637
 msgid "Disable Content Warning"
 msgstr ""
 
-#: mod/settings.php:688
+#: mod/settings.php:637
 msgid ""
 "Users on networks like Mastodon or Pleroma are able to set a content warning "
 "field which collapse their post by default. This disables the automatic "
@@ -2283,227 +2253,227 @@ msgid ""
 "any other content filtering you eventually set up."
 msgstr ""
 
-#: mod/settings.php:689
+#: mod/settings.php:638
 msgid "Disable intelligent shortening"
 msgstr ""
 
-#: mod/settings.php:689
+#: mod/settings.php:638
 msgid ""
 "Normally the system tries to find the best link to add to shortened posts. "
 "If this option is enabled then every shortened post will always point to the "
 "original friendica post."
 msgstr ""
 
-#: mod/settings.php:690
+#: mod/settings.php:639
 msgid "Attach the link title"
 msgstr ""
 
-#: mod/settings.php:690
+#: mod/settings.php:639
 msgid ""
 "When activated, the title of the attached link will be added as a title on "
 "posts to Diaspora. This is mostly helpful with \"remote-self\" contacts that "
 "share feed content."
 msgstr ""
 
-#: mod/settings.php:691
+#: mod/settings.php:640
 msgid "Automatically follow any GNU Social (OStatus) followers/mentioners"
 msgstr ""
 
-#: mod/settings.php:691
+#: mod/settings.php:640
 msgid ""
 "If you receive a message from an unknown OStatus user, this option decides "
 "what to do. If it is checked, a new contact will be created for every "
 "unknown user."
 msgstr ""
 
-#: mod/settings.php:692
+#: mod/settings.php:641
 msgid "Default group for OStatus contacts"
 msgstr ""
 
-#: mod/settings.php:693
+#: mod/settings.php:642
 msgid "Your legacy GNU Social account"
 msgstr ""
 
-#: mod/settings.php:693
+#: mod/settings.php:642
 msgid ""
 "If you enter your old GNU Social/Statusnet account name here (in the format "
 "user@domain.tld), your contacts will be added automatically. The field will "
 "be emptied when done."
 msgstr ""
 
-#: mod/settings.php:696
+#: mod/settings.php:645
 msgid "Repair OStatus subscriptions"
 msgstr ""
 
-#: mod/settings.php:700
+#: mod/settings.php:649
 msgid "Email/Mailbox Setup"
 msgstr ""
 
-#: mod/settings.php:701
+#: mod/settings.php:650
 msgid ""
 "If you wish to communicate with email contacts using this service "
 "(optional), please specify how to connect to your mailbox."
 msgstr ""
 
-#: mod/settings.php:702
+#: mod/settings.php:651
 msgid "Last successful email check:"
 msgstr ""
 
-#: mod/settings.php:704
+#: mod/settings.php:653
 msgid "IMAP server name:"
 msgstr ""
 
-#: mod/settings.php:705
+#: mod/settings.php:654
 msgid "IMAP port:"
 msgstr ""
 
-#: mod/settings.php:706
+#: mod/settings.php:655
 msgid "Security:"
 msgstr ""
 
-#: mod/settings.php:707
+#: mod/settings.php:656
 msgid "Email login name:"
 msgstr ""
 
-#: mod/settings.php:708
+#: mod/settings.php:657
 msgid "Email password:"
 msgstr ""
 
-#: mod/settings.php:709
+#: mod/settings.php:658
 msgid "Reply-to address:"
 msgstr ""
 
-#: mod/settings.php:710
+#: mod/settings.php:659
 msgid "Send public posts to all email contacts:"
 msgstr ""
 
-#: mod/settings.php:711
+#: mod/settings.php:660
 msgid "Action after import:"
 msgstr ""
 
-#: mod/settings.php:711 src/Content/Nav.php:284
+#: mod/settings.php:660 src/Content/Nav.php:284
 msgid "Mark as seen"
 msgstr ""
 
-#: mod/settings.php:711
+#: mod/settings.php:660
 msgid "Move to folder"
 msgstr ""
 
-#: mod/settings.php:712
+#: mod/settings.php:661
 msgid "Move to folder:"
 msgstr ""
 
-#: mod/settings.php:726
+#: mod/settings.php:675
 msgid "Unable to find your profile. Please contact your admin."
 msgstr ""
 
-#: mod/settings.php:762 src/Content/Widget.php:536
+#: mod/settings.php:711 src/Content/Widget.php:536
 msgid "Account Types"
 msgstr ""
 
-#: mod/settings.php:763
+#: mod/settings.php:712
 msgid "Personal Page Subtypes"
 msgstr ""
 
-#: mod/settings.php:764
+#: mod/settings.php:713
 msgid "Community Forum Subtypes"
 msgstr ""
 
-#: mod/settings.php:771 src/Module/Admin/BaseUsers.php:106
+#: mod/settings.php:720 src/Module/Admin/BaseUsers.php:106
 msgid "Personal Page"
 msgstr ""
 
-#: mod/settings.php:772
+#: mod/settings.php:721
 msgid "Account for a personal profile."
 msgstr ""
 
-#: mod/settings.php:775 src/Module/Admin/BaseUsers.php:107
+#: mod/settings.php:724 src/Module/Admin/BaseUsers.php:107
 msgid "Organisation Page"
 msgstr ""
 
-#: mod/settings.php:776
+#: mod/settings.php:725
 msgid ""
 "Account for an organisation that automatically approves contact requests as "
 "\"Followers\"."
 msgstr ""
 
-#: mod/settings.php:779 src/Module/Admin/BaseUsers.php:108
+#: mod/settings.php:728 src/Module/Admin/BaseUsers.php:108
 msgid "News Page"
 msgstr ""
 
-#: mod/settings.php:780
+#: mod/settings.php:729
 msgid ""
 "Account for a news reflector that automatically approves contact requests as "
 "\"Followers\"."
 msgstr ""
 
-#: mod/settings.php:783 src/Module/Admin/BaseUsers.php:109
+#: mod/settings.php:732 src/Module/Admin/BaseUsers.php:109
 msgid "Community Forum"
 msgstr ""
 
-#: mod/settings.php:784
+#: mod/settings.php:733
 msgid "Account for community discussions."
 msgstr ""
 
-#: mod/settings.php:787 src/Module/Admin/BaseUsers.php:99
+#: mod/settings.php:736 src/Module/Admin/BaseUsers.php:99
 msgid "Normal Account Page"
 msgstr ""
 
-#: mod/settings.php:788
+#: mod/settings.php:737
 msgid ""
 "Account for a regular personal profile that requires manual approval of "
 "\"Friends\" and \"Followers\"."
 msgstr ""
 
-#: mod/settings.php:791 src/Module/Admin/BaseUsers.php:100
+#: mod/settings.php:740 src/Module/Admin/BaseUsers.php:100
 msgid "Soapbox Page"
 msgstr ""
 
-#: mod/settings.php:792
+#: mod/settings.php:741
 msgid ""
 "Account for a public profile that automatically approves contact requests as "
 "\"Followers\"."
 msgstr ""
 
-#: mod/settings.php:795 src/Module/Admin/BaseUsers.php:101
+#: mod/settings.php:744 src/Module/Admin/BaseUsers.php:101
 msgid "Public Forum"
 msgstr ""
 
-#: mod/settings.php:796
+#: mod/settings.php:745
 msgid "Automatically approves all contact requests."
 msgstr ""
 
-#: mod/settings.php:799 src/Module/Admin/BaseUsers.php:102
+#: mod/settings.php:748 src/Module/Admin/BaseUsers.php:102
 msgid "Automatic Friend Page"
 msgstr ""
 
-#: mod/settings.php:800
+#: mod/settings.php:749
 msgid ""
 "Account for a popular profile that automatically approves contact requests "
 "as \"Friends\"."
 msgstr ""
 
-#: mod/settings.php:803
+#: mod/settings.php:752
 msgid "Private Forum [Experimental]"
 msgstr ""
 
-#: mod/settings.php:804
+#: mod/settings.php:753
 msgid "Requires manual approval of contact requests."
 msgstr ""
 
-#: mod/settings.php:815
+#: mod/settings.php:764
 msgid "OpenID:"
 msgstr ""
 
-#: mod/settings.php:815
+#: mod/settings.php:764
 msgid "(Optional) Allow this OpenID to login to this account."
 msgstr ""
 
-#: mod/settings.php:823
+#: mod/settings.php:772
 msgid "Publish your profile in your local site directory?"
 msgstr ""
 
-#: mod/settings.php:823
+#: mod/settings.php:772
 #, php-format
 msgid ""
 "Your profile will be published in this node's <a href=\"%s\">local "
@@ -2511,115 +2481,115 @@ msgid ""
 "system settings."
 msgstr ""
 
-#: mod/settings.php:829
+#: mod/settings.php:778
 #, php-format
 msgid ""
 "Your profile will also be published in the global friendica directories (e."
 "g. <a href=\"%s\">%s</a>)."
 msgstr ""
 
-#: mod/settings.php:835
+#: mod/settings.php:784
 #, php-format
 msgid "Your Identity Address is <strong>'%s'</strong> or '%s'."
 msgstr ""
 
-#: mod/settings.php:846
+#: mod/settings.php:795
 msgid "Account Settings"
 msgstr ""
 
-#: mod/settings.php:854
+#: mod/settings.php:803
 msgid "Password Settings"
 msgstr ""
 
-#: mod/settings.php:855 src/Module/Register.php:149
+#: mod/settings.php:804 src/Module/Register.php:149
 msgid "New Password:"
 msgstr ""
 
-#: mod/settings.php:855
+#: mod/settings.php:804
 msgid ""
 "Allowed characters are a-z, A-Z, 0-9 and special characters except white "
 "spaces, accentuated letters and colon (:)."
 msgstr ""
 
-#: mod/settings.php:856 src/Module/Register.php:150
+#: mod/settings.php:805 src/Module/Register.php:150
 msgid "Confirm:"
 msgstr ""
 
-#: mod/settings.php:856
+#: mod/settings.php:805
 msgid "Leave password fields blank unless changing"
 msgstr ""
 
-#: mod/settings.php:857
+#: mod/settings.php:806
 msgid "Current Password:"
 msgstr ""
 
-#: mod/settings.php:857
+#: mod/settings.php:806
 msgid "Your current password to confirm the changes"
 msgstr ""
 
-#: mod/settings.php:858
+#: mod/settings.php:807
 msgid "Password:"
 msgstr ""
 
-#: mod/settings.php:858
+#: mod/settings.php:807
 msgid "Your current password to confirm the changes of the email address"
 msgstr ""
 
-#: mod/settings.php:861
+#: mod/settings.php:810
 msgid "Delete OpenID URL"
 msgstr ""
 
-#: mod/settings.php:863
+#: mod/settings.php:812
 msgid "Basic Settings"
 msgstr ""
 
-#: mod/settings.php:864 src/Module/Profile/Profile.php:144
+#: mod/settings.php:813 src/Module/Profile/Profile.php:144
 msgid "Full Name:"
 msgstr ""
 
-#: mod/settings.php:865
+#: mod/settings.php:814
 msgid "Email Address:"
 msgstr ""
 
-#: mod/settings.php:866
+#: mod/settings.php:815
 msgid "Your Timezone:"
 msgstr ""
 
-#: mod/settings.php:867
+#: mod/settings.php:816
 msgid "Your Language:"
 msgstr ""
 
-#: mod/settings.php:867
+#: mod/settings.php:816
 msgid ""
 "Set the language we use to show you friendica interface and to send you "
 "emails"
 msgstr ""
 
-#: mod/settings.php:868
+#: mod/settings.php:817
 msgid "Default Post Location:"
 msgstr ""
 
-#: mod/settings.php:869
+#: mod/settings.php:818
 msgid "Use Browser Location:"
 msgstr ""
 
-#: mod/settings.php:871
+#: mod/settings.php:820
 msgid "Security and Privacy Settings"
 msgstr ""
 
-#: mod/settings.php:873
+#: mod/settings.php:822
 msgid "Maximum Friend Requests/Day:"
 msgstr ""
 
-#: mod/settings.php:873 mod/settings.php:883
+#: mod/settings.php:822 mod/settings.php:832
 msgid "(to prevent spam abuse)"
 msgstr ""
 
-#: mod/settings.php:875
+#: mod/settings.php:824
 msgid "Allow your profile to be searchable globally?"
 msgstr ""
 
-#: mod/settings.php:875
+#: mod/settings.php:824
 msgid ""
 "Activate this setting if you want others to easily find and follow you. Your "
 "profile will be searchable on remote systems. This setting also determines "
@@ -2627,43 +2597,43 @@ msgid ""
 "indexed or not."
 msgstr ""
 
-#: mod/settings.php:876
+#: mod/settings.php:825
 msgid "Hide your contact/friend list from viewers of your profile?"
 msgstr ""
 
-#: mod/settings.php:876
+#: mod/settings.php:825
 msgid ""
 "A list of your contacts is displayed on your profile page. Activate this "
 "option to disable the display of your contact list."
 msgstr ""
 
-#: mod/settings.php:877
+#: mod/settings.php:826
 msgid "Hide your profile details from anonymous viewers?"
 msgstr ""
 
-#: mod/settings.php:877
+#: mod/settings.php:826
 msgid ""
 "Anonymous visitors will only see your profile picture, your display name and "
 "the nickname you are using on your profile page. Your public posts and "
 "replies will still be accessible by other means."
 msgstr ""
 
-#: mod/settings.php:878
+#: mod/settings.php:827
 msgid "Make public posts unlisted"
 msgstr ""
 
-#: mod/settings.php:878
+#: mod/settings.php:827
 msgid ""
 "Your public posts will not appear on the community pages or in search "
 "results, nor be sent to relay servers. However they can still appear on "
 "public feeds on remote servers."
 msgstr ""
 
-#: mod/settings.php:879
+#: mod/settings.php:828
 msgid "Make all posted pictures accessible"
 msgstr ""
 
-#: mod/settings.php:879
+#: mod/settings.php:828
 msgid ""
 "This option makes every posted picture accessible via the direct link. This "
 "is a workaround for the problem that most other networks can't handle "
@@ -2671,209 +2641,209 @@ msgid ""
 "public on your photo albums though."
 msgstr ""
 
-#: mod/settings.php:880
+#: mod/settings.php:829
 msgid "Allow friends to post to your profile page?"
 msgstr ""
 
-#: mod/settings.php:880
+#: mod/settings.php:829
 msgid ""
 "Your contacts may write posts on your profile wall. These posts will be "
 "distributed to your contacts"
 msgstr ""
 
-#: mod/settings.php:881
+#: mod/settings.php:830
 msgid "Allow friends to tag your posts?"
 msgstr ""
 
-#: mod/settings.php:881
+#: mod/settings.php:830
 msgid "Your contacts can add additional tags to your posts."
 msgstr ""
 
-#: mod/settings.php:882
+#: mod/settings.php:831
 msgid "Permit unknown people to send you private mail?"
 msgstr ""
 
-#: mod/settings.php:882
+#: mod/settings.php:831
 msgid ""
 "Friendica network users may send you private messages even if they are not "
 "in your contact list."
 msgstr ""
 
-#: mod/settings.php:883
+#: mod/settings.php:832
 msgid "Maximum private messages per day from unknown people:"
 msgstr ""
 
-#: mod/settings.php:885
+#: mod/settings.php:834
 msgid "Default Post Permissions"
 msgstr ""
 
-#: mod/settings.php:889
+#: mod/settings.php:838
 msgid "Expiration settings"
 msgstr ""
 
-#: mod/settings.php:890
+#: mod/settings.php:839
 msgid "Automatically expire posts after this many days:"
 msgstr ""
 
-#: mod/settings.php:890
+#: mod/settings.php:839
 msgid "If empty, posts will not expire. Expired posts will be deleted"
 msgstr ""
 
-#: mod/settings.php:891
+#: mod/settings.php:840
 msgid "Expire posts"
 msgstr ""
 
-#: mod/settings.php:891
+#: mod/settings.php:840
 msgid "When activated, posts and comments will be expired."
 msgstr ""
 
-#: mod/settings.php:892
+#: mod/settings.php:841
 msgid "Expire personal notes"
 msgstr ""
 
-#: mod/settings.php:892
+#: mod/settings.php:841
 msgid ""
 "When activated, the personal notes on your profile page will be expired."
 msgstr ""
 
-#: mod/settings.php:893
+#: mod/settings.php:842
 msgid "Expire starred posts"
 msgstr ""
 
-#: mod/settings.php:893
+#: mod/settings.php:842
 msgid ""
 "Starring posts keeps them from being expired. That behaviour is overwritten "
 "by this setting."
 msgstr ""
 
-#: mod/settings.php:894
+#: mod/settings.php:843
 msgid "Expire photos"
 msgstr ""
 
-#: mod/settings.php:894
+#: mod/settings.php:843
 msgid "When activated, photos will be expired."
 msgstr ""
 
-#: mod/settings.php:895
+#: mod/settings.php:844
 msgid "Only expire posts by others"
 msgstr ""
 
-#: mod/settings.php:895
+#: mod/settings.php:844
 msgid ""
 "When activated, your own posts never expire. Then the settings above are "
 "only valid for posts you received."
 msgstr ""
 
-#: mod/settings.php:898
+#: mod/settings.php:847
 msgid "Notification Settings"
 msgstr ""
 
-#: mod/settings.php:899
+#: mod/settings.php:848
 msgid "Send a notification email when:"
 msgstr ""
 
-#: mod/settings.php:900
+#: mod/settings.php:849
 msgid "You receive an introduction"
 msgstr ""
 
-#: mod/settings.php:901
+#: mod/settings.php:850
 msgid "Your introductions are confirmed"
 msgstr ""
 
-#: mod/settings.php:902
+#: mod/settings.php:851
 msgid "Someone writes on your profile wall"
 msgstr ""
 
-#: mod/settings.php:903
+#: mod/settings.php:852
 msgid "Someone writes a followup comment"
 msgstr ""
 
-#: mod/settings.php:904
+#: mod/settings.php:853
 msgid "You receive a private message"
 msgstr ""
 
-#: mod/settings.php:905
+#: mod/settings.php:854
 msgid "You receive a friend suggestion"
 msgstr ""
 
-#: mod/settings.php:906
+#: mod/settings.php:855
 msgid "You are tagged in a post"
 msgstr ""
 
-#: mod/settings.php:907
+#: mod/settings.php:856
 msgid "You are poked/prodded/etc. in a post"
 msgstr ""
 
-#: mod/settings.php:909
+#: mod/settings.php:858
 msgid "Activate desktop notifications"
 msgstr ""
 
-#: mod/settings.php:909
+#: mod/settings.php:858
 msgid "Show desktop popup on new notifications"
 msgstr ""
 
-#: mod/settings.php:911
+#: mod/settings.php:860
 msgid "Text-only notification emails"
 msgstr ""
 
-#: mod/settings.php:913
+#: mod/settings.php:862
 msgid "Send text only notification emails, without the html part"
 msgstr ""
 
-#: mod/settings.php:915
+#: mod/settings.php:864
 msgid "Show detailled notifications"
 msgstr ""
 
-#: mod/settings.php:917
+#: mod/settings.php:866
 msgid ""
 "Per default, notifications are condensed to a single notification per item. "
 "When enabled every notification is displayed."
 msgstr ""
 
-#: mod/settings.php:919
+#: mod/settings.php:868
 msgid "Show notifications of ignored contacts"
 msgstr ""
 
-#: mod/settings.php:921
+#: mod/settings.php:870
 msgid ""
 "You don't see posts from ignored contacts. But you still see their comments. "
 "This setting controls if you want to still receive regular notifications "
 "that are caused by ignored contacts or not."
 msgstr ""
 
-#: mod/settings.php:923
+#: mod/settings.php:872
 msgid "Advanced Account/Page Type Settings"
 msgstr ""
 
-#: mod/settings.php:924
+#: mod/settings.php:873
 msgid "Change the behaviour of this account for special situations"
 msgstr ""
 
-#: mod/settings.php:927
+#: mod/settings.php:876
 msgid "Import Contacts"
 msgstr ""
 
-#: mod/settings.php:928
+#: mod/settings.php:877
 msgid ""
 "Upload a CSV file that contains the handle of your followed accounts in the "
 "first column you exported from the old account."
 msgstr ""
 
-#: mod/settings.php:929
+#: mod/settings.php:878
 msgid "Upload File"
 msgstr ""
 
-#: mod/settings.php:931
+#: mod/settings.php:880
 msgid "Relocate"
 msgstr ""
 
-#: mod/settings.php:932
+#: mod/settings.php:881
 msgid ""
 "If you have moved this profile from another server, and some of your "
 "contacts don't receive your updates, try pushing this button."
 msgstr ""
 
-#: mod/settings.php:933
+#: mod/settings.php:882
 msgid "Resend relocate message to contacts"
 msgstr ""
 
@@ -3478,10 +3448,6 @@ msgstr ""
 msgid "Home"
 msgstr ""
 
-#: src/Content/Nav.php:216
-msgid "Home Page"
-msgstr ""
-
 #: src/Content/Nav.php:220 src/Module/Register.php:155
 #: src/Module/Security/Login.php:106
 msgid "Register"
@@ -5809,10 +5775,6 @@ msgstr ""
 msgid "Job Parameters"
 msgstr ""
 
-#: src/Module/Admin/Queue.php:78
-msgid "Created"
-msgstr ""
-
 #: src/Module/Admin/Queue.php:79
 msgid "Priority"
 msgstr ""
@@ -7234,7 +7196,7 @@ msgstr ""
 msgid "Deny"
 msgstr ""
 
-#: src/Module/Api/Mastodon/Apps.php:46
+#: src/Module/Api/Mastodon/Apps.php:47 src/Module/Api/Mastodon/Apps.php:58
 msgid "Missing parameters"
 msgstr ""
 
@@ -7340,12 +7302,12 @@ msgstr ""
 msgid "User registrations waiting for confirmation"
 msgstr ""
 
-#: src/Module/BaseApi.php:123
+#: src/Module/BaseApi.php:124
 #, php-format
 msgid "API endpoint %s %s is not implemented"
 msgstr ""
 
-#: src/Module/BaseApi.php:124
+#: src/Module/BaseApi.php:125
 msgid ""
 "The API endpoint is currently not implemented but might be in the future."
 msgstr ""
@@ -8884,7 +8846,15 @@ msgstr ""
 msgid "Show all"
 msgstr ""
 
-#: src/Module/OAuth/Token.php:43
+#: src/Module/OAuth/Authorize.php:49
+msgid "Unsupported or missing response type"
+msgstr ""
+
+#: src/Module/OAuth/Authorize.php:54 src/Module/OAuth/Token.php:51
+msgid "Incomplete request data"
+msgstr ""
+
+#: src/Module/OAuth/Token.php:46
 msgid "Unsupported or missing grant type"
 msgstr ""
 
@@ -10291,6 +10261,10 @@ msgstr ""
 msgid "Private Message"
 msgstr ""
 
+#: src/Object/Post.php:192 src/Object/Post.php:194
+msgid "Edit"
+msgstr ""
+
 #: src/Object/Post.php:214
 msgid "Pinned item"
 msgstr ""
index edb0ff63ec16738aacfb4a0c0d6a373530845576..955b5754dcb7e087e68db25a13b11fc7d9e87e52 100644 (file)
@@ -1,32 +1,25 @@
-
-<h1>{{$title}}</h1>
-
-
-<form action="settings/oauth" method="post" autocomplete="off">
-<input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
-
-       <div id="profile-edit-links">
-               <ul>
-                       <li>
-                               <a id="profile-edit-view-link" href="{{$baseurl}}/settings/oauth/add">{{$add}}</a>
-                       </li>
-               </ul>
-       </div>
-
-       {{foreach $apps as $app}}
-       <div class='oauthapp'>
-               <img src='{{$app.icon}}' class="{{if $app.icon}} {{else}}noicon{{/if}}">
-               {{if $app.name}}<h4>{{$app.name}}</h4>{{else}}<h4>{{$noname}}</h4>{{/if}}
-               {{if $app.my}}
-                       {{if $app.oauth_token}}
-                       <div class="settings-submit-wrapper" ><button class="settings-submit"  type="submit" name="remove" value="{{$app.oauth_token}}">{{$remove}}</button></div>
-                       {{/if}}
-               {{/if}}
-               {{if $app.my}}
-               <a href="{{$baseurl}}/settings/oauth/edit/{{$app.client_id}}" class="icon s22 edit" title="{{$edit}}">&nbsp;</a>
-               <a href="{{$baseurl}}/settings/oauth/delete/{{$app.client_id}}?t={{$form_security_token}}" class="icon s22 delete" title="{{$delete}}">&nbsp;</a>
-               {{/if}}         
-       </div>
-       {{/foreach}}
-
-</form>
+<div class="generic-page-wrapper">
+       <h1>{{$title}}</h1>
+       <form action="settings/oauth" method="post" autocomplete="off">
+               <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
+               <table id='application-block' class='table table-condensed table-striped'>
+                       <thead>
+                               <tr>
+                                       <th>{{$name}}</th>
+                                       <th>{{$website}}</th>
+                                       <th>{{$created_at}}</th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                               {{foreach $apps as $app}}
+                               <tr>
+                                       <td>{{$app.name}}</td>
+                                       <td>{{$app.website}}</td>
+                                       <td>{{$app.created_at}}</td>
+                                       <td><a href="{{$baseurl}}/settings/oauth/delete/{{$app.id}}?t={{$form_security_token}}" class="icon s22 delete" title="{{$delete}}">&nbsp;</a></td>
+                               </tr>
+                               {{/foreach}}
+                       </tbody>
+               </table>
+       </form>
+</div>
index c6103cbc82a1749adf93585a322dca89c85ba4ac..98cb96a3f8a9dd8e7b6b5ce1f015de434eb50232 100644 (file)
@@ -1,44 +1,26 @@
 <div class="generic-page-wrapper">
        {{* include the title template for the settings title *}}
-       {{include file="section_title.tpl" title=$title }}
-
-
+       {{include file="section_title.tpl" title=$title}}
        <form action="settings/oauth" method="post" autocomplete="off">
                <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
-
-               <div id="profile-edit-links">
-                       <ul>
-                               {{*
-                               I commented this out. Initially I wanted to to load the oauth/add into a modal dialog but settings.php
-                               does need $a->argv[2] === 'add' to work and argv[2] isn't available if you load a modal
-                               I leave it at this place as reminder that we need an other solution in settings.php 
-
-                               <li role="menuitem">
-                                       <a id="profile-edit-view-link" onclick="addToModal('{{$baseurl}}/settings/oauth/add')">{{$add}}</a>
-                               </li>
-                               *}}
-
-                               <li role="menuitem">
-                                       <a id="profile-edit-view-link" href="{{$baseurl}}/settings/oauth/add">{{$add}}</a>
-                               </li>
-                       </ul>
-               </div>
-
-               {{foreach $apps as $app}}
-               <div class='oauthapp'>
-                       <img src='{{$app.icon}}' class="{{if $app.icon}} {{else}}noicon{{/if}}">
-                       {{if $app.name}}<h4>{{$app.name}}</h4>{{else}}<h4>{{$noname}}</h4>{{/if}}
-                       {{if $app.my}}
-                               {{if $app.oauth_token}}
-                               <div class="settings-submit-wrapper" ><button class="settings-submit"  type="submit" name="remove" value="{{$app.oauth_token}}">{{$remove}}</button></div>
-                               {{/if}}
-                       {{/if}}
-                       {{if $app.my}}
-                       <a href="{{$baseurl}}/settings/oauth/edit/{{$app.client_id}}" class="btn" title="{{$edit}}"><i class="fa fa-pencil-square-o" aria-hidden="true"></i>&nbsp;</a>
-                       <a href="{{$baseurl}}/settings/oauth/delete/{{$app.client_id}}?t={{$form_security_token}}" class="btn" title="{{$delete}}"><i class="fa fa-trash" aria-hidden="true"></i></a>
-                       {{/if}}
-               </div>
-               {{/foreach}}
-
+               <table id='application-block' class='table table-condensed table-striped'>
+                       <thead>
+                               <tr>
+                                       <th>{{$name}}</th>
+                                       <th>{{$website}}</th>
+                                       <th>{{$created_at}}</th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                               {{foreach $apps as $app}}
+                               <tr>
+                                       <td>{{$app.name}}</td>
+                                       <td>{{$app.website}}</td>
+                                       <td>{{$app.created_at}}</td>
+                                       <td><a href="{{$baseurl}}/settings/oauth/delete/{{$app.id}}?t={{$form_security_token}}" class="btn" title="{{$delete}}"><i class="fa fa-trash" aria-hidden="true"></i></a></td>
+                               </tr>
+                               {{/foreach}}
+                       </tbody>
+               </table>
        </form>
 </div>