@@ -50,7 +50,7 @@ |
||
50 | 50 | <?php endif ?> |
51 | 51 | <?php if (!is_null($_['backupProvider'])): ?> |
52 | 52 | <p> |
53 | - <a class="<?php if($noProviders): ?>button primary two-factor-primary<?php else: ?>two-factor-secondary<?php endif ?>" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', |
|
53 | + <a class="<?php if ($noProviders): ?>button primary two-factor-primary<?php else: ?>two-factor-secondary<?php endif ?>" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', |
|
54 | 54 | [ |
55 | 55 | 'challengeProviderId' => $_['backupProvider']->getId(), |
56 | 56 | 'redirect_url' => $_['redirect_url'], |
@@ -14,7 +14,7 @@ |
||
14 | 14 | <div class="body-login-container update"> |
15 | 15 | <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2> |
16 | 16 | <?php if ($error): ?> |
17 | - <?php if($error_message): ?> |
|
17 | + <?php if ($error_message): ?> |
|
18 | 18 | <p><strong><?php p($error_message); ?></strong></p> |
19 | 19 | <?php else: ?> |
20 | 20 | <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p> |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * Class OC_JSON |
37 | 37 | * @deprecated Use a AppFramework JSONResponse instead |
38 | 38 | */ |
39 | -class OC_JSON{ |
|
39 | +class OC_JSON { |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Check if the app is enabled, send json error msg if not |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | * @suppress PhanDeprecatedFunction |
46 | 46 | */ |
47 | 47 | public static function checkAppEnabled($app) { |
48 | - if( !\OC::$server->getAppManager()->isEnabledForUser($app)) { |
|
48 | + if (!\OC::$server->getAppManager()->isEnabledForUser($app)) { |
|
49 | 49 | $l = \OC::$server->getL10N('lib'); |
50 | - self::error(array( 'data' => array( 'message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled' ))); |
|
50 | + self::error(array('data' => array('message' => $l->t('Application is not enabled'), 'error' => 'application_not_enabled'))); |
|
51 | 51 | exit(); |
52 | 52 | } |
53 | 53 | } |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public static function checkLoggedIn() { |
61 | 61 | $twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager(); |
62 | - if( !\OC::$server->getUserSession()->isLoggedIn() |
|
62 | + if (!\OC::$server->getUserSession()->isLoggedIn() |
|
63 | 63 | || $twoFactorAuthManger->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { |
64 | 64 | $l = \OC::$server->getL10N('lib'); |
65 | 65 | http_response_code(\OCP\AppFramework\Http::STATUS_UNAUTHORIZED); |
66 | - self::error(array( 'data' => array( 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ))); |
|
66 | + self::error(array('data' => array('message' => $l->t('Authentication error'), 'error' => 'authentication_error'))); |
|
67 | 67 | exit(); |
68 | 68 | } |
69 | 69 | } |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | * @suppress PhanDeprecatedFunction |
75 | 75 | */ |
76 | 76 | public static function callCheck() { |
77 | - if(!\OC::$server->getRequest()->passesStrictCookieCheck()) { |
|
77 | + if (!\OC::$server->getRequest()->passesStrictCookieCheck()) { |
|
78 | 78 | header('Location: '.\OC::$WEBROOT); |
79 | 79 | exit(); |
80 | 80 | } |
81 | 81 | |
82 | - if( !\OC::$server->getRequest()->passesCSRFCheck()) { |
|
82 | + if (!\OC::$server->getRequest()->passesCSRFCheck()) { |
|
83 | 83 | $l = \OC::$server->getL10N('lib'); |
84 | - self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' ))); |
|
84 | + self::error(array('data' => array('message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired'))); |
|
85 | 85 | exit(); |
86 | 86 | } |
87 | 87 | } |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | * @suppress PhanDeprecatedFunction |
93 | 93 | */ |
94 | 94 | public static function checkAdminUser() { |
95 | - if( !OC_User::isAdminUser(OC_User::getUser())) { |
|
95 | + if (!OC_User::isAdminUser(OC_User::getUser())) { |
|
96 | 96 | $l = \OC::$server->getL10N('lib'); |
97 | - self::error(array( 'data' => array( 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' ))); |
|
97 | + self::error(array('data' => array('message' => $l->t('Authentication error'), 'error' => 'authentication_error'))); |
|
98 | 98 | exit(); |
99 | 99 | } |
100 | 100 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public static function error($data = array()) { |
108 | 108 | $data['status'] = 'error'; |
109 | - header( 'Content-Type: application/json; charset=utf-8'); |
|
109 | + header('Content-Type: application/json; charset=utf-8'); |
|
110 | 110 | echo self::encode($data); |
111 | 111 | } |
112 | 112 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public static function success($data = array()) { |
119 | 119 | $data['status'] = 'success'; |
120 | - header( 'Content-Type: application/json; charset=utf-8'); |
|
120 | + header('Content-Type: application/json; charset=utf-8'); |
|
121 | 121 | echo self::encode($data); |
122 | 122 | } |
123 | 123 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | protected static function to_string(&$value) { |
128 | 128 | if ($value instanceof \OC\L10N\L10NString) { |
129 | - $value = (string)$value; |
|
129 | + $value = (string) $value; |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 |
@@ -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() { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @since 14.0.0 |
75 | 75 | */ |
76 | 76 | public function getBackends():array { |
77 | - foreach($this->backends as $backend) { |
|
77 | + foreach ($this->backends as $backend) { |
|
78 | 78 | if (isset($this->initializedBackends[$backend])) { |
79 | 79 | continue; |
80 | 80 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getBackend($backendId) { |
94 | 94 | $backends = $this->getBackends(); |
95 | - foreach($backends as $backend) { |
|
95 | + foreach ($backends as $backend) { |
|
96 | 96 | if ($backend->getBackendIdentifier() === $backendId) { |
97 | 97 | return $backend; |
98 | 98 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @since 14.0.0 |
75 | 75 | */ |
76 | 76 | public function getBackends():array { |
77 | - foreach($this->backends as $backend) { |
|
77 | + foreach ($this->backends as $backend) { |
|
78 | 78 | if (isset($this->initializedBackends[$backend])) { |
79 | 79 | continue; |
80 | 80 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getBackend($backendId) { |
94 | 94 | $backends = $this->getBackends(); |
95 | - foreach($backends as $backend) { |
|
95 | + foreach ($backends as $backend) { |
|
96 | 96 | if ($backend->getBackendIdentifier() === $backendId) { |
97 | 97 | return $backend; |
98 | 98 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function __construct($newProviderId, $existingProviderName) { |
44 | 44 | $l = \OC::$server->getL10N('federation'); |
45 | - $message = 'ID "' . $newProviderId . '" already used by cloud federation provider "' . $existingProviderName . '"'; |
|
45 | + $message = 'ID "'.$newProviderId.'" already used by cloud federation provider "'.$existingProviderName.'"'; |
|
46 | 46 | $hint = $l->t('ID "%1$s" already used by cloud federation provider "%2$s"', [$newProviderId, $existingProviderName]); |
47 | 47 | parent::__construct($message, $hint); |
48 | 48 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | <h2><?php p($l->t('Account access')) ?></h2> |
32 | 32 | <p class="info"> |
33 | 33 | <?php print_unescaped($l->t('You are about to grant %1$s access to your %2$s account.', [ |
34 | - '<strong>' . \OCP\Util::sanitizeHTML($_['client']) . '</strong>', |
|
34 | + '<strong>'.\OCP\Util::sanitizeHTML($_['client']).'</strong>', |
|
35 | 35 | \OCP\Util::sanitizeHTML($_['instanceName']) |
36 | 36 | ])) ?> |
37 | 37 | </p> |