@@ -141,47 +141,47 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | public function getImprintUrl() { |
| 144 | - return (string)$this->config->getAppValue('theming', 'imprintUrl', ''); |
|
| 144 | + return (string) $this->config->getAppValue('theming', 'imprintUrl', ''); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | public function getPrivacyUrl() { |
| 148 | - return (string)$this->config->getAppValue('theming', 'privacyUrl', ''); |
|
| 148 | + return (string) $this->config->getAppValue('theming', 'privacyUrl', ''); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | public function getShortFooter() { |
| 152 | 152 | $slogan = $this->getSlogan(); |
| 153 | 153 | $baseUrl = $this->getBaseUrl(); |
| 154 | 154 | if ($baseUrl !== '') { |
| 155 | - $footer = '<a href="' . $baseUrl . '" target="_blank"' . |
|
| 156 | - ' rel="noreferrer noopener" class="entity-name">' . $this->getEntity() . '</a>'; |
|
| 155 | + $footer = '<a href="'.$baseUrl.'" target="_blank"'. |
|
| 156 | + ' rel="noreferrer noopener" class="entity-name">'.$this->getEntity().'</a>'; |
|
| 157 | 157 | } else { |
| 158 | - $footer = '<span class="entity-name">' .$this->getEntity() . '</span>'; |
|
| 158 | + $footer = '<span class="entity-name">'.$this->getEntity().'</span>'; |
|
| 159 | 159 | } |
| 160 | - $footer .= ($slogan !== '' ? ' – ' . $slogan : ''); |
|
| 160 | + $footer .= ($slogan !== '' ? ' – '.$slogan : ''); |
|
| 161 | 161 | |
| 162 | 162 | $links = [ |
| 163 | 163 | [ |
| 164 | 164 | 'text' => $this->l->t('Legal notice'), |
| 165 | - 'url' => (string)$this->getImprintUrl() |
|
| 165 | + 'url' => (string) $this->getImprintUrl() |
|
| 166 | 166 | ], |
| 167 | 167 | [ |
| 168 | 168 | 'text' => $this->l->t('Privacy policy'), |
| 169 | - 'url' => (string)$this->getPrivacyUrl() |
|
| 169 | + 'url' => (string) $this->getPrivacyUrl() |
|
| 170 | 170 | ], |
| 171 | 171 | ]; |
| 172 | 172 | |
| 173 | 173 | $legalLinks = ''; $divider = ''; |
| 174 | - foreach($links as $link) { |
|
| 175 | - if($link['url'] !== '' |
|
| 174 | + foreach ($links as $link) { |
|
| 175 | + if ($link['url'] !== '' |
|
| 176 | 176 | && filter_var($link['url'], FILTER_VALIDATE_URL) |
| 177 | 177 | ) { |
| 178 | - $legalLinks .= $divider . '<a href="' . $link['url'] . '" class="legal" target="_blank"' . |
|
| 179 | - ' rel="noreferrer noopener">' . $link['text'] . '</a>'; |
|
| 178 | + $legalLinks .= $divider.'<a href="'.$link['url'].'" class="legal" target="_blank"'. |
|
| 179 | + ' rel="noreferrer noopener">'.$link['text'].'</a>'; |
|
| 180 | 180 | $divider = ' · '; |
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | - if($legalLinks !== '' ) { |
|
| 184 | - $footer .= '<br/>' . $legalLinks; |
|
| 183 | + if ($legalLinks !== '') { |
|
| 184 | + $footer .= '<br/>'.$legalLinks; |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | return $footer; |
@@ -214,16 +214,16 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
| 216 | 216 | |
| 217 | - if(!$logo || !$logoExists) { |
|
| 218 | - if($useSvg) { |
|
| 217 | + if (!$logo || !$logoExists) { |
|
| 218 | + if ($useSvg) { |
|
| 219 | 219 | $logo = $this->urlGenerator->imagePath('core', 'logo/logo.svg'); |
| 220 | 220 | } else { |
| 221 | 221 | $logo = $this->urlGenerator->imagePath('core', 'logo/logo.png'); |
| 222 | 222 | } |
| 223 | - return $logo . '?v=' . $cacheBusterCounter; |
|
| 223 | + return $logo.'?v='.$cacheBusterCounter; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter ]); |
|
| 226 | + return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter]); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -261,17 +261,17 @@ discard block |
||
| 261 | 261 | * @return array scss variables to overwrite |
| 262 | 262 | */ |
| 263 | 263 | public function getScssVariables() { |
| 264 | - $cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl()); |
|
| 264 | + $cache = $this->cacheFactory->createDistributed('theming-'.$this->urlGenerator->getBaseUrl()); |
|
| 265 | 265 | if ($value = $cache->get('getScssVariables')) { |
| 266 | 266 | return $value; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | $variables = [ |
| 270 | - 'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'", |
|
| 271 | - 'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime') . "'", |
|
| 272 | - 'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime') . "'", |
|
| 273 | - 'theming-logoheader-mime' => "'" . $this->config->getAppValue('theming', 'logoheaderMime') . "'", |
|
| 274 | - 'theming-favicon-mime' => "'" . $this->config->getAppValue('theming', 'faviconMime') . "'" |
|
| 270 | + 'theming-cachebuster' => "'".$this->config->getAppValue('theming', 'cachebuster', '0')."'", |
|
| 271 | + 'theming-logo-mime' => "'".$this->config->getAppValue('theming', 'logoMime')."'", |
|
| 272 | + 'theming-background-mime' => "'".$this->config->getAppValue('theming', 'backgroundMime')."'", |
|
| 273 | + 'theming-logoheader-mime' => "'".$this->config->getAppValue('theming', 'logoheaderMime')."'", |
|
| 274 | + 'theming-favicon-mime' => "'".$this->config->getAppValue('theming', 'faviconMime')."'" |
|
| 275 | 275 | ]; |
| 276 | 276 | |
| 277 | 277 | $variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')"; |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | $variables['has-legal-links'] = 'false'; |
| 294 | - if($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') { |
|
| 294 | + if ($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') { |
|
| 295 | 295 | $variables['has-legal-links'] = 'true'; |
| 296 | 296 | } |
| 297 | 297 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | * @return bool|string false if image should not replaced, otherwise the location of the image |
| 309 | 309 | */ |
| 310 | 310 | public function replaceImagePath($app, $image) { |
| 311 | - if($app==='') { |
|
| 311 | + if ($app === '') { |
|
| 312 | 312 | $app = 'core'; |
| 313 | 313 | } |
| 314 | 314 | $cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0'); |
@@ -320,19 +320,19 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | if ($image === 'favicon.ico' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) { |
| 323 | - return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
| 323 | + return $this->urlGenerator->linkToRoute('theming.Icon.getFavicon', ['app' => $app]).'?v='.$cacheBusterValue; |
|
| 324 | 324 | } |
| 325 | 325 | if ($image === 'favicon-touch.png' && ($customFavicon !== null || $this->imageManager->shouldReplaceIcons())) { |
| 326 | - return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]) . '?v=' . $cacheBusterValue; |
|
| 326 | + return $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon', ['app' => $app]).'?v='.$cacheBusterValue; |
|
| 327 | 327 | } |
| 328 | 328 | if ($image === 'manifest.json') { |
| 329 | 329 | try { |
| 330 | 330 | $appPath = $this->appManager->getAppPath($app); |
| 331 | - if (file_exists($appPath . '/img/manifest.json')) { |
|
| 331 | + if (file_exists($appPath.'/img/manifest.json')) { |
|
| 332 | 332 | return false; |
| 333 | 333 | } |
| 334 | 334 | } catch (AppPathNotFoundException $e) {} |
| 335 | - return $this->urlGenerator->linkToRoute('theming.Theming.getManifest') . '?v=' . $cacheBusterValue; |
|
| 335 | + return $this->urlGenerator->linkToRoute('theming.Theming.getManifest').'?v='.$cacheBusterValue; |
|
| 336 | 336 | } |
| 337 | 337 | return false; |
| 338 | 338 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | private function increaseCacheBuster() { |
| 344 | 344 | $cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0'); |
| 345 | - $this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1); |
|
| 345 | + $this->config->setAppValue('theming', 'cachebuster', (int) $cacheBusterKey + 1); |
|
| 346 | 346 | $this->cacheFactory->createDistributed('theming-')->clear(); |
| 347 | 347 | $this->cacheFactory->createDistributed('imagePath')->clear(); |
| 348 | 348 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function invertTextColor($color) { |
| 65 | 65 | $l = $this->calculateLuma($color); |
| 66 | - if($l>0.6) { |
|
| 66 | + if ($l > 0.6) { |
|
| 67 | 67 | return true; |
| 68 | 68 | } else { |
| 69 | 69 | return false; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function elementColor($color) { |
| 80 | 80 | $l = $this->calculateLuminance($color); |
| 81 | - if($l>0.8) { |
|
| 81 | + if ($l > 0.8) { |
|
| 82 | 82 | return '#dddddd'; |
| 83 | 83 | } |
| 84 | 84 | return $color; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | list($red, $green, $blue) = $this->hexToRGB($color); |
| 93 | 93 | $compiler = new Compiler(); |
| 94 | 94 | $hsl = $compiler->toHSL($red, $green, $blue); |
| 95 | - return $hsl[3]/100; |
|
| 95 | + return $hsl[3] / 100; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function calculateLuma($color) { |
| 103 | 103 | list($red, $green, $blue) = $this->hexToRGB($color); |
| 104 | - return (0.2126 * $red + 0.7152 * $green + 0.0722 * $blue) / 255; |
|
| 104 | + return (0.2126 * $red + 0.7152 * $green + 0.0722 * $blue) / 255; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | public function hexToRGB($color) { |
| 112 | 112 | $hex = preg_replace("/[^0-9A-Fa-f]/", '', $color); |
| 113 | 113 | if (strlen($hex) === 3) { |
| 114 | - $hex = $hex{0} . $hex{0} . $hex{1} . $hex{1} . $hex{2} . $hex{2}; |
|
| 114 | + $hex = $hex{0}.$hex{0}.$hex{1}.$hex{1}.$hex{2}.$hex{2}; |
|
| 115 | 115 | } |
| 116 | 116 | if (strlen($hex) !== 6) { |
| 117 | 117 | return 0; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * @return string base64 encoded radio button svg |
| 129 | 129 | */ |
| 130 | 130 | public function generateRadioButton($color) { |
| 131 | - $radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">' . |
|
| 131 | + $radioButtonIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16">'. |
|
| 132 | 132 | '<path d="M8 1a7 7 0 0 0-7 7 7 7 0 0 0 7 7 7 7 0 0 0 7-7 7 7 0 0 0-7-7zm0 1a6 6 0 0 1 6 6 6 6 0 0 1-6 6 6 6 0 0 1-6-6 6 6 0 0 1 6-6zm0 2a4 4 0 1 0 0 8 4 4 0 0 0 0-8z" fill="'.$color.'"/></svg>'; |
| 133 | 133 | return base64_encode($radioButtonIcon); |
| 134 | 134 | } |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | $app = str_replace(array('\0', '/', '\\', '..'), '', $app); |
| 143 | 143 | try { |
| 144 | 144 | $appPath = $this->appManager->getAppPath($app); |
| 145 | - $icon = $appPath . '/img/' . $app . '.svg'; |
|
| 145 | + $icon = $appPath.'/img/'.$app.'.svg'; |
|
| 146 | 146 | if (file_exists($icon)) { |
| 147 | 147 | return $icon; |
| 148 | 148 | } |
| 149 | - $icon = $appPath . '/img/app.svg'; |
|
| 149 | + $icon = $appPath.'/img/app.svg'; |
|
| 150 | 150 | if (file_exists($icon)) { |
| 151 | 151 | return $icon; |
| 152 | 152 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | } catch (NotFoundException $e) {} |
| 163 | 163 | } |
| 164 | - return \OC::$SERVERROOT . '/core/img/logo/logo.svg'; |
|
| 164 | + return \OC::$SERVERROOT.'/core/img/logo/logo.svg'; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $app = str_replace(array('\0', '/', '\\', '..'), '', $app); |
| 174 | 174 | $image = str_replace(array('\0', '\\', '..'), '', $image); |
| 175 | 175 | if ($app === "core") { |
| 176 | - $icon = \OC::$SERVERROOT . '/core/img/' . $image; |
|
| 176 | + $icon = \OC::$SERVERROOT.'/core/img/'.$image; |
|
| 177 | 177 | if (file_exists($icon)) { |
| 178 | 178 | return $icon; |
| 179 | 179 | } |
@@ -185,23 +185,23 @@ discard block |
||
| 185 | 185 | return false; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - $icon = $appPath . '/img/' . $image; |
|
| 188 | + $icon = $appPath.'/img/'.$image; |
|
| 189 | 189 | if (file_exists($icon)) { |
| 190 | 190 | return $icon; |
| 191 | 191 | } |
| 192 | - $icon = $appPath . '/img/' . $image . '.svg'; |
|
| 192 | + $icon = $appPath.'/img/'.$image.'.svg'; |
|
| 193 | 193 | if (file_exists($icon)) { |
| 194 | 194 | return $icon; |
| 195 | 195 | } |
| 196 | - $icon = $appPath . '/img/' . $image . '.png'; |
|
| 196 | + $icon = $appPath.'/img/'.$image.'.png'; |
|
| 197 | 197 | if (file_exists($icon)) { |
| 198 | 198 | return $icon; |
| 199 | 199 | } |
| 200 | - $icon = $appPath . '/img/' . $image . '.gif'; |
|
| 200 | + $icon = $appPath.'/img/'.$image.'.gif'; |
|
| 201 | 201 | if (file_exists($icon)) { |
| 202 | 202 | return $icon; |
| 203 | 203 | } |
| 204 | - $icon = $appPath . '/img/' . $image . '.jpg'; |
|
| 204 | + $icon = $appPath.'/img/'.$image.'.jpg'; |
|
| 205 | 205 | if (file_exists($icon)) { |
| 206 | 206 | return $icon; |
| 207 | 207 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | public function isBackgroundThemed() { |
| 238 | - $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime',false); |
|
| 238 | + $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', false); |
|
| 239 | 239 | |
| 240 | 240 | $backgroundExists = true; |
| 241 | 241 | try { |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $cacheBusterCounter = $this->config->getAppValue('theming', 'cachebuster', '0'); |
| 76 | 76 | try { |
| 77 | 77 | $image = $this->getImage($key, $useSvg); |
| 78 | - return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => $key ]) . '?v=' . $cacheBusterCounter; |
|
| 78 | + return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => $key]).'?v='.$cacheBusterCounter; |
|
| 79 | 79 | } catch (NotFoundException $e) { |
| 80 | 80 | } |
| 81 | 81 | |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | case 'logo': |
| 84 | 84 | case 'logoheader': |
| 85 | 85 | case 'favicon': |
| 86 | - return $this->urlGenerator->imagePath('core', 'logo/logo.png') . '?v=' . $cacheBusterCounter; |
|
| 86 | + return $this->urlGenerator->imagePath('core', 'logo/logo.png').'?v='.$cacheBusterCounter; |
|
| 87 | 87 | case 'background': |
| 88 | - return $this->urlGenerator->imagePath('core', 'background.png') . '?v=' . $cacheBusterCounter; |
|
| 88 | + return $this->urlGenerator->imagePath('core', 'background.png').'?v='.$cacheBusterCounter; |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -102,26 +102,26 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function getImage(string $key, bool $useSvg = true): ISimpleFile { |
| 104 | 104 | $pngFile = null; |
| 105 | - $logo = $this->config->getAppValue('theming', $key . 'Mime', false); |
|
| 105 | + $logo = $this->config->getAppValue('theming', $key.'Mime', false); |
|
| 106 | 106 | $folder = $this->appData->getFolder('images'); |
| 107 | 107 | if ($logo === false || !$folder->fileExists($key)) { |
| 108 | 108 | throw new NotFoundException(); |
| 109 | 109 | } |
| 110 | 110 | if (!$useSvg && $this->shouldReplaceIcons()) { |
| 111 | - if (!$folder->fileExists($key . '.png')) { |
|
| 111 | + if (!$folder->fileExists($key.'.png')) { |
|
| 112 | 112 | try { |
| 113 | 113 | $finalIconFile = new \Imagick(); |
| 114 | 114 | $finalIconFile->setBackgroundColor('none'); |
| 115 | 115 | $finalIconFile->readImageBlob($folder->getFile($key)->getContent()); |
| 116 | 116 | $finalIconFile->setImageFormat('png32'); |
| 117 | - $pngFile = $folder->newFile($key . '.png'); |
|
| 117 | + $pngFile = $folder->newFile($key.'.png'); |
|
| 118 | 118 | $pngFile->putContent($finalIconFile->getImageBlob()); |
| 119 | 119 | } catch (\ImagickException $e) { |
| 120 | - $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: ' . $e->getMessage()); |
|
| 120 | + $this->logger->info('The image was requested to be no SVG file, but converting it to PNG failed: '.$e->getMessage()); |
|
| 121 | 121 | $pngFile = null; |
| 122 | 122 | } |
| 123 | 123 | } else { |
| 124 | - $pngFile = $folder->getFile($key . '.png'); |
|
| 124 | + $pngFile = $folder->getFile($key.'.png'); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | if ($pngFile !== null) { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $images = []; |
| 135 | 135 | foreach ($this->supportedImageKeys as $key) { |
| 136 | 136 | $images[$key] = [ |
| 137 | - 'mime' => $this->config->getAppValue('theming', $key . 'Mime', ''), |
|
| 137 | + 'mime' => $this->config->getAppValue('theming', $key.'Mime', ''), |
|
| 138 | 138 | 'url' => $this->getImageUrl($key), |
| 139 | 139 | ]; |
| 140 | 140 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | } catch (NotPermittedException $e) { |
| 201 | 201 | } |
| 202 | 202 | try { |
| 203 | - $file = $this->appData->getFolder('images')->getFile($key . '.png'); |
|
| 203 | + $file = $this->appData->getFolder('images')->getFile($key.'.png'); |
|
| 204 | 204 | $file->delete(); |
| 205 | 205 | } catch (NotFoundException $e) { |
| 206 | 206 | } catch (NotPermittedException $e) { |
@@ -230,12 +230,12 @@ discard block |
||
| 230 | 230 | * @return bool |
| 231 | 231 | */ |
| 232 | 232 | public function shouldReplaceIcons() { |
| 233 | - $cache = $this->cacheFactory->createDistributed('theming-' . $this->urlGenerator->getBaseUrl()); |
|
| 234 | - if($value = $cache->get('shouldReplaceIcons')) { |
|
| 235 | - return (bool)$value; |
|
| 233 | + $cache = $this->cacheFactory->createDistributed('theming-'.$this->urlGenerator->getBaseUrl()); |
|
| 234 | + if ($value = $cache->get('shouldReplaceIcons')) { |
|
| 235 | + return (bool) $value; |
|
| 236 | 236 | } |
| 237 | 237 | $value = false; |
| 238 | - if(extension_loaded('imagick')) { |
|
| 238 | + if (extension_loaded('imagick')) { |
|
| 239 | 239 | if (count(\Imagick::queryFormats('SVG')) >= 1) { |
| 240 | 240 | $value = true; |
| 241 | 241 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $this->defaultColorPrimary = '#0082c9'; |
| 71 | 71 | $this->defaultTextColorPrimary = '#ffffff'; |
| 72 | 72 | |
| 73 | - $themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php'; |
|
| 73 | + $themePath = OC::$SERVERROOT.'/themes/'.OC_Util::getTheme().'/defaults.php'; |
|
| 74 | 74 | if (file_exists($themePath)) { |
| 75 | 75 | // prevent defaults.php from printing output |
| 76 | 76 | ob_start(); |
@@ -241,9 +241,9 @@ discard block |
||
| 241 | 241 | if ($this->themeExist('getShortFooter')) { |
| 242 | 242 | $footer = $this->theme->getShortFooter(); |
| 243 | 243 | } else { |
| 244 | - $footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' . |
|
| 245 | - ' rel="noreferrer noopener">' .$this->getEntity() . '</a>'. |
|
| 246 | - ' – ' . $this->getSlogan(); |
|
| 244 | + $footer = '<a href="'.$this->getBaseUrl().'" target="_blank"'. |
|
| 245 | + ' rel="noreferrer noopener">'.$this->getEntity().'</a>'. |
|
| 246 | + ' – '.$this->getSlogan(); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | return $footer; |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | if ($this->themeExist('buildDocLinkToKey')) { |
| 272 | 272 | return $this->theme->buildDocLinkToKey($key); |
| 273 | 273 | } |
| 274 | - return $this->getDocBaseUrl() . '/server/' . $this->defaultDocVersion . '/go.php?to=' . $key; |
|
| 274 | + return $this->getDocBaseUrl().'/server/'.$this->defaultDocVersion.'/go.php?to='.$key; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | * @return array scss variables to overwrite |
| 294 | 294 | */ |
| 295 | 295 | public function getScssVariables() { |
| 296 | - if($this->themeExist('getScssVariables')) { |
|
| 296 | + if ($this->themeExist('getScssVariables')) { |
|
| 297 | 297 | return $this->theme->getScssVariables(); |
| 298 | 298 | } |
| 299 | 299 | return []; |
@@ -314,12 +314,12 @@ discard block |
||
| 314 | 314 | return $this->theme->getLogo($useSvg); |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | - if($useSvg) { |
|
| 317 | + if ($useSvg) { |
|
| 318 | 318 | $logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo/logo.svg'); |
| 319 | 319 | } else { |
| 320 | 320 | $logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo/logo.png'); |
| 321 | 321 | } |
| 322 | - return $logo . '?v=' . hash('sha1', implode('.', \OCP\Util::getVersion())); |
|
| 322 | + return $logo.'?v='.hash('sha1', implode('.', \OCP\Util::getVersion())); |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | public function getTextColorPrimary() { |
@@ -266,14 +266,14 @@ discard block |
||
| 266 | 266 | * @return RedirectResponse |
| 267 | 267 | */ |
| 268 | 268 | public function tryLogin($user, $password, $redirect_url, $remember_login = true, $timezone = '', $timezone_offset = '') { |
| 269 | - if(!is_string($user)) { |
|
| 269 | + if (!is_string($user)) { |
|
| 270 | 270 | throw new \InvalidArgumentException('Username must be string'); |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | // If the user is already logged in and the CSRF check does not pass then |
| 274 | 274 | // simply redirect the user to the correct page as required. This is the |
| 275 | 275 | // case when an user has already logged-in, in another tab. |
| 276 | - if(!$this->request->passesCSRFCheck()) { |
|
| 276 | + if (!$this->request->passesCSRFCheck()) { |
|
| 277 | 277 | return $this->generateRedirect($redirect_url); |
| 278 | 278 | } |
| 279 | 279 | |
@@ -286,8 +286,8 @@ discard block |
||
| 286 | 286 | $userObj = $this->userManager->get($user); |
| 287 | 287 | |
| 288 | 288 | if ($userObj !== null && $userObj->isEnabled() === false) { |
| 289 | - $this->logger->warning('Login failed: \''. $user . '\' disabled' . |
|
| 290 | - ' (Remote IP: \''. $this->request->getRemoteAddress(). '\')', |
|
| 289 | + $this->logger->warning('Login failed: \''.$user.'\' disabled'. |
|
| 290 | + ' (Remote IP: \''.$this->request->getRemoteAddress().'\')', |
|
| 291 | 291 | ['app' => 'core']); |
| 292 | 292 | return $this->createLoginFailedResponse($user, $originalUser, |
| 293 | 293 | $redirect_url, self::LOGIN_MSG_USERDISABLED); |
@@ -302,15 +302,15 @@ discard block |
||
| 302 | 302 | if (count($users) === 1) { |
| 303 | 303 | $previousUser = $user; |
| 304 | 304 | $user = $users[0]->getUID(); |
| 305 | - if($user !== $previousUser) { |
|
| 305 | + if ($user !== $previousUser) { |
|
| 306 | 306 | $loginResult = $this->userManager->checkPassword($user, $password); |
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | if ($loginResult === false) { |
| 312 | - $this->logger->warning('Login failed: \''. $user . |
|
| 313 | - '\' (Remote IP: \''. $this->request->getRemoteAddress(). '\')', |
|
| 312 | + $this->logger->warning('Login failed: \''.$user. |
|
| 313 | + '\' (Remote IP: \''.$this->request->getRemoteAddress().'\')', |
|
| 314 | 314 | ['app' => 'core']); |
| 315 | 315 | return $this->createLoginFailedResponse($user, $originalUser, |
| 316 | 316 | $redirect_url, self::LOGIN_MSG_INVALIDPASSWORD); |