diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php index 0c45c9efa56..e938ff92e16 100644 --- a/lib/private/Authentication/Token/DefaultToken.php +++ b/lib/private/Authentication/Token/DefaultToken.php @@ -151,6 +151,10 @@ class DefaultToken extends Entity implements IToken { } public function setScope($scope) { - return parent::setScope(json_encode($scope)); + if (is_string($scope)) { + $this->scope = $scope; + } else { + return parent::setScope(json_encode($scope)); + } } } diff --git a/lib/private/Authentication/Token/DefaultTokenMapper.php b/lib/private/Authentication/Token/DefaultTokenMapper.php index e2a17ca0f91..bfcb54c66c0 100644 --- a/lib/private/Authentication/Token/DefaultTokenMapper.php +++ b/lib/private/Authentication/Token/DefaultTokenMapper.php @@ -83,6 +83,7 @@ class DefaultTokenMapper extends Mapper { if ($data === false) { throw new DoesNotExistException('token does not exist'); } +; return DefaultToken::fromRow($data); } diff --git a/lib/private/Authentication/Token/IToken.php b/lib/private/Authentication/Token/IToken.php index 3fa8ccbb078..a6ba392907d 100644 --- a/lib/private/Authentication/Token/IToken.php +++ b/lib/private/Authentication/Token/IToken.php @@ -67,13 +67,25 @@ interface IToken extends JsonSerializable { public function getLastCheck(); /** - * Get the timestamp of the last password check + * Set the timestamp of the last password check * * @param int $time */ public function setLastCheck($time); + /** + * Get the authentication scope for this token + * + * If the scope is null no limitations exist for the token + * + * @return array|null + */ public function getScope(); + /** + * Set the authentication scope for this token + * + * @param array|null $scope + */ public function setScope($scope); } diff --git a/settings/css/settings.css b/settings/css/settings.css index 7d139a632d0..debf69dbae2 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -149,6 +149,12 @@ table.nostyle td { padding: 0.2em 0; } padding: 10px 10px 10px 0; } +#sessions .token-list td.icon, +#apppasswords .token-list td.icon { + width: 16px; + padding: 10px; +} + #sessions .token-list td, #apppasswords .token-list td { border-top: 1px solid #DDD; @@ -162,8 +168,8 @@ table.nostyle td { padding: 0.2em 0; } #apppasswords tr *:nth-child(2) { text-align: right; } -#sessions .token-list td a.icon-delete, -#apppasswords .token-list td a.icon-delete { +#sessions .token-list td a.icon, +#apppasswords .token-list td a.icon { display: block; opacity: 0.6; } diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js index 6eb04b63f20..361b5dcc7a8 100644 --- a/settings/js/authtoken_view.js +++ b/settings/js/authtoken_view.js @@ -29,11 +29,16 @@ '