From 7975bc244df2a33dd637303c8b7377de9cdf6c6d Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 May 2021 11:26:56 +0000 Subject: [PATCH 1/6] Refine OAuth flow --- doc/API-Mastodon.md | 15 ++++++++ src/Factory/Api/Mastodon/Card.php | 2 +- src/Model/Item.php | 4 +-- src/Module/Api/Mastodon/Apps.php | 12 +++++++ src/Module/BaseApi.php | 22 ++++++------ src/Module/OAuth/Authorize.php | 24 ++++++++++--- src/Module/OAuth/Token.php | 29 +++++++++------- src/Object/Api/Mastodon/Token.php | 58 +++++++++++++++++++++++++++++++ 8 files changed, 134 insertions(+), 32 deletions(-) create mode 100644 src/Object/Api/Mastodon/Token.php diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 7f5b55797..18af62be6 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -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/). diff --git a/src/Factory/Api/Mastodon/Card.php b/src/Factory/Api/Mastodon/Card.php index 1505fa852..f7512b390 100644 --- a/src/Factory/Api/Mastodon/Card.php +++ b/src/Factory/Api/Mastodon/Card.php @@ -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 { diff --git a/src/Model/Item.php b/src/Model/Item.php index 2ce05589d..e5b95d689 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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)) { diff --git a/src/Module/Api/Mastodon/Apps.php b/src/Module/Api/Mastodon/Apps.php index 7b13b1701..0fc206d43 100644 --- a/src/Module/Api/Mastodon/Apps.php +++ b/src/Module/Api/Mastodon/Apps.php @@ -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,6 +38,17 @@ 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'] ?? ''; diff --git a/src/Module/BaseApi.php b/src/Module/BaseApi.php index b4f228a6e..b18f0402c 100644 --- a/src/Module/BaseApi.php +++ b/src/Module/BaseApi.php @@ -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,15 +257,18 @@ 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)); + // @todo store the scope + $fields = ['application-id' => $application['id'], 'uid' => $uid, 'code' => $code, 'access_token' => $access_token, 'created_at' => DateTimeFormat::utcNow(DateTimeFormat::MYSQL)]; if (!DBA::insert('application-token', $fields, Database::INSERT_UPDATE)) { return []; diff --git a/src/Module/OAuth/Authorize.php b/src/Module/OAuth/Authorize.php index 7d9f67ad3..c95620770 100644 --- a/src/Module/OAuth/Authorize.php +++ b/src/Module/OAuth/Authorize.php @@ -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'] ?? ''; + $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])); } } diff --git a/src/Module/OAuth/Token.php b/src/Module/OAuth/Token.php index 17f2e2b82..c3aaac6d1 100644 --- a/src/Module/OAuth/Token.php +++ b/src/Module/OAuth/Token.php @@ -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($client_id) || empty($client_secret) || 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(); } - if ($application['client_secret'] != $client_secret) { - Logger::warning('Wrong client secret', $client_secret); - DI::mstdnError()->Unauthorized(); - } - - $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 index 000000000..a3921fc8a --- /dev/null +++ b/src/Object/Api/Mastodon/Token.php @@ -0,0 +1,58 @@ +. + * + */ + +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); + } +} From 132e08edb84b3eb8031c7fcf00f008f72c7c2b0e Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 May 2021 11:33:07 +0000 Subject: [PATCH 2/6] Whitespaces ... --- src/Module/BaseApi.php | 6 +++--- src/Object/Api/Mastodon/Token.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Module/BaseApi.php b/src/Module/BaseApi.php index b18f0402c..6c2f13c59 100644 --- a/src/Module/BaseApi.php +++ b/src/Module/BaseApi.php @@ -207,9 +207,9 @@ 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 + * @param string $client_id + * @param string $client_secret + * @param string $redirect_uri * @return array application record */ public static function getApplication(string $client_id, string $client_secret, string $redirect_uri) diff --git a/src/Object/Api/Mastodon/Token.php b/src/Object/Api/Mastodon/Token.php index a3921fc8a..1c78d6959 100644 --- a/src/Object/Api/Mastodon/Token.php +++ b/src/Object/Api/Mastodon/Token.php @@ -43,10 +43,10 @@ class Token extends BaseDataTransferObject /** * Creates a token record * - * @param string $access_token - * @param string $token_type - * @param string $scope - * @param string $created_at + * @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) { From b18073d5a89ce6058a0985960f01391cf93c915a Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 May 2021 14:58:55 +0000 Subject: [PATCH 3/6] Repurposed OAuth frontend handling, store the scope --- database.sql | 32 ++++++++- mod/settings.php | 69 +++----------------- src/Module/Api/Mastodon/Apps.php | 6 +- src/Module/BaseApi.php | 6 +- src/Module/OAuth/Authorize.php | 2 +- static/dbstructure.config.php | 11 +++- static/dbview.config.php | 19 ++++++ view/templates/settings/oauth.tpl | 57 +++++++--------- view/theme/frio/templates/settings/oauth.tpl | 58 ++++++---------- 9 files changed, 121 insertions(+), 139 deletions(-) diff --git a/database.sql b/database.sql index bbcd479bc..99386abf4 100644 --- a/database.sql +++ b/database.sql @@ -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,27 @@ 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 -- diff --git a/mod/settings.php b/mod/settings.php index c8dbcb910..3a3f0b65d 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -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; } diff --git a/src/Module/Api/Mastodon/Apps.php b/src/Module/Api/Mastodon/Apps.php index 0fc206d43..8205691dc 100644 --- a/src/Module/Api/Mastodon/Apps.php +++ b/src/Module/Api/Mastodon/Apps.php @@ -51,7 +51,7 @@ class Apps extends BaseApi $name = $_REQUEST['client_name'] ?? ''; $redirect = $_REQUEST['redirect_uris'] ?? ''; - $scopes = $_REQUEST['scopes'] ?? ''; + $scopes = $_REQUEST['scopes'] ?? 'read'; $website = $_REQUEST['website'] ?? ''; if (empty($name) || empty($redirect)) { @@ -67,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; } diff --git a/src/Module/BaseApi.php b/src/Module/BaseApi.php index 6c2f13c59..a53c008c6 100644 --- a/src/Module/BaseApi.php +++ b/src/Module/BaseApi.php @@ -267,9 +267,9 @@ class BaseApi extends BaseModule $code = bin2hex(random_bytes(32)); $access_token = bin2hex(random_bytes(32)); - // @todo store the scope - - $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 []; } diff --git a/src/Module/OAuth/Authorize.php b/src/Module/OAuth/Authorize.php index c95620770..57efe70c6 100644 --- a/src/Module/OAuth/Authorize.php +++ b/src/Module/OAuth/Authorize.php @@ -41,7 +41,7 @@ class Authorize extends BaseApi $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'] ?? ''; + $scope = $_REQUEST['scope'] ?? 'read'; $state = $_REQUEST['state'] ?? ''; if ($response_type != 'code') { diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 41515681e..a074ef0b8 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -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"], diff --git a/static/dbview.config.php b/static/dbview.config.php index 94b81411b..f8ebc0572 100644 --- a/static/dbview.config.php +++ b/static/dbview.config.php @@ -37,6 +37,25 @@ */ 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"], diff --git a/view/templates/settings/oauth.tpl b/view/templates/settings/oauth.tpl index edb0ff63e..955b5754d 100644 --- a/view/templates/settings/oauth.tpl +++ b/view/templates/settings/oauth.tpl @@ -1,32 +1,25 @@ - -

{{$title}}

- - -
- - - - - {{foreach $apps as $app}} -
- - {{if $app.name}}

{{$app.name}}

{{else}}

{{$noname}}

{{/if}} - {{if $app.my}} - {{if $app.oauth_token}} -
- {{/if}} - {{/if}} - {{if $app.my}} -   -   - {{/if}} -
- {{/foreach}} - -
+
+

{{$title}}

+
+ + + + + + + + + + + {{foreach $apps as $app}} + + + + + + + {{/foreach}} + +
{{$name}}{{$website}}{{$created_at}}
{{$app.name}}{{$app.website}}{{$app.created_at}} 
+
+
diff --git a/view/theme/frio/templates/settings/oauth.tpl b/view/theme/frio/templates/settings/oauth.tpl index c6103cbc8..98cb96a3f 100644 --- a/view/theme/frio/templates/settings/oauth.tpl +++ b/view/theme/frio/templates/settings/oauth.tpl @@ -1,44 +1,26 @@
{{* include the title template for the settings title *}} - {{include file="section_title.tpl" title=$title }} - - + {{include file="section_title.tpl" title=$title}}
- - - - {{foreach $apps as $app}} -
- - {{if $app.name}}

{{$app.name}}

{{else}}

{{$noname}}

{{/if}} - {{if $app.my}} - {{if $app.oauth_token}} -
- {{/if}} - {{/if}} - {{if $app.my}} -   - - {{/if}} -
- {{/foreach}} - + + + + + + + + + + {{foreach $apps as $app}} + + + + + + + {{/foreach}} + +
{{$name}}{{$website}}{{$created_at}}
{{$app.name}}{{$app.website}}{{$app.created_at}}
From 52190801497fe16d9b24e5ed5be3f6786cd6d7e5 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 May 2021 15:01:35 +0000 Subject: [PATCH 4/6] Fix url comparism --- src/Model/Item.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index e5b95d689..c57e6799b 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2918,7 +2918,7 @@ class Item $data['author_name'] = ''; } - if (($data['author_url'] ?? '') && ($data['provider_url'] ?? '')) { + if (($data['author_url'] ?? '') == ($data['provider_url'] ?? '')) { $data['author_url'] = ''; } } elseif (preg_match("/.*(\[attachment.*?\].*?\[\/attachment\]).*/ism", $body, $match)) { From a4dc6af3c94d21730b21b1a60335ddb3642c45c6 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 May 2021 15:15:32 +0000 Subject: [PATCH 5/6] Updated messages.po --- view/lang/C/messages.po | 410 +++++++++++++++++++--------------------- 1 file changed, 192 insertions(+), 218 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index c79794ab3..e6e0e55db 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -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 \n" "Language-Team: LANGUAGE \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" +#: mod/settings.php:517 +msgid "Connected Apps" 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" -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" +#: mod/settings.php:519 src/Content/Nav.php:216 +msgid "Home Page" msgstr "" -#: mod/settings.php:512 mod/settings.php:538 -msgid "Consumer Secret" +#: mod/settings.php:520 src/Module/Admin/Queue.php:78 +msgid "Created" 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" -msgstr "" - -#: mod/settings.php:571 -msgid "No name" -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 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. %s)." msgstr "" -#: mod/settings.php:835 +#: mod/settings.php:784 #, php-format msgid "Your Identity Address is '%s' 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 "" From 04c95f2441a603c7021ab48b34b5af11308f79ee Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 13 May 2021 15:26:17 +0000 Subject: [PATCH 6/6] added line break --- database.sql | 3 ++- static/dbview.config.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/database.sql b/database.sql index 99386abf4..0dcf9afe8 100644 --- a/database.sql +++ b/database.sql @@ -1526,7 +1526,8 @@ CREATE VIEW `application-view` AS SELECT `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`; + FROM `application-token` + INNER JOIN `application` ON `application-token`.`application-id` = `application`.`id`; -- -- VIEW post-user-view diff --git a/static/dbview.config.php b/static/dbview.config.php index f8ebc0572..324f7f926 100644 --- a/static/dbview.config.php +++ b/static/dbview.config.php @@ -54,7 +54,8 @@ "write" => ["application-token", "write"], "follow" => ["application-token", "follow"], ], - "query" => "FROM `application-token` INNER JOIN `application` ON `application-token`.`application-id` = `application`.`id`" + "query" => "FROM `application-token` + INNER JOIN `application` ON `application-token`.`application-id` = `application`.`id`" ], "post-user-view" => [ "fields" => [