@@ -155,24 +155,24 @@ discard block |
||
155 | 155 | $configuredDatabases = $this->config->getValue('supportedDatabases', |
156 | 156 | array('sqlite', 'mysql', 'pgsql')); |
157 | 157 | } |
158 | - if(!is_array($configuredDatabases)) { |
|
158 | + if (!is_array($configuredDatabases)) { |
|
159 | 159 | throw new Exception('Supported databases are not properly configured.'); |
160 | 160 | } |
161 | 161 | |
162 | 162 | $supportedDatabases = array(); |
163 | 163 | |
164 | - foreach($configuredDatabases as $database) { |
|
165 | - if(array_key_exists($database, $availableDatabases)) { |
|
164 | + foreach ($configuredDatabases as $database) { |
|
165 | + if (array_key_exists($database, $availableDatabases)) { |
|
166 | 166 | $working = false; |
167 | 167 | $type = $availableDatabases[$database]['type']; |
168 | 168 | $call = $availableDatabases[$database]['call']; |
169 | 169 | |
170 | 170 | if ($type === 'function') { |
171 | 171 | $working = $this->is_callable($call); |
172 | - } elseif($type === 'pdo') { |
|
172 | + } elseif ($type === 'pdo') { |
|
173 | 173 | $working = in_array($call, $this->getAvailableDbDriversForPdo(), TRUE); |
174 | 174 | } |
175 | - if($working) { |
|
175 | + if ($working) { |
|
176 | 176 | $supportedDatabases[$database] = $availableDatabases[$database]['name']; |
177 | 177 | } |
178 | 178 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | // Create data directory to test whether the .htaccess works |
199 | 199 | // Notice that this is not necessarily the same data directory as the one |
200 | 200 | // that will effectively be used. |
201 | - if(!file_exists($dataDir)) { |
|
201 | + if (!file_exists($dataDir)) { |
|
202 | 202 | @mkdir($dataDir); |
203 | 203 | } |
204 | 204 | $htAccessWorking = true; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | if (\OC_Util::runningOnMac()) { |
222 | 222 | $errors[] = array( |
223 | 223 | 'error' => $this->l10n->t( |
224 | - 'Mac OS X is not supported and %s will not work properly on this platform. ' . |
|
224 | + 'Mac OS X is not supported and %s will not work properly on this platform. '. |
|
225 | 225 | 'Use it at your own risk! ', |
226 | 226 | $this->defaults->getName() |
227 | 227 | ), |
@@ -229,10 +229,10 @@ discard block |
||
229 | 229 | ); |
230 | 230 | } |
231 | 231 | |
232 | - if($this->iniWrapper->getString('open_basedir') !== '' && PHP_INT_SIZE === 4) { |
|
232 | + if ($this->iniWrapper->getString('open_basedir') !== '' && PHP_INT_SIZE === 4) { |
|
233 | 233 | $errors[] = array( |
234 | 234 | 'error' => $this->l10n->t( |
235 | - 'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. ' . |
|
235 | + 'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. '. |
|
236 | 236 | 'This will lead to problems with files over 4 GB and is highly discouraged.', |
237 | 237 | $this->defaults->getName() |
238 | 238 | ), |
@@ -262,13 +262,13 @@ discard block |
||
262 | 262 | $error = array(); |
263 | 263 | $dbType = $options['dbtype']; |
264 | 264 | |
265 | - if(empty($options['adminlogin'])) { |
|
265 | + if (empty($options['adminlogin'])) { |
|
266 | 266 | $error[] = $l->t('Set an admin username.'); |
267 | 267 | } |
268 | - if(empty($options['adminpass'])) { |
|
268 | + if (empty($options['adminpass'])) { |
|
269 | 269 | $error[] = $l->t('Set an admin password.'); |
270 | 270 | } |
271 | - if(empty($options['directory'])) { |
|
271 | + if (empty($options['directory'])) { |
|
272 | 272 | $options['directory'] = \OC::$SERVERROOT."/data"; |
273 | 273 | } |
274 | 274 | |
@@ -294,14 +294,14 @@ discard block |
||
294 | 294 | $error[] = $l->t("Can't create or write into the data directory %s", array($dataDir)); |
295 | 295 | } |
296 | 296 | |
297 | - if(count($error) != 0) { |
|
297 | + if (count($error) != 0) { |
|
298 | 298 | return $error; |
299 | 299 | } |
300 | 300 | |
301 | 301 | $request = \OC::$server->getRequest(); |
302 | 302 | |
303 | 303 | //no errors, good |
304 | - if(isset($options['trusted_domains']) |
|
304 | + if (isset($options['trusted_domains']) |
|
305 | 305 | && is_array($options['trusted_domains'])) { |
306 | 306 | $trustedDomains = $options['trusted_domains']; |
307 | 307 | } else { |
@@ -309,8 +309,8 @@ discard block |
||
309 | 309 | } |
310 | 310 | |
311 | 311 | //use sqlite3 when available, otherwise sqlite2 will be used. |
312 | - if($dbType=='sqlite' and class_exists('SQLite3')) { |
|
313 | - $dbType='sqlite3'; |
|
312 | + if ($dbType == 'sqlite' and class_exists('SQLite3')) { |
|
313 | + $dbType = 'sqlite3'; |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | //generate a random salt that is used to salt the local user passwords |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | 'secret' => $secret, |
325 | 325 | 'trusted_domains' => $trustedDomains, |
326 | 326 | 'datadirectory' => $dataDir, |
327 | - 'overwrite.cli.url' => $request->getServerProtocol() . '://' . $request->getInsecureServerHost() . \OC::$WEBROOT, |
|
327 | + 'overwrite.cli.url' => $request->getServerProtocol().'://'.$request->getInsecureServerHost().\OC::$WEBROOT, |
|
328 | 328 | 'dbtype' => $dbType, |
329 | 329 | 'version' => implode('.', \OCP\Util::getVersion()), |
330 | 330 | ]); |
@@ -340,30 +340,30 @@ discard block |
||
340 | 340 | return($error); |
341 | 341 | } catch (Exception $e) { |
342 | 342 | $error[] = array( |
343 | - 'error' => 'Error while trying to create admin user: ' . $e->getMessage(), |
|
343 | + 'error' => 'Error while trying to create admin user: '.$e->getMessage(), |
|
344 | 344 | 'hint' => '' |
345 | 345 | ); |
346 | 346 | return($error); |
347 | 347 | } |
348 | 348 | |
349 | 349 | //create the user and group |
350 | - $user = null; |
|
350 | + $user = null; |
|
351 | 351 | try { |
352 | 352 | $user = \OC::$server->getUserManager()->createUser($username, $password); |
353 | 353 | if (!$user) { |
354 | 354 | $error[] = "User <$username> could not be created."; |
355 | 355 | } |
356 | - } catch(Exception $exception) { |
|
356 | + } catch (Exception $exception) { |
|
357 | 357 | $error[] = $exception->getMessage(); |
358 | 358 | } |
359 | 359 | |
360 | - if(count($error) == 0) { |
|
360 | + if (count($error) == 0) { |
|
361 | 361 | $config = \OC::$server->getConfig(); |
362 | 362 | $config->setAppValue('core', 'installedat', microtime(true)); |
363 | 363 | $config->setAppValue('core', 'lastupdatedat', microtime(true)); |
364 | 364 | $config->setAppValue('core', 'vendor', $this->getVendor()); |
365 | 365 | |
366 | - $group =\OC::$server->getGroupManager()->createGroup('admin'); |
|
366 | + $group = \OC::$server->getGroupManager()->createGroup('admin'); |
|
367 | 367 | $group->addUser($user); |
368 | 368 | |
369 | 369 | // Install shipped apps and specified app bundles |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | ); |
378 | 378 | $bundleFetcher = new BundleFetcher(\OC::$server->getL10N('lib')); |
379 | 379 | $defaultInstallationBundles = $bundleFetcher->getDefaultInstallationBundle(); |
380 | - foreach($defaultInstallationBundles as $bundle) { |
|
380 | + foreach ($defaultInstallationBundles as $bundle) { |
|
381 | 381 | try { |
382 | 382 | $installer->installAppBundle($bundle); |
383 | 383 | } catch (Exception $e) {} |
@@ -428,9 +428,9 @@ discard block |
||
428 | 428 | $config = \OC::$server->getSystemConfig(); |
429 | 429 | |
430 | 430 | // For CLI read the value from overwrite.cli.url |
431 | - if(\OC::$CLI) { |
|
431 | + if (\OC::$CLI) { |
|
432 | 432 | $webRoot = $config->getValue('overwrite.cli.url', ''); |
433 | - if($webRoot === '') { |
|
433 | + if ($webRoot === '') { |
|
434 | 434 | return false; |
435 | 435 | } |
436 | 436 | $webRoot = parse_url($webRoot, PHP_URL_PATH); |
@@ -448,14 +448,14 @@ discard block |
||
448 | 448 | $htaccessContent = explode($content, $htaccessContent, 2)[0]; |
449 | 449 | |
450 | 450 | //custom 403 error page |
451 | - $content.= "\nErrorDocument 403 ".$webRoot."/core/templates/403.php"; |
|
451 | + $content .= "\nErrorDocument 403 ".$webRoot."/core/templates/403.php"; |
|
452 | 452 | |
453 | 453 | //custom 404 error page |
454 | - $content.= "\nErrorDocument 404 ".$webRoot."/core/templates/404.php"; |
|
454 | + $content .= "\nErrorDocument 404 ".$webRoot."/core/templates/404.php"; |
|
455 | 455 | |
456 | 456 | // Add rewrite rules if the RewriteBase is configured |
457 | 457 | $rewriteBase = $config->getValue('htaccess.RewriteBase', ''); |
458 | - if($rewriteBase !== '') { |
|
458 | + if ($rewriteBase !== '') { |
|
459 | 459 | $content .= "\n<IfModule mod_rewrite.c>"; |
460 | 460 | $content .= "\n Options -MultiViews"; |
461 | 461 | $content .= "\n RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]"; |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs-provider/"; |
475 | 475 | $content .= "\n RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*"; |
476 | 476 | $content .= "\n RewriteRule . index.php [PT,E=PATH_INFO:$1]"; |
477 | - $content .= "\n RewriteBase " . $rewriteBase; |
|
477 | + $content .= "\n RewriteBase ".$rewriteBase; |
|
478 | 478 | $content .= "\n <IfModule mod_env.c>"; |
479 | 479 | $content .= "\n SetEnv front_controller_active true"; |
480 | 480 | $content .= "\n <IfModule mod_dir.c>"; |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | |
487 | 487 | if ($content !== '') { |
488 | 488 | //suppress errors in case we don't have permissions for it |
489 | - return (bool) @file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent.$content . "\n"); |
|
489 | + return (bool) @file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent.$content."\n"); |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | return false; |
@@ -494,25 +494,25 @@ discard block |
||
494 | 494 | |
495 | 495 | public static function protectDataDirectory() { |
496 | 496 | //Require all denied |
497 | - $now = date('Y-m-d H:i:s'); |
|
497 | + $now = date('Y-m-d H:i:s'); |
|
498 | 498 | $content = "# Generated by Nextcloud on $now\n"; |
499 | - $content.= "# line below if for Apache 2.4\n"; |
|
500 | - $content.= "<ifModule mod_authz_core.c>\n"; |
|
501 | - $content.= "Require all denied\n"; |
|
502 | - $content.= "</ifModule>\n\n"; |
|
503 | - $content.= "# line below if for Apache 2.2\n"; |
|
504 | - $content.= "<ifModule !mod_authz_core.c>\n"; |
|
505 | - $content.= "deny from all\n"; |
|
506 | - $content.= "Satisfy All\n"; |
|
507 | - $content.= "</ifModule>\n\n"; |
|
508 | - $content.= "# section for Apache 2.2 and 2.4\n"; |
|
509 | - $content.= "<ifModule mod_autoindex.c>\n"; |
|
510 | - $content.= "IndexIgnore *\n"; |
|
511 | - $content.= "</ifModule>\n"; |
|
512 | - |
|
513 | - $baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); |
|
514 | - file_put_contents($baseDir . '/.htaccess', $content); |
|
515 | - file_put_contents($baseDir . '/index.html', ''); |
|
499 | + $content .= "# line below if for Apache 2.4\n"; |
|
500 | + $content .= "<ifModule mod_authz_core.c>\n"; |
|
501 | + $content .= "Require all denied\n"; |
|
502 | + $content .= "</ifModule>\n\n"; |
|
503 | + $content .= "# line below if for Apache 2.2\n"; |
|
504 | + $content .= "<ifModule !mod_authz_core.c>\n"; |
|
505 | + $content .= "deny from all\n"; |
|
506 | + $content .= "Satisfy All\n"; |
|
507 | + $content .= "</ifModule>\n\n"; |
|
508 | + $content .= "# section for Apache 2.2 and 2.4\n"; |
|
509 | + $content .= "<ifModule mod_autoindex.c>\n"; |
|
510 | + $content .= "IndexIgnore *\n"; |
|
511 | + $content .= "</ifModule>\n"; |
|
512 | + |
|
513 | + $baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'); |
|
514 | + file_put_contents($baseDir.'/.htaccess', $content); |
|
515 | + file_put_contents($baseDir.'/index.html', ''); |
|
516 | 516 | } |
517 | 517 | |
518 | 518 | /** |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | */ |
525 | 525 | private function getVendor() { |
526 | 526 | // this should really be a JSON file |
527 | - require \OC::$SERVERROOT . '/version.php'; |
|
527 | + require \OC::$SERVERROOT.'/version.php'; |
|
528 | 528 | /** @var string $vendor */ |
529 | 529 | return (string) $vendor; |
530 | 530 | } |
@@ -31,20 +31,20 @@ discard block |
||
31 | 31 | $lastConfirm = (int) \OC::$server->getSession()->get('last-password-confirm'); |
32 | 32 | if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay |
33 | 33 | $l = \OC::$server->getL10N('core'); |
34 | - OC_JSON::error(array( 'data' => array( 'message' => $l->t('Password confirmation is required')))); |
|
34 | + OC_JSON::error(array('data' => array('message' => $l->t('Password confirmation is required')))); |
|
35 | 35 | exit(); |
36 | 36 | } |
37 | 37 | |
38 | -$groups = isset($_POST['groups']) ? (array)$_POST['groups'] : null; |
|
39 | -$appIds = isset($_POST['appIds']) ? (array)$_POST['appIds'] : []; |
|
38 | +$groups = isset($_POST['groups']) ? (array) $_POST['groups'] : null; |
|
39 | +$appIds = isset($_POST['appIds']) ? (array) $_POST['appIds'] : []; |
|
40 | 40 | |
41 | 41 | try { |
42 | 42 | $updateRequired = false; |
43 | - foreach($appIds as $appId) { |
|
43 | + foreach ($appIds as $appId) { |
|
44 | 44 | $app = new OC_App(); |
45 | 45 | $appId = OC_App::cleanAppId($appId); |
46 | 46 | $app->enable($appId, $groups); |
47 | - if(\OC_App::shouldUpgrade($appId)) { |
|
47 | + if (\OC_App::shouldUpgrade($appId)) { |
|
48 | 48 | $updateRequired = true; |
49 | 49 | } |
50 | 50 | } |
@@ -52,5 +52,5 @@ discard block |
||
52 | 52 | OC_JSON::success(['data' => ['update_required' => $updateRequired]]); |
53 | 53 | } catch (Exception $e) { |
54 | 54 | \OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR); |
55 | - OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); |
|
55 | + OC_JSON::error(array("data" => array("message" => $e->getMessage()))); |
|
56 | 56 | } |
@@ -131,13 +131,13 @@ discard block |
||
131 | 131 | $currentLanguage = substr($this->l10nFactory->findLanguage(), 0, 2); |
132 | 132 | |
133 | 133 | $formattedCategories = [ |
134 | - ['id' => self::CAT_ALL_INSTALLED, 'ident' => 'installed', 'displayName' => (string)$this->l10n->t('Your apps')], |
|
135 | - ['id' => self::CAT_ENABLED, 'ident' => 'enabled', 'displayName' => (string)$this->l10n->t('Enabled apps')], |
|
136 | - ['id' => self::CAT_APP_BUNDLES, 'ident' => 'app-bundles', 'displayName' => (string)$this->l10n->t('App bundles')], |
|
137 | - ['id' => self::CAT_DISABLED, 'ident' => 'disabled', 'displayName' => (string)$this->l10n->t('Disabled apps')], |
|
134 | + ['id' => self::CAT_ALL_INSTALLED, 'ident' => 'installed', 'displayName' => (string) $this->l10n->t('Your apps')], |
|
135 | + ['id' => self::CAT_ENABLED, 'ident' => 'enabled', 'displayName' => (string) $this->l10n->t('Enabled apps')], |
|
136 | + ['id' => self::CAT_APP_BUNDLES, 'ident' => 'app-bundles', 'displayName' => (string) $this->l10n->t('App bundles')], |
|
137 | + ['id' => self::CAT_DISABLED, 'ident' => 'disabled', 'displayName' => (string) $this->l10n->t('Disabled apps')], |
|
138 | 138 | ]; |
139 | 139 | $categories = $this->categoryFetcher->get(); |
140 | - foreach($categories as $category) { |
|
140 | + foreach ($categories as $category) { |
|
141 | 141 | $formattedCategories[] = [ |
142 | 142 | 'id' => $category['id'], |
143 | 143 | 'ident' => $category['id'], |
@@ -167,46 +167,46 @@ discard block |
||
167 | 167 | $versionParser = new VersionParser(); |
168 | 168 | $formattedApps = []; |
169 | 169 | $apps = $this->appFetcher->get(); |
170 | - foreach($apps as $app) { |
|
170 | + foreach ($apps as $app) { |
|
171 | 171 | if (isset($app['isFeatured'])) { |
172 | 172 | $app['featured'] = $app['isFeatured']; |
173 | 173 | } |
174 | 174 | |
175 | 175 | // Skip all apps not in the requested category |
176 | 176 | $isInCategory = false; |
177 | - foreach($app['categories'] as $category) { |
|
178 | - if($category === $requestedCategory) { |
|
177 | + foreach ($app['categories'] as $category) { |
|
178 | + if ($category === $requestedCategory) { |
|
179 | 179 | $isInCategory = true; |
180 | 180 | } |
181 | 181 | } |
182 | - if(!$isInCategory) { |
|
182 | + if (!$isInCategory) { |
|
183 | 183 | continue; |
184 | 184 | } |
185 | 185 | |
186 | 186 | $nextCloudVersion = $versionParser->getVersion($app['releases'][0]['rawPlatformVersionSpec']); |
187 | 187 | $nextCloudVersionDependencies = []; |
188 | - if($nextCloudVersion->getMinimumVersion() !== '') { |
|
188 | + if ($nextCloudVersion->getMinimumVersion() !== '') { |
|
189 | 189 | $nextCloudVersionDependencies['nextcloud']['@attributes']['min-version'] = $nextCloudVersion->getMinimumVersion(); |
190 | 190 | } |
191 | - if($nextCloudVersion->getMaximumVersion() !== '') { |
|
191 | + if ($nextCloudVersion->getMaximumVersion() !== '') { |
|
192 | 192 | $nextCloudVersionDependencies['nextcloud']['@attributes']['max-version'] = $nextCloudVersion->getMaximumVersion(); |
193 | 193 | } |
194 | 194 | $phpVersion = $versionParser->getVersion($app['releases'][0]['rawPhpVersionSpec']); |
195 | 195 | $existsLocally = (\OC_App::getAppPath($app['id']) !== false) ? true : false; |
196 | 196 | $phpDependencies = []; |
197 | - if($phpVersion->getMinimumVersion() !== '') { |
|
197 | + if ($phpVersion->getMinimumVersion() !== '') { |
|
198 | 198 | $phpDependencies['php']['@attributes']['min-version'] = $phpVersion->getMinimumVersion(); |
199 | 199 | } |
200 | - if($phpVersion->getMaximumVersion() !== '') { |
|
200 | + if ($phpVersion->getMaximumVersion() !== '') { |
|
201 | 201 | $phpDependencies['php']['@attributes']['max-version'] = $phpVersion->getMaximumVersion(); |
202 | 202 | } |
203 | - if(isset($app['releases'][0]['minIntSize'])) { |
|
203 | + if (isset($app['releases'][0]['minIntSize'])) { |
|
204 | 204 | $phpDependencies['php']['@attributes']['min-int-size'] = $app['releases'][0]['minIntSize']; |
205 | 205 | } |
206 | 206 | $authors = ''; |
207 | - foreach($app['authors'] as $key => $author) { |
|
207 | + foreach ($app['authors'] as $key => $author) { |
|
208 | 208 | $authors .= $author['name']; |
209 | - if($key !== count($app['authors']) - 1) { |
|
209 | + if ($key !== count($app['authors']) - 1) { |
|
210 | 210 | $authors .= ', '; |
211 | 211 | } |
212 | 212 | } |
@@ -214,12 +214,12 @@ discard block |
||
214 | 214 | $currentLanguage = substr(\OC::$server->getL10NFactory()->findLanguage(), 0, 2); |
215 | 215 | $enabledValue = $this->config->getAppValue($app['id'], 'enabled', 'no'); |
216 | 216 | $groups = null; |
217 | - if($enabledValue !== 'no' && $enabledValue !== 'yes') { |
|
217 | + if ($enabledValue !== 'no' && $enabledValue !== 'yes') { |
|
218 | 218 | $groups = $enabledValue; |
219 | 219 | } |
220 | 220 | |
221 | 221 | $currentVersion = ''; |
222 | - if($this->appManager->isInstalled($app['id'])) { |
|
222 | + if ($this->appManager->isInstalled($app['id'])) { |
|
223 | 223 | $currentVersion = \OC_App::getAppVersion($app['id']); |
224 | 224 | } else { |
225 | 225 | $currentLanguage = $app['releases'][0]['version']; |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | |
266 | 266 | $appFetcher = \OC::$server->getAppFetcher(); |
267 | 267 | $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $appFetcher); |
268 | - if($newVersion && $this->appManager->isInstalled($app['id'])) { |
|
269 | - $formattedApps[count($formattedApps)-1]['update'] = $newVersion; |
|
268 | + if ($newVersion && $this->appManager->isInstalled($app['id'])) { |
|
269 | + $formattedApps[count($formattedApps) - 1]['update'] = $newVersion; |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
@@ -287,14 +287,14 @@ discard block |
||
287 | 287 | case 'installed': |
288 | 288 | $apps = $appClass->listAllApps(); |
289 | 289 | |
290 | - foreach($apps as $key => $app) { |
|
290 | + foreach ($apps as $key => $app) { |
|
291 | 291 | $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $this->appFetcher); |
292 | 292 | $apps[$key]['update'] = $newVersion; |
293 | 293 | } |
294 | 294 | |
295 | - usort($apps, function ($a, $b) { |
|
296 | - $a = (string)$a['name']; |
|
297 | - $b = (string)$b['name']; |
|
295 | + usort($apps, function($a, $b) { |
|
296 | + $a = (string) $a['name']; |
|
297 | + $b = (string) $b['name']; |
|
298 | 298 | if ($a === $b) { |
299 | 299 | return 0; |
300 | 300 | } |
@@ -304,18 +304,18 @@ discard block |
||
304 | 304 | // enabled apps |
305 | 305 | case 'enabled': |
306 | 306 | $apps = $appClass->listAllApps(); |
307 | - $apps = array_filter($apps, function ($app) { |
|
307 | + $apps = array_filter($apps, function($app) { |
|
308 | 308 | return $app['active']; |
309 | 309 | }); |
310 | 310 | |
311 | - foreach($apps as $key => $app) { |
|
311 | + foreach ($apps as $key => $app) { |
|
312 | 312 | $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $this->appFetcher); |
313 | 313 | $apps[$key]['update'] = $newVersion; |
314 | 314 | } |
315 | 315 | |
316 | - usort($apps, function ($a, $b) { |
|
317 | - $a = (string)$a['name']; |
|
318 | - $b = (string)$b['name']; |
|
316 | + usort($apps, function($a, $b) { |
|
317 | + $a = (string) $a['name']; |
|
318 | + $b = (string) $b['name']; |
|
319 | 319 | if ($a === $b) { |
320 | 320 | return 0; |
321 | 321 | } |
@@ -325,11 +325,11 @@ discard block |
||
325 | 325 | // disabled apps |
326 | 326 | case 'disabled': |
327 | 327 | $apps = $appClass->listAllApps(); |
328 | - $apps = array_filter($apps, function ($app) { |
|
328 | + $apps = array_filter($apps, function($app) { |
|
329 | 329 | return !$app['active']; |
330 | 330 | }); |
331 | 331 | |
332 | - $apps = array_map(function ($app) { |
|
332 | + $apps = array_map(function($app) { |
|
333 | 333 | $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $this->appFetcher); |
334 | 334 | if ($newVersion !== false) { |
335 | 335 | $app['update'] = $newVersion; |
@@ -337,9 +337,9 @@ discard block |
||
337 | 337 | return $app; |
338 | 338 | }, $apps); |
339 | 339 | |
340 | - usort($apps, function ($a, $b) { |
|
341 | - $a = (string)$a['name']; |
|
342 | - $b = (string)$b['name']; |
|
340 | + usort($apps, function($a, $b) { |
|
341 | + $a = (string) $a['name']; |
|
342 | + $b = (string) $b['name']; |
|
343 | 343 | if ($a === $b) { |
344 | 344 | return 0; |
345 | 345 | } |
@@ -349,15 +349,15 @@ discard block |
||
349 | 349 | case 'app-bundles': |
350 | 350 | $bundles = $this->bundleFetcher->getBundles(); |
351 | 351 | $apps = []; |
352 | - foreach($bundles as $bundle) { |
|
352 | + foreach ($bundles as $bundle) { |
|
353 | 353 | $newCategory = true; |
354 | 354 | $allApps = $appClass->listAllApps(); |
355 | 355 | $categories = $this->getAllCategories(); |
356 | - foreach($categories as $singleCategory) { |
|
356 | + foreach ($categories as $singleCategory) { |
|
357 | 357 | $newApps = $this->getAppsForCategory($singleCategory['id']); |
358 | - foreach($allApps as $app) { |
|
359 | - foreach($newApps as $key => $newApp) { |
|
360 | - if($app['id'] === $newApp['id']) { |
|
358 | + foreach ($allApps as $app) { |
|
359 | + foreach ($newApps as $key => $newApp) { |
|
360 | + if ($app['id'] === $newApp['id']) { |
|
361 | 361 | unset($newApps[$key]); |
362 | 362 | } |
363 | 363 | } |
@@ -365,10 +365,10 @@ discard block |
||
365 | 365 | $allApps = array_merge($allApps, $newApps); |
366 | 366 | } |
367 | 367 | |
368 | - foreach($bundle->getAppIdentifiers() as $identifier) { |
|
369 | - foreach($allApps as $app) { |
|
370 | - if($app['id'] === $identifier) { |
|
371 | - if($newCategory) { |
|
368 | + foreach ($bundle->getAppIdentifiers() as $identifier) { |
|
369 | + foreach ($allApps as $app) { |
|
370 | + if ($app['id'] === $identifier) { |
|
371 | + if ($newCategory) { |
|
372 | 372 | $app['newCategory'] = true; |
373 | 373 | $app['categoryName'] = $bundle->getName(); |
374 | 374 | } |
@@ -384,9 +384,9 @@ discard block |
||
384 | 384 | $apps = $this->getAppsForCategory($category); |
385 | 385 | |
386 | 386 | // sort by score |
387 | - usort($apps, function ($a, $b) { |
|
388 | - $a = (int)$a['score']; |
|
389 | - $b = (int)$b['score']; |
|
387 | + usort($apps, function($a, $b) { |
|
388 | + $a = (int) $a['score']; |
|
389 | + $b = (int) $b['score']; |
|
390 | 390 | if ($a === $b) { |
391 | 391 | return 0; |
392 | 392 | } |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | </li> |
23 | 23 | {{/each}} |
24 | 24 | |
25 | -<?php if($_['appstoreEnabled']): ?> |
|
25 | +<?php if ($_['appstoreEnabled']): ?> |
|
26 | 26 | <li> |
27 | - <a class="app-external" target="_blank" rel="noreferrer" href="https://docs.nextcloud.org/server/12/developer_manual/"><?php p($l->t('Developer documentation'));?> ↗</a> |
|
27 | + <a class="app-external" target="_blank" rel="noreferrer" href="https://docs.nextcloud.org/server/12/developer_manual/"><?php p($l->t('Developer documentation')); ?> ↗</a> |
|
28 | 28 | </li> |
29 | 29 | <?php endif; ?> |
30 | 30 | </script> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | </div> |
42 | 42 | <div class="app-version">{{version}}</div> |
43 | 43 | <div class="app-level"> |
44 | - {{{level}}}{{#unless internal}}<a href="https://apps.nextcloud.com/apps/{{id}}"><?php p($l->t('View in store'));?> ↗</a>{{/unless}} |
|
44 | + {{{level}}}{{#unless internal}}<a href="https://apps.nextcloud.com/apps/{{id}}"><?php p($l->t('View in store')); ?> ↗</a>{{/unless}} |
|
45 | 45 | </div> |
46 | 46 | |
47 | 47 | <div class="app-groups"> |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | <input class="uninstall" type="submit" value="<?php p($l->t('Remove')); ?>" data-appid="{{id}}" /> |
65 | 65 | {{/if}} |
66 | 66 | {{#if active}} |
67 | - <input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/> |
|
67 | + <input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable")); ?>"/> |
|
68 | 68 | {{else}} |
69 | - <input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/> |
|
69 | + <input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable")); ?>"/> |
|
70 | 70 | {{/if}} |
71 | 71 | </div> |
72 | 72 | </div> |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | <script id="app-template" type="text/x-handlebars"> |
76 | 76 | {{#if newCategory}} |
77 | - <h2>{{categoryName}} <input class="enable" type="submit" data-bundleid="{{bundleId}}" data-active="true" value="<?php p($l->t('Enable all'));?>"/></h2> |
|
77 | + <h2>{{categoryName}} <input class="enable" type="submit" data-bundleid="{{bundleId}}" data-active="true" value="<?php p($l->t('Enable all')); ?>"/></h2> |
|
78 | 78 | {{/if}} |
79 | 79 | <div class="section" id="app-{{id}}"> |
80 | 80 | {{#if preview}} |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | <div class="app-description-container hidden"> |
100 | 100 | <div class="app-version">{{version}}</div> |
101 | 101 | {{#if profilepage}}<a href="{{profilepage}}" target="_blank" rel="noreferrer">{{/if}} |
102 | - <div class="app-author"><?php p($l->t('by %s', ['{{author}}']));?> |
|
102 | + <div class="app-author"><?php p($l->t('by %s', ['{{author}}'])); ?> |
|
103 | 103 | {{#if licence}} |
104 | 104 | (<?php p($l->t('%s-licensed', ['{{licence}}'])); ?>) |
105 | 105 | {{/if}} |
@@ -109,37 +109,37 @@ discard block |
||
109 | 109 | <!--<div class="app-changed">{{changed}}</div>--> |
110 | 110 | {{#if documentation}} |
111 | 111 | <p class="documentation"> |
112 | - <?php p($l->t("Documentation:"));?> |
|
112 | + <?php p($l->t("Documentation:")); ?> |
|
113 | 113 | {{#if documentation.user}} |
114 | 114 | <span class="userDocumentation"> |
115 | - <a id="userDocumentation" class="appslink" href="{{documentation.user}}" target="_blank" rel="noreferrer"><?php p($l->t('User documentation'));?> ↗</a> |
|
115 | + <a id="userDocumentation" class="appslink" href="{{documentation.user}}" target="_blank" rel="noreferrer"><?php p($l->t('User documentation')); ?> ↗</a> |
|
116 | 116 | </span> |
117 | 117 | {{/if}} |
118 | 118 | |
119 | 119 | {{#if documentation.admin}} |
120 | 120 | <span class="adminDocumentation"> |
121 | - <a id="adminDocumentation" class="appslink" href="{{documentation.admin}}" target="_blank" rel="noreferrer"><?php p($l->t('Admin documentation'));?> ↗</a> |
|
121 | + <a id="adminDocumentation" class="appslink" href="{{documentation.admin}}" target="_blank" rel="noreferrer"><?php p($l->t('Admin documentation')); ?> ↗</a> |
|
122 | 122 | </span> |
123 | 123 | {{/if}} |
124 | 124 | |
125 | 125 | {{#if documentation.developer}} |
126 | 126 | <span class="developerDocumentation"> |
127 | - <a id="developerDocumentation" class="appslink" href="{{documentation.developer}}" target="_blank" rel="noreferrer"><?php p($l->t('Developer documentation'));?> ↗</a> |
|
127 | + <a id="developerDocumentation" class="appslink" href="{{documentation.developer}}" target="_blank" rel="noreferrer"><?php p($l->t('Developer documentation')); ?> ↗</a> |
|
128 | 128 | </span> |
129 | 129 | {{/if}} |
130 | 130 | </p> |
131 | 131 | {{/if}} |
132 | 132 | |
133 | 133 | {{#if website}} |
134 | - <a id="userDocumentation" class="appslink" href="{{website}}" target="_blank" rel="noreferrer"><?php p($l->t('Visit website'));?> ↗</a> |
|
134 | + <a id="userDocumentation" class="appslink" href="{{website}}" target="_blank" rel="noreferrer"><?php p($l->t('Visit website')); ?> ↗</a> |
|
135 | 135 | {{/if}} |
136 | 136 | |
137 | 137 | {{#if bugs}} |
138 | - <a id="adminDocumentation" class="appslink" href="{{bugs}}" target="_blank" rel="noreferrer"><?php p($l->t('Report a bug'));?> ↗</a> |
|
138 | + <a id="adminDocumentation" class="appslink" href="{{bugs}}" target="_blank" rel="noreferrer"><?php p($l->t('Report a bug')); ?> ↗</a> |
|
139 | 139 | {{/if}} |
140 | 140 | </div><!-- end app-description-container --> |
141 | - <div class="app-description-toggle-show" role="link"><?php p($l->t("Show description …"));?></div> |
|
142 | - <div class="app-description-toggle-hide hidden" role="link"><?php p($l->t("Hide description …"));?></div> |
|
141 | + <div class="app-description-toggle-show" role="link"><?php p($l->t("Show description …")); ?></div> |
|
142 | + <div class="app-description-toggle-hide hidden" role="link"><?php p($l->t("Hide description …")); ?></div> |
|
143 | 143 | |
144 | 144 | <div class="app-dependencies update hidden"> |
145 | 145 | <p><?php p($l->t('This app has an update available.')); ?></p> |
@@ -170,14 +170,14 @@ discard block |
||
170 | 170 | |
171 | 171 | <input class="update hidden" type="submit" value="<?php p($l->t('Update to %s', array('{{update}}'))); ?>" data-appid="{{id}}" /> |
172 | 172 | {{#if active}} |
173 | - <input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable"));?>"/> |
|
173 | + <input class="enable" type="submit" data-appid="{{id}}" data-active="true" value="<?php p($l->t("Disable")); ?>"/> |
|
174 | 174 | <div class="groups-enable"> |
175 | 175 | <input type="checkbox" class="groups-enable__checkbox checkbox" id="groups_enable-{{id}}"/> |
176 | 176 | <label for="groups_enable-{{id}}"><?php p($l->t('Enable only for specific groups')); ?></label> |
177 | 177 | </div> |
178 | 178 | <input type="hidden" id="group_select" title="<?php p($l->t('All')); ?>" style="width: 200px"> |
179 | 179 | {{else}} |
180 | - <input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable"));?>"/> |
|
180 | + <input class="enable{{#if needsDownload}} needs-download{{/if}}" type="submit" data-appid="{{id}}" data-active="false" {{#unless canInstall}}disabled="disabled"{{/unless}} value="<?php p($l->t("Enable")); ?>"/> |
|
181 | 181 | {{/if}} |
182 | 182 | {{#if canUnInstall}} |
183 | 183 | <input class="uninstall" type="submit" value="<?php p($l->t('Remove')); ?>" data-appid="{{id}}" /> |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | </div> |
189 | 189 | </script> |
190 | 190 | |
191 | -<div id="app-navigation" class="icon-loading" data-category="<?php p($_['category']);?>"> |
|
191 | +<div id="app-navigation" class="icon-loading" data-category="<?php p($_['category']); ?>"> |
|
192 | 192 | <ul id="apps-categories"> |
193 | 193 | |
194 | 194 | </ul> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $lastConfirm = (int) \OC::$server->getSession()->get('last-password-confirm'); |
28 | 28 | if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay |
29 | 29 | $l = \OC::$server->getL10N('core'); |
30 | - OC_JSON::error(array( 'data' => array( 'message' => $l->t('Password confirmation is required')))); |
|
30 | + OC_JSON::error(array('data' => array('message' => $l->t('Password confirmation is required')))); |
|
31 | 31 | exit(); |
32 | 32 | } |
33 | 33 | |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | exit; |
37 | 37 | } |
38 | 38 | |
39 | -$appIds = (array)$_POST['appid']; |
|
40 | -foreach($appIds as $appId) { |
|
39 | +$appIds = (array) $_POST['appid']; |
|
40 | +foreach ($appIds as $appId) { |
|
41 | 41 | $appId = OC_App::cleanAppId($appId); |
42 | 42 | OC_App::disable($appId); |
43 | 43 | } |