diff options
m--------- | 3rdparty | 0 | ||||
-rw-r--r-- | apps/settings/lib/SetupChecks/PhpModules.php | 5 | ||||
-rw-r--r-- | apps/weather_status/lib/Controller/WeatherStatusController.php | 16 | ||||
-rw-r--r-- | apps/weather_status/lib/ResponseDefinitions.php | 17 | ||||
-rw-r--r-- | apps/weather_status/lib/Service/WeatherStatusService.php | 24 | ||||
-rw-r--r-- | apps/weather_status/openapi.json | 190 | ||||
-rw-r--r-- | core/css/header.css | 2 | ||||
-rw-r--r-- | core/css/header.css.map | 2 | ||||
-rw-r--r-- | core/css/header.scss | 15 | ||||
-rw-r--r-- | lib/private/User/Session.php | 37 |
10 files changed, 167 insertions, 141 deletions
diff --git a/3rdparty b/3rdparty -Subproject a71bd8af76fdcfad78c865d1c60f6dde6e24f1d +Subproject c643a8c43081ce36a3139e7bcadd752060c59e2 diff --git a/apps/settings/lib/SetupChecks/PhpModules.php b/apps/settings/lib/SetupChecks/PhpModules.php index 03235ff6380..bacf70eb9c9 100644 --- a/apps/settings/lib/SetupChecks/PhpModules.php +++ b/apps/settings/lib/SetupChecks/PhpModules.php @@ -49,11 +49,10 @@ class PhpModules implements ISetupCheck { 'zlib', ]; protected const RECOMMENDED_MODULES = [ - 'intl', - 'sysvsem', 'exif', + 'intl', 'sodium', - 'bz2', + 'sysvsem', ]; public function __construct( diff --git a/apps/weather_status/lib/Controller/WeatherStatusController.php b/apps/weather_status/lib/Controller/WeatherStatusController.php index d9db1aea5bf..da82bb4f03f 100644 --- a/apps/weather_status/lib/Controller/WeatherStatusController.php +++ b/apps/weather_status/lib/Controller/WeatherStatusController.php @@ -34,6 +34,10 @@ use OCP\IRequest; /** * @psalm-import-type WeatherStatusForecast from ResponseDefinitions + * @psalm-import-type WeatherStatusSuccess from ResponseDefinitions + * @psalm-import-type WeatherStatusLocation from ResponseDefinitions + * @psalm-import-type WeatherStatusLocationWithSuccess from ResponseDefinitions + * @psalm-import-type WeatherStatusLocationWithMode from ResponseDefinitions */ class WeatherStatusController extends OCSController { public function __construct( @@ -50,7 +54,7 @@ class WeatherStatusController extends OCSController { * * Try to use the address set in user personal settings as weather location * - * @return DataResponse<Http::STATUS_OK, array{success: bool, lat: ?float, lon: ?float, address: ?string}, array{}> + * @return DataResponse<Http::STATUS_OK, WeatherStatusLocationWithSuccess, array{}> * * 200: Address updated */ @@ -66,7 +70,7 @@ class WeatherStatusController extends OCSController { * - use the user defined address * * @param int $mode New mode - * @return DataResponse<Http::STATUS_OK, array{success: bool}, array{}> + * @return DataResponse<Http::STATUS_OK, WeatherStatusSuccess, array{}> * * 200: Weather status mode updated */ @@ -83,7 +87,7 @@ class WeatherStatusController extends OCSController { * @param string|null $address Any approximative or exact address * @param float|null $lat Latitude in decimal degree format * @param float|null $lon Longitude in decimal degree format - * @return DataResponse<Http::STATUS_OK, array{success: bool, lat: ?float, lon: ?float, address: ?string}, array{}> + * @return DataResponse<Http::STATUS_OK, WeatherStatusLocationWithSuccess, array{}> * * 200: Location updated */ @@ -97,7 +101,7 @@ class WeatherStatusController extends OCSController { * * Get stored user location * - * @return DataResponse<Http::STATUS_OK, array{lat: float, lon: float, address: string, mode: int}, array{}> + * @return DataResponse<Http::STATUS_OK, WeatherStatusLocationWithMode, array{}> * * 200: Location returned */ @@ -111,7 +115,7 @@ class WeatherStatusController extends OCSController { * * Get forecast for current location * - * @return DataResponse<Http::STATUS_OK, WeatherStatusForecast[], array{}>|DataResponse<Http::STATUS_NOT_FOUND, array{success: bool}, array{}> + * @return DataResponse<Http::STATUS_OK, WeatherStatusForecast[]|array{error: string}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, WeatherStatusSuccess, array{}> * * 200: Forecast returned * 404: Forecast not found @@ -144,7 +148,7 @@ class WeatherStatusController extends OCSController { * Set favorites list * * @param string[] $favorites Favorite addresses - * @return DataResponse<Http::STATUS_OK, array{success: bool}, array{}> + * @return DataResponse<Http::STATUS_OK, WeatherStatusSuccess, array{}> * * 200: Favorites updated */ diff --git a/apps/weather_status/lib/ResponseDefinitions.php b/apps/weather_status/lib/ResponseDefinitions.php index 1224a394e33..d69afbbb3c2 100644 --- a/apps/weather_status/lib/ResponseDefinitions.php +++ b/apps/weather_status/lib/ResponseDefinitions.php @@ -67,6 +67,23 @@ namespace OCA\WeatherStatus; * }, * }, * } + * + * @psalm-type WeatherStatusSuccess = array{ + * success: bool, + * } + * + * @psalm-type WeatherStatusMode = array{ + * mode: int, + * } + * @psalm-type WeatherStatusLocation = array{ + * lat?: string, + * lon?: string, + * address?: ?string, + * } + * + * @psalm-type WeatherStatusLocationWithSuccess = WeatherStatusLocation&WeatherStatusSuccess + * + * @psalm-type WeatherStatusLocationWithMode = WeatherStatusLocation&WeatherStatusMode */ class ResponseDefinitions { } diff --git a/apps/weather_status/lib/Service/WeatherStatusService.php b/apps/weather_status/lib/Service/WeatherStatusService.php index 7358f386151..ed416d09a87 100644 --- a/apps/weather_status/lib/Service/WeatherStatusService.php +++ b/apps/weather_status/lib/Service/WeatherStatusService.php @@ -27,6 +27,7 @@ declare(strict_types=1); namespace OCA\WeatherStatus\Service; use OCA\WeatherStatus\AppInfo\Application; +use OCA\WeatherStatus\ResponseDefinitions; use OCP\Accounts\IAccountManager; use OCP\Accounts\PropertyDoesNotExistException; use OCP\App\IAppManager; @@ -43,6 +44,11 @@ use Psr\Log\LoggerInterface; * Class WeatherStatusService * * @package OCA\WeatherStatus\Service + * + * @psalm-import-type WeatherStatusForecast from ResponseDefinitions + * @psalm-import-type WeatherStatusSuccess from ResponseDefinitions + * @psalm-import-type WeatherStatusLocationWithSuccess from ResponseDefinitions + * @psalm-import-type WeatherStatusLocationWithMode from ResponseDefinitions */ class WeatherStatusService { public const MODE_BROWSER_LOCATION = 1; @@ -73,7 +79,7 @@ class WeatherStatusService { * - ask the browser * - use the user defined address * @param int $mode New mode - * @return array success state + * @return WeatherStatusSuccess success state */ public function setMode(int $mode): array { $this->config->setUserValue($this->userId, Application::APP_ID, 'mode', strval($mode)); @@ -92,7 +98,7 @@ class WeatherStatusService { /** * Set favorites list * @param string[] $favorites - * @return array success state + * @return WeatherStatusSuccess success state */ public function setFavorites(array $favorites): array { $this->config->setUserValue($this->userId, Application::APP_ID, 'favorites', json_encode($favorites)); @@ -102,7 +108,7 @@ class WeatherStatusService { /** * Try to use the address set in user personal settings as weather location * - * @return array with success state and address information + * @return WeatherStatusLocationWithSuccess with success state and address information */ public function usePersonalAddress(): array { $account = $this->accountManager->getAccount($this->userManager->get($this->userId)); @@ -124,7 +130,7 @@ class WeatherStatusService { * @param string|null $address Any approximative or exact address * @param float|null $lat Latitude in decimal degree format * @param float|null $lon Longitude in decimal degree format - * @return array with success state and address information + * @return WeatherStatusLocationWithSuccess with success state and address information */ public function setLocation(?string $address, ?float $lat, ?float $lon): array { if (!is_null($lat) && !is_null($lon)) { @@ -228,7 +234,7 @@ class WeatherStatusService { * Set address and resolve it to get coordinates * * @param string $address Any approximative or exact address - * @return array with success state and address information (coordinates and formatted address) + * @return WeatherStatusLocationWithSuccess with success state and address information (coordinates and formatted address) */ public function setAddress(string $address): array { $addressInfo = $this->searchForAddress($address); @@ -256,7 +262,7 @@ class WeatherStatusService { * Ask nominatim information about an unformatted address * * @param string Unformatted address - * @return array Full Nominatim result for the given address + * @return array{display_name?: string, lat?: string, lon?: string, error?: string} Full Nominatim result for the given address */ private function searchForAddress(string $address): array { $params = [ @@ -278,7 +284,7 @@ class WeatherStatusService { /** * Get stored user location * - * @return array which contains coordinates, formatted address and current weather status mode + * @return WeatherStatusLocationWithMode which contains coordinates, formatted address and current weather status mode */ public function getLocation(): array { $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', ''); @@ -296,7 +302,7 @@ class WeatherStatusService { /** * Get forecast for current location * - * @return array which contains success state and filtered forecast data + * @return WeatherStatusForecast[]|array{error: string}|WeatherStatusSuccess which contains success state and filtered forecast data */ public function getForecast(): array { $lat = $this->config->getUserValue($this->userId, Application::APP_ID, 'lat', ''); @@ -319,7 +325,7 @@ class WeatherStatusService { * @param float $lon Longitude of requested forecast, in decimal degree format * @param float $altitude Altitude of requested forecast, in meter * @param int $nbValues Number of forecast values (hours) - * @return array Filtered forecast data + * @return WeatherStatusForecast[]|array{error: string} Filtered forecast data */ private function forecastRequest(float $lat, float $lon, float $altitude, int $nbValues = 10): array { $params = [ diff --git a/apps/weather_status/openapi.json b/apps/weather_status/openapi.json index b0356acab52..0605016ea97 100644 --- a/apps/weather_status/openapi.json +++ b/apps/weather_status/openapi.json @@ -185,6 +185,53 @@ } } }, + "Location": { + "type": "object", + "properties": { + "lat": { + "type": "string" + }, + "lon": { + "type": "string" + }, + "address": { + "type": "string", + "nullable": true + } + } + }, + "LocationWithMode": { + "allOf": [ + { + "$ref": "#/components/schemas/Location" + }, + { + "$ref": "#/components/schemas/Mode" + } + ] + }, + "LocationWithSuccess": { + "allOf": [ + { + "$ref": "#/components/schemas/Location" + }, + { + "$ref": "#/components/schemas/Success" + } + ] + }, + "Mode": { + "type": "object", + "required": [ + "mode" + ], + "properties": { + "mode": { + "type": "integer", + "format": "int64" + } + } + }, "OCSMeta": { "type": "object", "required": [ @@ -208,6 +255,17 @@ "type": "string" } } + }, + "Success": { + "type": "object", + "required": [ + "success" + ], + "properties": { + "success": { + "type": "boolean" + } + } } } }, @@ -271,15 +329,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "type": "object", - "required": [ - "success" - ], - "properties": { - "success": { - "type": "boolean" - } - } + "$ref": "#/components/schemas/Success" } } } @@ -340,32 +390,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "type": "object", - "required": [ - "success", - "lat", - "lon", - "address" - ], - "properties": { - "success": { - "type": "boolean" - }, - "lat": { - "type": "number", - "format": "float", - "nullable": true - }, - "lon": { - "type": "number", - "format": "float", - "nullable": true - }, - "address": { - "type": "string", - "nullable": true - } - } + "$ref": "#/components/schemas/LocationWithSuccess" } } } @@ -426,30 +451,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "type": "object", - "required": [ - "lat", - "lon", - "address", - "mode" - ], - "properties": { - "lat": { - "type": "number", - "format": "float" - }, - "lon": { - "type": "number", - "format": "float" - }, - "address": { - "type": "string" - }, - "mode": { - "type": "integer", - "format": "int64" - } - } + "$ref": "#/components/schemas/LocationWithMode" } } } @@ -537,32 +539,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "type": "object", - "required": [ - "success", - "lat", - "lon", - "address" - ], - "properties": { - "success": { - "type": "boolean" - }, - "lat": { - "type": "number", - "format": "float", - "nullable": true - }, - "lon": { - "type": "number", - "format": "float", - "nullable": true - }, - "address": { - "type": "string", - "nullable": true - } - } + "$ref": "#/components/schemas/LocationWithSuccess" } } } @@ -623,10 +600,25 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Forecast" - } + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/Forecast" + } + }, + { + "type": "object", + "required": [ + "error" + ], + "properties": { + "error": { + "type": "string" + } + } + } + ] } } } @@ -656,15 +648,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "type": "object", - "required": [ - "success" - ], - "properties": { - "success": { - "type": "boolean" - } - } + "$ref": "#/components/schemas/Success" } } } @@ -799,15 +783,7 @@ "$ref": "#/components/schemas/OCSMeta" }, "data": { - "type": "object", - "required": [ - "success" - ], - "properties": { - "success": { - "type": "boolean" - } - } + "$ref": "#/components/schemas/Success" } } } diff --git a/core/css/header.css b/core/css/header.css index 9f12407f7f4..e6e8452560c 100644 --- a/core/css/header.css +++ b/core/css/header.css @@ -1 +1 @@ -#header,#expanddiv{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#header a:not(.button):focus-visible,#header button:not(.button-vue):focus-visible,#header div[role=button]:focus-visible,#expanddiv a:not(.button):focus-visible,#expanddiv button:not(.button-vue):focus-visible,#expanddiv div[role=button]:focus-visible{outline:none}#header a:not(.button):focus-visible::after,#header .button-vue:focus-visible::after,#header div[role=button]:focus-visible::after,#expanddiv a:not(.button):focus-visible::after,#expanddiv .button-vue:focus-visible::after,#expanddiv div[role=button]:focus-visible::after{content:" ";position:absolute;transform:translateX(-50%);width:12px;height:2px;border-radius:3px;background-color:var(--color-primary-text);left:50%;opacity:1}#header a:not(.button):focus-visible::after,#header .button-vue:focus-visible::after,#expanddiv a:not(.button):focus-visible::after,#expanddiv .button-vue:focus-visible::after{bottom:2px}#header .header-right a:not(.button):focus-visible::after,#header .header-right div[role=button]:focus-visible::after,#expanddiv .header-right a:not(.button):focus-visible::after,#expanddiv .header-right div[role=button]:focus-visible::after{bottom:4px}#header .header-right #expand.menutoggle:focus-visible::after,#expanddiv .header-right #expand.menutoggle:focus-visible::after{left:40%}#body-user #header,#body-settings #header,#body-public #header{display:inline-flex;position:absolute;top:0;width:100%;z-index:2000;height:50px;box-sizing:border-box;justify-content:space-between}#nextcloud{padding:5px 0;padding-left:86px;position:relative;height:calc(100% - 4px);box-sizing:border-box;opacity:1;align-items:center;display:flex;flex-wrap:wrap;overflow:hidden;margin:2px}#nextcloud:hover,#nextcloud:active{opacity:1}#header .header-right>div>.menu{background-color:var(--color-main-background);filter:drop-shadow(0 1px 5px var(--color-box-shadow));border-radius:var(--border-radius-large);box-sizing:border-box;z-index:2000;position:absolute;max-width:350px;min-height:66px;max-height:calc(100vh - 50px - 8px);right:8px;top:50px;margin:0;overflow-y:auto}#header .header-right>div>.menu:not(.popovermenu){display:none}#header .header-right>div>.menu:after{border:10px solid rgba(0,0,0,0);border-bottom-color:var(--color-main-background);bottom:100%;content:" ";height:0;width:0;position:absolute;pointer-events:none;right:10px}#header .header-right>div>.menu>div,#header .header-right>div>.menu>ul{-webkit-overflow-scrolling:touch;min-height:66px;max-height:calc(100vh - 50px - 8px)}#header .logo{display:inline-flex;background-image:var(--image-logoheader, var(--image-logo, url("../img/logo/logo.svg")));background-repeat:no-repeat;background-size:contain;background-position:center;width:62px;position:absolute;left:12px;top:1px;bottom:1px;filter:var(--image-logoheader-custom, var(--background-image-invert-if-bright))}#header .header-appname-container{display:none;padding-right:10px;flex-shrink:0}#header #header-left,#header .header-left,#header #header-right,#header .header-right{display:inline-flex;align-items:center}#header #header-left,#header .header-left{flex:1 0;white-space:nowrap;min-width:0}#header #header-right,#header .header-right{justify-content:flex-end;flex-shrink:1}#header .header-right>.header-menu:not(.user-menu){filter:var(--background-image-invert-if-bright)}#header .header-right>div,#header .header-right>form{height:100%;position:relative}#header .header-right>div>.menutoggle,#header .header-right>form>.menutoggle{display:flex;justify-content:center;align-items:center;width:50px;height:44px;cursor:pointer;opacity:.85;padding:0;margin:2px 0}#header .header-right>div>.menutoggle:focus,#header .header-right>form>.menutoggle:focus{opacity:1}#header .header-right>div>.menutoggle:focus-visible,#header .header-right>form>.menutoggle:focus-visible{outline:none}.header-appname-container .header-appname{opacity:.75}.header-appname{color:var(--color-primary-element-text);font-size:16px;font-weight:bold;margin:0;padding:0;padding-right:5px;overflow:hidden;text-overflow:ellipsis;flex:1 1 100%}.header-shared-by{color:var(--color-primary-element-text);position:relative;font-weight:300;font-size:11px;line-height:11px;overflow:hidden;text-overflow:ellipsis}#skip-actions{position:absolute;overflow:hidden;z-index:9999;top:-999px;left:3px;padding:11px;display:flex;flex-wrap:wrap;gap:11px}#skip-actions:focus-within{top:50px}header #emptycontent h2,header .emptycontent h2{font-weight:normal;font-size:16px}header #emptycontent [class^=icon-],header #emptycontent [class*=icon-],header .emptycontent [class^=icon-],header .emptycontent [class*=icon-]{background-size:48px;height:48px;width:48px}/*# sourceMappingURL=header.css.map */ +#header,#expanddiv{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#header a:not(.button):focus-visible,#header button:not(.button-vue):focus-visible,#header div[role=button]:focus-visible,#expanddiv a:not(.button):focus-visible,#expanddiv button:not(.button-vue):focus-visible,#expanddiv div[role=button]:focus-visible{outline:none}#header a:not(.button):focus-visible::after,#header .button-vue:focus-visible::after,#header div[role=button]:focus-visible::after,#expanddiv a:not(.button):focus-visible::after,#expanddiv .button-vue:focus-visible::after,#expanddiv div[role=button]:focus-visible::after{content:" ";position:absolute;transform:translateX(-50%);width:12px;height:2px;border-radius:3px;background-color:var(--color-primary-text);left:50%;opacity:1}#header a:not(.button):focus-visible::after,#header .button-vue:focus-visible::after,#expanddiv a:not(.button):focus-visible::after,#expanddiv .button-vue:focus-visible::after{bottom:2px}#header .header-right a:not(.button):focus-visible::after,#header .header-right div[role=button]:focus-visible::after,#expanddiv .header-right a:not(.button):focus-visible::after,#expanddiv .header-right div[role=button]:focus-visible::after{bottom:4px}#header .header-right #expand.menutoggle:focus-visible::after,#expanddiv .header-right #expand.menutoggle:focus-visible::after{left:40%}#body-user #header,#body-settings #header,#body-public #header{display:inline-flex;position:absolute;top:0;width:100%;z-index:2000;height:50px;box-sizing:border-box;justify-content:space-between}#nextcloud{padding:5px 0;padding-left:86px;position:relative;height:calc(100% - 4px);box-sizing:border-box;opacity:1;align-items:center;display:flex;flex-wrap:wrap;overflow:hidden;margin:2px}#nextcloud:hover,#nextcloud:active{opacity:1}#header .header-right>div>.menu{background-color:var(--color-main-background);filter:drop-shadow(0 1px 5px var(--color-box-shadow));border-radius:var(--border-radius-large);box-sizing:border-box;z-index:2000;position:absolute;max-width:350px;min-height:66px;max-height:calc(100vh - 50px - 8px);right:8px;top:50px;margin:0;overflow-y:auto}#header .header-right>div>.menu:not(.popovermenu){display:none}#header .header-right>div>.menu:after{border:10px solid rgba(0,0,0,0);border-bottom-color:var(--color-main-background);bottom:100%;content:" ";height:0;width:0;position:absolute;pointer-events:none;right:10px}#header .header-right>div>.menu>div,#header .header-right>div>.menu>ul{-webkit-overflow-scrolling:touch;min-height:66px;max-height:calc(100vh - 50px - 8px)}#header .logo{display:inline-flex;background-image:var(--image-logoheader, var(--image-logo, url("../img/logo/logo.svg")));background-repeat:no-repeat;background-size:contain;background-position:center;width:62px;position:absolute;left:12px;top:1px;bottom:1px;filter:var(--image-logoheader-custom, var(--background-image-invert-if-bright))}#header .header-appname-container{display:none;padding-right:10px;flex-shrink:0}#header #header-left,#header .header-left,#header #header-right,#header .header-right{display:inline-flex;align-items:center}#header #header-left,#header .header-left{flex:1 0;white-space:nowrap;min-width:0}#header #header-right,#header .header-right{justify-content:flex-end;flex-shrink:1}#header .header-right>.header-menu:not(.user-menu)>.header-menu__trigger{filter:var(--background-image-invert-if-bright) !important}#header .header-right>.header-menu:not(.user-menu)>.trigger{filter:var(--background-image-invert-if-bright) !important}#header .header-right>.header-menu:not(.user-menu) .unified-search__trigger{filter:var(--background-image-invert-if-bright) !important}#header .header-right>div,#header .header-right>form{height:100%;position:relative}#header .header-right>div>.menutoggle,#header .header-right>form>.menutoggle{display:flex;justify-content:center;align-items:center;width:50px;height:44px;cursor:pointer;opacity:.85;padding:0;margin:2px 0}#header .header-right>div>.menutoggle:focus,#header .header-right>form>.menutoggle:focus{opacity:1}#header .header-right>div>.menutoggle:focus-visible,#header .header-right>form>.menutoggle:focus-visible{outline:none}.header-appname-container .header-appname{opacity:.75}.header-appname{color:var(--color-primary-element-text);font-size:16px;font-weight:bold;margin:0;padding:0;padding-right:5px;overflow:hidden;text-overflow:ellipsis;flex:1 1 100%}.header-shared-by{color:var(--color-primary-element-text);position:relative;font-weight:300;font-size:11px;line-height:11px;overflow:hidden;text-overflow:ellipsis}#skip-actions{position:absolute;overflow:hidden;z-index:9999;top:-999px;left:3px;padding:11px;display:flex;flex-wrap:wrap;gap:11px}#skip-actions:focus-within{top:50px}header #emptycontent h2,header .emptycontent h2{font-weight:normal;font-size:16px}header #emptycontent [class^=icon-],header #emptycontent [class*=icon-],header .emptycontent [class^=icon-],header .emptycontent [class*=icon-]{background-size:48px;height:48px;width:48px}/*# sourceMappingURL=header.css.map */ diff --git a/core/css/header.css.map b/core/css/header.css.map index a1e56f9145a..6e7a7a08ae7 100644 --- a/core/css/header.css.map +++ b/core/css/header.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["header.scss","variables.scss"],"names":[],"mappings":"AAiBA,mBAEC,yBACA,sBACA,qBACA,6PACC,aAGD,+QACC,YACA,kBACA,2BACA,WACA,WACA,kBACA,2CACA,SACA,UAGD,gLACC,WAIA,kPACC,WAGD,+HACC,SAOH,+DAGC,oBACA,kBACA,MACA,WACA,aACA,OC2Ce,KD1Cf,sBACA,8BAID,WACC,cACA,kBACA,kBACA,wBACA,sBACA,UACA,mBACA,aACA,eACA,gBACA,WAEA,mCACC,UAaD,gCACC,8CACA,sDACA,yCACA,sBACA,aACA,kBACA,gBAfD,gBACA,oCAgBC,UACA,SACA,SACA,gBAEA,kDACC,aAID,sCACC,gCACA,iDACA,YACA,YACA,SACA,QACA,kBACA,oBACA,WAGD,uEAEC,iCAzCF,gBACA,oCA4CA,cACC,oBACA,yFACA,4BACA,wBACA,2BACA,WACA,kBACA,UACA,QACA,WAEA,gFAGD,kCACC,aACA,mBACA,cAGD,sFAEC,oBACA,mBAGD,0CACC,SACA,mBACA,YAGD,4CACC,yBACA,cAKA,mDACC,gDAED,qDAEC,YACA,kBACA,6EACC,aACA,uBACA,mBACA,MC9EY,KD+EZ,YACA,eACA,YACA,UACA,aAEA,yFACC,UAGD,yGACC,aASL,0CACC,YAKD,gBACC,wCACA,eACA,iBACA,SACA,UACA,kBACA,gBACA,uBAEA,cAGD,kBACC,wCACA,kBACA,gBACA,eACA,iBACA,gBACA,uBAID,cACC,kBACA,gBACA,aACA,WACA,SACA,aACA,aACA,eACA,SAEA,2BACC,IC7Ic,KDoJf,gDACC,mBACA,eAED,gJAEC,qBACA,YACA","file":"header.css"}
\ No newline at end of file +{"version":3,"sourceRoot":"","sources":["header.scss","variables.scss"],"names":[],"mappings":"AAiBA,mBAEC,yBACA,sBACA,qBACA,6PACC,aAGD,+QACC,YACA,kBACA,2BACA,WACA,WACA,kBACA,2CACA,SACA,UAGD,gLACC,WAIA,kPACC,WAGD,+HACC,SAOH,+DAGC,oBACA,kBACA,MACA,WACA,aACA,OC2Ce,KD1Cf,sBACA,8BAID,WACC,cACA,kBACA,kBACA,wBACA,sBACA,UACA,mBACA,aACA,eACA,gBACA,WAEA,mCACC,UAaD,gCACC,8CACA,sDACA,yCACA,sBACA,aACA,kBACA,gBAfD,gBACA,oCAgBC,UACA,SACA,SACA,gBAEA,kDACC,aAID,sCACC,gCACA,iDACA,YACA,YACA,SACA,QACA,kBACA,oBACA,WAGD,uEAEC,iCAzCF,gBACA,oCA4CA,cACC,oBACA,yFACA,4BACA,wBACA,2BACA,WACA,kBACA,UACA,QACA,WAEA,gFAGD,kCACC,aACA,mBACA,cAGD,sFAEC,oBACA,mBAGD,0CACC,SACA,mBACA,YAGD,4CACC,yBACA,cAOC,yEACC,2DAID,4DACC,2DAID,4EACC,2DAGF,qDAEC,YACA,kBACA,6EACC,aACA,uBACA,mBACA,MC3FY,KD4FZ,YACA,eACA,YACA,UACA,aAEA,yFACC,UAGD,yGACC,aASL,0CACC,YAKD,gBACC,wCACA,eACA,iBACA,SACA,UACA,kBACA,gBACA,uBAEA,cAGD,kBACC,wCACA,kBACA,gBACA,eACA,iBACA,gBACA,uBAID,cACC,kBACA,gBACA,aACA,WACA,SACA,aACA,aACA,eACA,SAEA,2BACC,IC1Jc,KDiKf,gDACC,mBACA,eAED,gJAEC,qBACA,YACA","file":"header.css"}
\ No newline at end of file diff --git a/core/css/header.scss b/core/css/header.scss index 7a0eb0546a7..ca4a1a6331e 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -172,7 +172,20 @@ /* Right header standard */ .header-right { > .header-menu:not(.user-menu) { - filter: var(--background-image-invert-if-bright); + // For general + > .header-menu__trigger { + filter: var(--background-image-invert-if-bright) !important; + } + + // For assistant button + > .trigger { + filter: var(--background-image-invert-if-bright) !important; + } + + // For unified search button + .unified-search__trigger { + filter: var(--background-image-invert-if-bright) !important; + } } > div, > form { diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 772a4103490..a411326c93f 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -460,7 +460,8 @@ class Session implements IUserSession, Emitter { if ($isTokenPassword) { $dbToken = $this->tokenProvider->getToken($password); $userFromToken = $this->manager->get($dbToken->getUID()); - $isValidEmailLogin = $userFromToken->getEMailAddress() === $user; + $isValidEmailLogin = $userFromToken->getEMailAddress() === $user + && $this->validateTokenLoginName($userFromToken->getEMailAddress(), $dbToken); } else { $users = $this->manager->getByEmail($user); $isValidEmailLogin = (\count($users) === 1 && $this->login($users[0]->getUID(), $password)); @@ -800,18 +801,7 @@ class Session implements IUserSession, Emitter { return false; } - // Check if login names match - if (!is_null($user) && $dbToken->getLoginName() !== $user) { - // TODO: this makes it impossible to use different login names on browser and client - // e.g. login by e-mail 'user@example.com' on browser for generating the token will not - // allow to use the client token with the login name 'user'. - $this->logger->error('App token login name does not match', [ - 'tokenLoginName' => $dbToken->getLoginName(), - 'sessionLoginName' => $user, - 'app' => 'core', - 'user' => $dbToken->getUID(), - ]); - + if (!is_null($user) && !$this->validateTokenLoginName($user, $dbToken)) { return false; } @@ -832,6 +822,27 @@ class Session implements IUserSession, Emitter { } /** + * Check if login names match + */ + private function validateTokenLoginName(?string $loginName, IToken $token): bool { + if ($token->getLoginName() !== $loginName) { + // TODO: this makes it impossible to use different login names on browser and client + // e.g. login by e-mail 'user@example.com' on browser for generating the token will not + // allow to use the client token with the login name 'user'. + $this->logger->error('App token login name does not match', [ + 'tokenLoginName' => $token->getLoginName(), + 'sessionLoginName' => $loginName, + 'app' => 'core', + 'user' => $token->getUID(), + ]); + + return false; + } + + return true; + } + + /** * Tries to login the user with auth token header * * @param IRequest $request |