Completed
Pull Request — stable9 (#4226)
by Lukas
11:11
created
apps/files_versions/ajax/preview.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 \OC_Util::checkLoggedIn();
27 27
 
28 28
 if(!\OC_App::isEnabled('files_versions')){
29
-	exit;
29
+    exit;
30 30
 }
31 31
 
32 32
 $file = array_key_exists('file', $_GET) ? (string) urldecode($_GET['file']) : '';
@@ -36,31 +36,31 @@  discard block
 block discarded – undo
36 36
 $scalingUp = array_key_exists('scalingup', $_GET) ? (bool) $_GET['scalingup'] : true;
37 37
 
38 38
 if($file === '' && $version === '') {
39
-	\OC_Response::setStatus(400); //400 Bad Request
40
-	\OCP\Util::writeLog('versions-preview', 'No file parameter was passed', \OCP\Util::DEBUG);
41
-	exit;
39
+    \OC_Response::setStatus(400); //400 Bad Request
40
+    \OCP\Util::writeLog('versions-preview', 'No file parameter was passed', \OCP\Util::DEBUG);
41
+    exit;
42 42
 }
43 43
 
44 44
 if($maxX === 0 || $maxY === 0) {
45
-	\OC_Response::setStatus(400); //400 Bad Request
46
-	\OCP\Util::writeLog('versions-preview', 'x and/or y set to 0', \OCP\Util::DEBUG);
47
-	exit;
45
+    \OC_Response::setStatus(400); //400 Bad Request
46
+    \OCP\Util::writeLog('versions-preview', 'x and/or y set to 0', \OCP\Util::DEBUG);
47
+    exit;
48 48
 }
49 49
 
50 50
 try {
51
-	list($user, $file) = \OCA\Files_Versions\Storage::getUidAndFilename($file);
52
-	$preview = new \OC\Preview($user, 'files_versions', $file.'.v'.$version);
53
-	$mimetype = \OC::$server->getMimeTypeDetector()->detectPath($file);
54
-	$preview->setMimetype($mimetype);
55
-	$preview->setMaxX($maxX);
56
-	$preview->setMaxY($maxY);
57
-	$preview->setScalingUp($scalingUp);
51
+    list($user, $file) = \OCA\Files_Versions\Storage::getUidAndFilename($file);
52
+    $preview = new \OC\Preview($user, 'files_versions', $file.'.v'.$version);
53
+    $mimetype = \OC::$server->getMimeTypeDetector()->detectPath($file);
54
+    $preview->setMimetype($mimetype);
55
+    $preview->setMaxX($maxX);
56
+    $preview->setMaxY($maxY);
57
+    $preview->setScalingUp($scalingUp);
58 58
 
59
-	$preview->showPreview();
59
+    $preview->showPreview();
60 60
 } catch (\OCP\Files\NotFoundException $e) {
61
-	\OC_Response::setStatus(404);
62
-	\OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::DEBUG);
61
+    \OC_Response::setStatus(404);
62
+    \OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::DEBUG);
63 63
 } catch (\Exception $e) {
64
-	\OC_Response::setStatus(500);
65
-	\OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::DEBUG);
64
+    \OC_Response::setStatus(500);
65
+    \OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::DEBUG);
66 66
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  */
26 26
 \OC_Util::checkLoggedIn();
27 27
 
28
-if(!\OC_App::isEnabled('files_versions')){
28
+if (!\OC_App::isEnabled('files_versions')) {
29 29
 	exit;
30 30
 }
31 31
 
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
 $version = array_key_exists('version', $_GET) ? $_GET['version'] : '';
36 36
 $scalingUp = array_key_exists('scalingup', $_GET) ? (bool) $_GET['scalingup'] : true;
37 37
 
38
-if($file === '' && $version === '') {
38
+if ($file === '' && $version === '') {
39 39
 	\OC_Response::setStatus(400); //400 Bad Request
40 40
 	\OCP\Util::writeLog('versions-preview', 'No file parameter was passed', \OCP\Util::DEBUG);
41 41
 	exit;
42 42
 }
43 43
 
44
-if($maxX === 0 || $maxY === 0) {
44
+if ($maxX === 0 || $maxY === 0) {
45 45
 	\OC_Response::setStatus(400); //400 Bad Request
46 46
 	\OCP\Util::writeLog('versions-preview', 'x and/or y set to 0', \OCP\Util::DEBUG);
47 47
 	exit;
Please login to merge, or discard this patch.
apps/files_versions/appinfo/routes.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@
 block discarded – undo
33 33
 /** @var $this \OCP\Route\IRouter */
34 34
 $this->create('core_ajax_versions_preview', '/preview')->action(
35 35
 function() {
36
-	require_once __DIR__ . '/../ajax/preview.php';
36
+    require_once __DIR__ . '/../ajax/preview.php';
37 37
 });
38 38
 
39 39
 $this->create('files_versions_download', 'download.php')
40
-	->actionInclude('files_versions/download.php');
40
+    ->actionInclude('files_versions/download.php');
41 41
 $this->create('files_versions_ajax_getVersions', 'ajax/getVersions.php')
42
-	->actionInclude('files_versions/ajax/getVersions.php');
42
+    ->actionInclude('files_versions/ajax/getVersions.php');
43 43
 $this->create('files_versions_ajax_rollbackVersion', 'ajax/rollbackVersion.php')
44
-	->actionInclude('files_versions/ajax/rollbackVersion.php');
44
+    ->actionInclude('files_versions/ajax/rollbackVersion.php');
45 45
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 /** @var $this \OCP\Route\IRouter */
34 34
 $this->create('core_ajax_versions_preview', '/preview')->action(
35 35
 function() {
36
-	require_once __DIR__ . '/../ajax/preview.php';
36
+	require_once __DIR__.'/../ajax/preview.php';
37 37
 });
38 38
 
39 39
 $this->create('files_versions_download', 'download.php')
Please login to merge, or discard this patch.
apps/files_versions/download.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 OCP\JSON::checkLoggedIn();
30 30
 
31 31
 $file = $_GET['file'];
32
-$revision=(int)$_GET['revision'];
32
+$revision = (int) $_GET['revision'];
33 33
 
34 34
 list($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($file);
35 35
 
Please login to merge, or discard this patch.
core/templates/internalaltmail.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 print_unescaped($l->t("Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", array($_['user_displayname'], $_['filename'], $_['link'])));
3 3
 if ( isset($_['expiration']) ) {
4
-	print_unescaped($l->t("The share will expire on %s.", array($_['expiration'])));
5
-	print_unescaped("\n\n");
4
+    print_unescaped($l->t("The share will expire on %s.", array($_['expiration'])));
5
+    print_unescaped("\n\n");
6 6
 }
7 7
 // TRANSLATORS term at the end of a mail
8 8
 p($l->t("Cheers!"));
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 print_unescaped($l->t("Hey there,\n\njust letting you know that %s shared %s with you.\nView it: %s\n\n", array($_['user_displayname'], $_['filename'], $_['link'])));
3
-if ( isset($_['expiration']) ) {
3
+if (isset($_['expiration'])) {
4 4
 	print_unescaped($l->t("The share will expire on %s.", array($_['expiration'])));
5 5
 	print_unescaped("\n\n");
6 6
 }
@@ -9,5 +9,5 @@  discard block
 block discarded – undo
9 9
 ?>
10 10
 
11 11
 --
12
-<?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?>
12
+<?php p($theme->getName().' - '.$theme->getSlogan()); ?>
13 13
 <?php print_unescaped("\n".$theme->getBaseUrl());
Please login to merge, or discard this patch.
core/templates/internalmail.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
 <?php
14 14
 print_unescaped($l->t('Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href="%s">View it!</a><br><br>', array($_['user_displayname'], $_['filename'], $_['link'])));
15 15
 if ( isset($_['expiration']) ) {
16
-	p($l->t("The share will expire on %s.", array($_['expiration'])));
17
-	print_unescaped('<br><br>');
16
+    p($l->t("The share will expire on %s.", array($_['expiration'])));
17
+    print_unescaped('<br><br>');
18 18
 }
19 19
 // TRANSLATORS term at the end of a mail
20 20
 p($l->t('Cheers!'));
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 <tr><td>
3 3
 <table cellspacing="0" cellpadding="0" border="0" width="600px">
4 4
 <tr>
5
-<td bgcolor="<?php p($theme->getMailHeaderColor());?>" width="20px">&nbsp;</td>
6
-<td bgcolor="<?php p($theme->getMailHeaderColor());?>">
5
+<td bgcolor="<?php p($theme->getMailHeaderColor()); ?>" width="20px">&nbsp;</td>
6
+<td bgcolor="<?php p($theme->getMailHeaderColor()); ?>">
7 7
 <img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.gif'))); ?>" alt="<?php p($theme->getName()); ?>"/>
8 8
 </td>
9 9
 </tr>
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 <td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">
14 14
 <?php
15 15
 print_unescaped($l->t('Hey there,<br><br>just letting you know that %s shared <strong>%s</strong> with you.<br><a href="%s">View it!</a><br><br>', array($_['user_displayname'], $_['filename'], $_['link'])));
16
-if ( isset($_['expiration']) ) {
16
+if (isset($_['expiration'])) {
17 17
 	p($l->t("The share will expire on %s.", array($_['expiration'])));
18 18
 	print_unescaped('<br><br>');
19 19
 }
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 <td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">--<br>
29 29
 <?php p($theme->getName()); ?> -
30 30
 <?php p($theme->getSlogan()); ?>
31
-<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl());?></a>
31
+<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl()); ?></a>
32 32
 </td>
33 33
 </tr>
34 34
 <tr>
Please login to merge, or discard this patch.
core/ajax/preview.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
 \OC_Util::checkLoggedIn();
28 28
 \OC::$server->getSession()->close();
29 29
 
30
-$file = array_key_exists('file', $_GET) ? (string)$_GET['file'] : '';
31
-$maxX = array_key_exists('x', $_GET) ? (int)$_GET['x'] : '32';
32
-$maxY = array_key_exists('y', $_GET) ? (int)$_GET['y'] : '32';
33
-$scalingUp = array_key_exists('scalingup', $_GET) ? (bool)$_GET['scalingup'] : true;
30
+$file = array_key_exists('file', $_GET) ? (string) $_GET['file'] : '';
31
+$maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : '32';
32
+$maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : '32';
33
+$scalingUp = array_key_exists('scalingup', $_GET) ? (bool) $_GET['scalingup'] : true;
34 34
 $keepAspect = array_key_exists('a', $_GET) ? true : false;
35
-$always = array_key_exists('forceIcon', $_GET) ? (bool)$_GET['forceIcon'] : true;
35
+$always = array_key_exists('forceIcon', $_GET) ? (bool) $_GET['forceIcon'] : true;
36 36
 $mode = array_key_exists('mode', $_GET) ? $_GET['mode'] : 'fill';
37 37
 
38 38
 if ($file === '') {
Please login to merge, or discard this patch.
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -36,30 +36,30 @@
 block discarded – undo
36 36
 $mode = array_key_exists('mode', $_GET) ? $_GET['mode'] : 'fill';
37 37
 
38 38
 if ($file === '') {
39
-	//400 Bad Request
40
-	\OC_Response::setStatus(400);
41
-	\OCP\Util::writeLog('core-preview', 'No file parameter was passed', \OCP\Util::DEBUG);
42
-	exit;
39
+    //400 Bad Request
40
+    \OC_Response::setStatus(400);
41
+    \OCP\Util::writeLog('core-preview', 'No file parameter was passed', \OCP\Util::DEBUG);
42
+    exit;
43 43
 }
44 44
 
45 45
 if ($maxX === 0 || $maxY === 0) {
46
-	//400 Bad Request
47
-	\OC_Response::setStatus(400);
48
-	\OCP\Util::writeLog('core-preview', 'x and/or y set to 0', \OCP\Util::DEBUG);
49
-	exit;
46
+    //400 Bad Request
47
+    \OC_Response::setStatus(400);
48
+    \OCP\Util::writeLog('core-preview', 'x and/or y set to 0', \OCP\Util::DEBUG);
49
+    exit;
50 50
 }
51 51
 
52 52
 $info = \OC\Files\Filesystem::getFileInfo($file);
53 53
 
54 54
 if (!$info instanceof OCP\Files\FileInfo || !$always && !\OC::$server->getPreviewManager()->isAvailable($info)) {
55
-	\OC_Response::setStatus(404);
55
+    \OC_Response::setStatus(404);
56 56
 } else {
57
-	$preview = new \OC\Preview(\OC_User::getUser(), 'files');
58
-	$preview->setFile($file, $info);
59
-	$preview->setMaxX($maxX);
60
-	$preview->setMaxY($maxY);
61
-	$preview->setScalingUp($scalingUp);
62
-	$preview->setMode($mode);
63
-	$preview->setKeepAspect($keepAspect);
64
-	$preview->showPreview();
57
+    $preview = new \OC\Preview(\OC_User::getUser(), 'files');
58
+    $preview->setFile($file, $info);
59
+    $preview->setMaxX($maxX);
60
+    $preview->setMaxY($maxY);
61
+    $preview->setScalingUp($scalingUp);
62
+    $preview->setMode($mode);
63
+    $preview->setKeepAspect($keepAspect);
64
+    $preview->showPreview();
65 65
 }
Please login to merge, or discard this patch.
core/ajax/appconfig.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 $action=isset($_POST['action'])?$_POST['action']:$_GET['action'];
30 30
 
31 31
 if(isset($_POST['app']) || isset($_GET['app'])) {
32
-	$app=OC_App::cleanAppId(isset($_POST['app'])? (string)$_POST['app']: (string)$_GET['app']);
32
+    $app=OC_App::cleanAppId(isset($_POST['app'])? (string)$_POST['app']: (string)$_GET['app']);
33 33
 }
34 34
 
35 35
 // An admin should not be able to add remote and public services
@@ -37,34 +37,34 @@  discard block
 block discarded – undo
37 37
 // This change is due the fact that an admin may not be expected 
38 38
 // to execute arbitrary code in every environment.
39 39
 if($app === 'core' && isset($_POST['key']) &&(substr((string)$_POST['key'],0,7) === 'remote_' || substr((string)$_POST['key'],0,7) === 'public_')) {
40
-	OC_JSON::error(array('data' => array('message' => 'Unexpected error!')));
41
-	return;
40
+    OC_JSON::error(array('data' => array('message' => 'Unexpected error!')));
41
+    return;
42 42
 }
43 43
 
44 44
 $result=false;
45 45
 $appConfig = \OC::$server->getAppConfig();
46 46
 switch($action) {
47
-	case 'getValue':
48
-		$result=$appConfig->getValue($app, (string)$_GET['key'], (string)$_GET['defaultValue']);
49
-		break;
50
-	case 'setValue':
51
-		$result=$appConfig->setValue($app, (string)$_POST['key'], (string)$_POST['value']);
52
-		break;
53
-	case 'getApps':
54
-		$result=$appConfig->getApps();
55
-		break;
56
-	case 'getKeys':
57
-		$result=$appConfig->getKeys($app);
58
-		break;
59
-	case 'hasKey':
60
-		$result=$appConfig->hasKey($app, (string)$_GET['key']);
61
-		break;
62
-	case 'deleteKey':
63
-		$result=$appConfig->deleteKey($app, (string)$_POST['key']);
64
-		break;
65
-	case 'deleteApp':
66
-		$result=$appConfig->deleteApp($app);
67
-		break;
47
+    case 'getValue':
48
+        $result=$appConfig->getValue($app, (string)$_GET['key'], (string)$_GET['defaultValue']);
49
+        break;
50
+    case 'setValue':
51
+        $result=$appConfig->setValue($app, (string)$_POST['key'], (string)$_POST['value']);
52
+        break;
53
+    case 'getApps':
54
+        $result=$appConfig->getApps();
55
+        break;
56
+    case 'getKeys':
57
+        $result=$appConfig->getKeys($app);
58
+        break;
59
+    case 'hasKey':
60
+        $result=$appConfig->hasKey($app, (string)$_GET['key']);
61
+        break;
62
+    case 'deleteKey':
63
+        $result=$appConfig->deleteKey($app, (string)$_POST['key']);
64
+        break;
65
+    case 'deleteApp':
66
+        $result=$appConfig->deleteApp($app);
67
+        break;
68 68
 }
69 69
 OC_JSON::success(array('data'=>$result));
70 70
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,44 +26,44 @@
 block discarded – undo
26 26
 OC_Util::checkAdminUser();
27 27
 OCP\JSON::callCheck();
28 28
 
29
-$action=isset($_POST['action'])?$_POST['action']:$_GET['action'];
29
+$action = isset($_POST['action']) ? $_POST['action'] : $_GET['action'];
30 30
 
31
-if(isset($_POST['app']) || isset($_GET['app'])) {
32
-	$app=OC_App::cleanAppId(isset($_POST['app'])? (string)$_POST['app']: (string)$_GET['app']);
31
+if (isset($_POST['app']) || isset($_GET['app'])) {
32
+	$app = OC_App::cleanAppId(isset($_POST['app']) ? (string) $_POST['app'] : (string) $_GET['app']);
33 33
 }
34 34
 
35 35
 // An admin should not be able to add remote and public services
36 36
 // on its own. This should only be possible programmatically.
37 37
 // This change is due the fact that an admin may not be expected 
38 38
 // to execute arbitrary code in every environment.
39
-if($app === 'core' && isset($_POST['key']) &&(substr((string)$_POST['key'],0,7) === 'remote_' || substr((string)$_POST['key'],0,7) === 'public_')) {
39
+if ($app === 'core' && isset($_POST['key']) && (substr((string) $_POST['key'], 0, 7) === 'remote_' || substr((string) $_POST['key'], 0, 7) === 'public_')) {
40 40
 	OC_JSON::error(array('data' => array('message' => 'Unexpected error!')));
41 41
 	return;
42 42
 }
43 43
 
44
-$result=false;
44
+$result = false;
45 45
 $appConfig = \OC::$server->getAppConfig();
46
-switch($action) {
46
+switch ($action) {
47 47
 	case 'getValue':
48
-		$result=$appConfig->getValue($app, (string)$_GET['key'], (string)$_GET['defaultValue']);
48
+		$result = $appConfig->getValue($app, (string) $_GET['key'], (string) $_GET['defaultValue']);
49 49
 		break;
50 50
 	case 'setValue':
51
-		$result=$appConfig->setValue($app, (string)$_POST['key'], (string)$_POST['value']);
51
+		$result = $appConfig->setValue($app, (string) $_POST['key'], (string) $_POST['value']);
52 52
 		break;
53 53
 	case 'getApps':
54
-		$result=$appConfig->getApps();
54
+		$result = $appConfig->getApps();
55 55
 		break;
56 56
 	case 'getKeys':
57
-		$result=$appConfig->getKeys($app);
57
+		$result = $appConfig->getKeys($app);
58 58
 		break;
59 59
 	case 'hasKey':
60
-		$result=$appConfig->hasKey($app, (string)$_GET['key']);
60
+		$result = $appConfig->hasKey($app, (string) $_GET['key']);
61 61
 		break;
62 62
 	case 'deleteKey':
63
-		$result=$appConfig->deleteKey($app, (string)$_POST['key']);
63
+		$result = $appConfig->deleteKey($app, (string) $_POST['key']);
64 64
 		break;
65 65
 	case 'deleteApp':
66
-		$result=$appConfig->deleteApp($app);
66
+		$result = $appConfig->deleteApp($app);
67 67
 		break;
68 68
 }
69 69
 OC_JSON::success(array('data'=>$result));
Please login to merge, or discard this patch.
core/js/config.php 2 patches
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
  */
35 35
 
36 36
 if(!\OC::$server->getRequest()->passesStrictCookieCheck()) {
37
-	die();
37
+    die();
38 38
 }
39 39
 
40 40
 // Set the content type to Javascript
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 // Get the config
54 54
 $apps_paths = array();
55 55
 foreach(OC_App::getEnabledApps() as $app) {
56
-	$apps_paths[$app] = OC_App::getAppWebPath($app);
56
+    $apps_paths[$app] = OC_App::getAppWebPath($app);
57 57
 }
58 58
 
59 59
 $config = \OC::$server->getConfig();
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 $defaultExpireDateEnabled = ($value === 'yes') ? true :false;
62 62
 $defaultExpireDate = $enforceDefaultExpireDate = null;
63 63
 if ($defaultExpireDateEnabled) {
64
-	$defaultExpireDate = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
65
-	$value = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
66
-	$enforceDefaultExpireDate = ($value === 'yes') ? true : false;
64
+    $defaultExpireDate = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
65
+    $value = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
66
+    $enforceDefaultExpireDate = ($value === 'yes') ? true : false;
67 67
 }
68 68
 $outgoingServer2serverShareEnabled = $config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes';
69 69
 
@@ -71,123 +71,123 @@  discard block
 block discarded – undo
71 71
 
72 72
 $dataLocation = str_replace(OC::$SERVERROOT .'/', '', $config->getSystemValue('datadirectory', ''), $countOfDataLocation);
73 73
 if($countOfDataLocation !== 1 || !OC_User::isAdminUser(OC_User::getUser())){
74
-	$dataLocation = false;
74
+    $dataLocation = false;
75 75
 }
76 76
 
77 77
 $array = array(
78
-	"oc_debug" => $config->getSystemValue('debug', false) ? 'true' : 'false',
79
-	"oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false',
80
-	"oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false',
81
-	"oc_webroot" => "\"".OC::$WEBROOT."\"",
82
-	"oc_appswebroots" =>  str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
83
-	"datepickerFormatDate" => json_encode($l->l('jsdate', null)),
84
-	"dayNames" =>  json_encode(
85
-		array(
86
-			(string)$l->t('Sunday'),
87
-			(string)$l->t('Monday'),
88
-			(string)$l->t('Tuesday'),
89
-			(string)$l->t('Wednesday'),
90
-			(string)$l->t('Thursday'),
91
-			(string)$l->t('Friday'),
92
-			(string)$l->t('Saturday')
93
-		)
94
-	),
95
-	"dayNamesShort" =>  json_encode(
96
-		array(
97
-			(string)$l->t('Sun.'),
98
-			(string)$l->t('Mon.'),
99
-			(string)$l->t('Tue.'),
100
-			(string)$l->t('Wed.'),
101
-			(string)$l->t('Thu.'),
102
-			(string)$l->t('Fri.'),
103
-			(string)$l->t('Sat.')
104
-		)
105
-	),
106
-	"dayNamesMin" =>  json_encode(
107
-		array(
108
-			(string)$l->t('Su'),
109
-			(string)$l->t('Mo'),
110
-			(string)$l->t('Tu'),
111
-			(string)$l->t('We'),
112
-			(string)$l->t('Th'),
113
-			(string)$l->t('Fr'),
114
-			(string)$l->t('Sa')
115
-		)
116
-	),
117
-	"monthNames" => json_encode(
118
-		array(
119
-			(string)$l->t('January'),
120
-			(string)$l->t('February'),
121
-			(string)$l->t('March'),
122
-			(string)$l->t('April'),
123
-			(string)$l->t('May'),
124
-			(string)$l->t('June'),
125
-			(string)$l->t('July'),
126
-			(string)$l->t('August'),
127
-			(string)$l->t('September'),
128
-			(string)$l->t('October'),
129
-			(string)$l->t('November'),
130
-			(string)$l->t('December')
131
-		)
132
-	),
133
-	"monthNamesShort" => json_encode(
134
-		array(
135
-			(string)$l->t('Jan.'),
136
-			(string)$l->t('Feb.'),
137
-			(string)$l->t('Mar.'),
138
-			(string)$l->t('Apr.'),
139
-			(string)$l->t('May.'),
140
-			(string)$l->t('Jun.'),
141
-			(string)$l->t('Jul.'),
142
-			(string)$l->t('Aug.'),
143
-			(string)$l->t('Sep.'),
144
-			(string)$l->t('Oct.'),
145
-			(string)$l->t('Nov.'),
146
-			(string)$l->t('Dec.')
147
-		)
148
-	),
149
-	"firstDay" => json_encode($l->l('firstday', null)) ,
150
-	"oc_config" => json_encode(
151
-		array(
152
-			'session_lifetime'	=> min(\OCP\Config::getSystemValue('session_lifetime', OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')), OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')),
153
-			'session_keepalive'	=> \OCP\Config::getSystemValue('session_keepalive', true),
154
-			'version'			=> implode('.', \OCP\Util::getVersion()),
155
-			'versionstring'		=> OC_Util::getVersionString(),
156
-			'enable_avatars'	=> \OC::$server->getConfig()->getSystemValue('enable_avatars', true) === true,
157
-			'lost_password_link'=> \OC::$server->getConfig()->getSystemValue('lost_password_link', null),
158
-			'modRewriteWorking'	=> (getenv('front_controller_active') === 'true'),
159
-		)
160
-	),
161
-	"oc_appconfig" => json_encode(
162
-			array("core" => array(
163
-				'defaultExpireDateEnabled' => $defaultExpireDateEnabled,
164
-				'defaultExpireDate' => $defaultExpireDate,
165
-				'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
166
-				'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
167
-				'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
168
-				'resharingAllowed' => \OCP\Share::isResharingAllowed(),
169
-				'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
170
-				'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated'),
171
-				'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing()
172
-				)
173
-			)
174
-	),
175
-	"oc_defaults" => json_encode(
176
-		array(
177
-			'entity' => $defaults->getEntity(),
178
-			'name' => $defaults->getName(),
179
-			'title' => $defaults->getTitle(),
180
-			'baseUrl' => $defaults->getBaseUrl(),
181
-			'syncClientUrl' => $defaults->getSyncClientUrl(),
182
-			'docBaseUrl' => $defaults->getDocBaseUrl(),
183
-			'docPlaceholderUrl' => $defaults->buildDocLinkToKey('PLACEHOLDER'),
184
-			'slogan' => $defaults->getSlogan(),
185
-			'logoClaim' => $defaults->getLogoClaim(),
186
-			'shortFooter' => $defaults->getShortFooter(),
187
-			'longFooter' => $defaults->getLongFooter(),
188
-			'folder' => OC_Util::getTheme(),
189
-		)
190
-	)
78
+    "oc_debug" => $config->getSystemValue('debug', false) ? 'true' : 'false',
79
+    "oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false',
80
+    "oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false',
81
+    "oc_webroot" => "\"".OC::$WEBROOT."\"",
82
+    "oc_appswebroots" =>  str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
83
+    "datepickerFormatDate" => json_encode($l->l('jsdate', null)),
84
+    "dayNames" =>  json_encode(
85
+        array(
86
+            (string)$l->t('Sunday'),
87
+            (string)$l->t('Monday'),
88
+            (string)$l->t('Tuesday'),
89
+            (string)$l->t('Wednesday'),
90
+            (string)$l->t('Thursday'),
91
+            (string)$l->t('Friday'),
92
+            (string)$l->t('Saturday')
93
+        )
94
+    ),
95
+    "dayNamesShort" =>  json_encode(
96
+        array(
97
+            (string)$l->t('Sun.'),
98
+            (string)$l->t('Mon.'),
99
+            (string)$l->t('Tue.'),
100
+            (string)$l->t('Wed.'),
101
+            (string)$l->t('Thu.'),
102
+            (string)$l->t('Fri.'),
103
+            (string)$l->t('Sat.')
104
+        )
105
+    ),
106
+    "dayNamesMin" =>  json_encode(
107
+        array(
108
+            (string)$l->t('Su'),
109
+            (string)$l->t('Mo'),
110
+            (string)$l->t('Tu'),
111
+            (string)$l->t('We'),
112
+            (string)$l->t('Th'),
113
+            (string)$l->t('Fr'),
114
+            (string)$l->t('Sa')
115
+        )
116
+    ),
117
+    "monthNames" => json_encode(
118
+        array(
119
+            (string)$l->t('January'),
120
+            (string)$l->t('February'),
121
+            (string)$l->t('March'),
122
+            (string)$l->t('April'),
123
+            (string)$l->t('May'),
124
+            (string)$l->t('June'),
125
+            (string)$l->t('July'),
126
+            (string)$l->t('August'),
127
+            (string)$l->t('September'),
128
+            (string)$l->t('October'),
129
+            (string)$l->t('November'),
130
+            (string)$l->t('December')
131
+        )
132
+    ),
133
+    "monthNamesShort" => json_encode(
134
+        array(
135
+            (string)$l->t('Jan.'),
136
+            (string)$l->t('Feb.'),
137
+            (string)$l->t('Mar.'),
138
+            (string)$l->t('Apr.'),
139
+            (string)$l->t('May.'),
140
+            (string)$l->t('Jun.'),
141
+            (string)$l->t('Jul.'),
142
+            (string)$l->t('Aug.'),
143
+            (string)$l->t('Sep.'),
144
+            (string)$l->t('Oct.'),
145
+            (string)$l->t('Nov.'),
146
+            (string)$l->t('Dec.')
147
+        )
148
+    ),
149
+    "firstDay" => json_encode($l->l('firstday', null)) ,
150
+    "oc_config" => json_encode(
151
+        array(
152
+            'session_lifetime'	=> min(\OCP\Config::getSystemValue('session_lifetime', OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')), OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')),
153
+            'session_keepalive'	=> \OCP\Config::getSystemValue('session_keepalive', true),
154
+            'version'			=> implode('.', \OCP\Util::getVersion()),
155
+            'versionstring'		=> OC_Util::getVersionString(),
156
+            'enable_avatars'	=> \OC::$server->getConfig()->getSystemValue('enable_avatars', true) === true,
157
+            'lost_password_link'=> \OC::$server->getConfig()->getSystemValue('lost_password_link', null),
158
+            'modRewriteWorking'	=> (getenv('front_controller_active') === 'true'),
159
+        )
160
+    ),
161
+    "oc_appconfig" => json_encode(
162
+            array("core" => array(
163
+                'defaultExpireDateEnabled' => $defaultExpireDateEnabled,
164
+                'defaultExpireDate' => $defaultExpireDate,
165
+                'defaultExpireDateEnforced' => $enforceDefaultExpireDate,
166
+                'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(),
167
+                'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(),
168
+                'resharingAllowed' => \OCP\Share::isResharingAllowed(),
169
+                'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
170
+                'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated'),
171
+                'allowGroupSharing' => \OC::$server->getShareManager()->allowGroupSharing()
172
+                )
173
+            )
174
+    ),
175
+    "oc_defaults" => json_encode(
176
+        array(
177
+            'entity' => $defaults->getEntity(),
178
+            'name' => $defaults->getName(),
179
+            'title' => $defaults->getTitle(),
180
+            'baseUrl' => $defaults->getBaseUrl(),
181
+            'syncClientUrl' => $defaults->getSyncClientUrl(),
182
+            'docBaseUrl' => $defaults->getDocBaseUrl(),
183
+            'docPlaceholderUrl' => $defaults->buildDocLinkToKey('PLACEHOLDER'),
184
+            'slogan' => $defaults->getSlogan(),
185
+            'logoClaim' => $defaults->getLogoClaim(),
186
+            'shortFooter' => $defaults->getShortFooter(),
187
+            'longFooter' => $defaults->getLongFooter(),
188
+            'folder' => OC_Util::getTheme(),
189
+        )
190
+    )
191 191
 );
192 192
 
193 193
 // Allow hooks to modify the output values
@@ -195,5 +195,5 @@  discard block
 block discarded – undo
195 195
 
196 196
 // Echo it
197 197
 foreach ($array as  $setting => $value) {
198
-	echo("var ". $setting ."=".$value.";\n");
198
+    echo("var ". $setting ."=".$value.";\n");
199 199
 }
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  *
34 34
  */
35 35
 
36
-if(!\OC::$server->getRequest()->passesStrictCookieCheck()) {
36
+if (!\OC::$server->getRequest()->passesStrictCookieCheck()) {
37 37
 	die();
38 38
 }
39 39
 
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
 
53 53
 // Get the config
54 54
 $apps_paths = array();
55
-foreach(OC_App::getEnabledApps() as $app) {
55
+foreach (OC_App::getEnabledApps() as $app) {
56 56
 	$apps_paths[$app] = OC_App::getAppWebPath($app);
57 57
 }
58 58
 
59 59
 $config = \OC::$server->getConfig();
60 60
 $value = $config->getAppValue('core', 'shareapi_default_expire_date', 'no');
61
-$defaultExpireDateEnabled = ($value === 'yes') ? true :false;
61
+$defaultExpireDateEnabled = ($value === 'yes') ? true : false;
62 62
 $defaultExpireDate = $enforceDefaultExpireDate = null;
63 63
 if ($defaultExpireDateEnabled) {
64 64
 	$defaultExpireDate = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 
70 70
 $countOfDataLocation = 0;
71 71
 
72
-$dataLocation = str_replace(OC::$SERVERROOT .'/', '', $config->getSystemValue('datadirectory', ''), $countOfDataLocation);
73
-if($countOfDataLocation !== 1 || !OC_User::isAdminUser(OC_User::getUser())){
72
+$dataLocation = str_replace(OC::$SERVERROOT.'/', '', $config->getSystemValue('datadirectory', ''), $countOfDataLocation);
73
+if ($countOfDataLocation !== 1 || !OC_User::isAdminUser(OC_User::getUser())) {
74 74
 	$dataLocation = false;
75 75
 }
76 76
 
@@ -83,70 +83,70 @@  discard block
 block discarded – undo
83 83
 	"datepickerFormatDate" => json_encode($l->l('jsdate', null)),
84 84
 	"dayNames" =>  json_encode(
85 85
 		array(
86
-			(string)$l->t('Sunday'),
87
-			(string)$l->t('Monday'),
88
-			(string)$l->t('Tuesday'),
89
-			(string)$l->t('Wednesday'),
90
-			(string)$l->t('Thursday'),
91
-			(string)$l->t('Friday'),
92
-			(string)$l->t('Saturday')
86
+			(string) $l->t('Sunday'),
87
+			(string) $l->t('Monday'),
88
+			(string) $l->t('Tuesday'),
89
+			(string) $l->t('Wednesday'),
90
+			(string) $l->t('Thursday'),
91
+			(string) $l->t('Friday'),
92
+			(string) $l->t('Saturday')
93 93
 		)
94 94
 	),
95 95
 	"dayNamesShort" =>  json_encode(
96 96
 		array(
97
-			(string)$l->t('Sun.'),
98
-			(string)$l->t('Mon.'),
99
-			(string)$l->t('Tue.'),
100
-			(string)$l->t('Wed.'),
101
-			(string)$l->t('Thu.'),
102
-			(string)$l->t('Fri.'),
103
-			(string)$l->t('Sat.')
97
+			(string) $l->t('Sun.'),
98
+			(string) $l->t('Mon.'),
99
+			(string) $l->t('Tue.'),
100
+			(string) $l->t('Wed.'),
101
+			(string) $l->t('Thu.'),
102
+			(string) $l->t('Fri.'),
103
+			(string) $l->t('Sat.')
104 104
 		)
105 105
 	),
106 106
 	"dayNamesMin" =>  json_encode(
107 107
 		array(
108
-			(string)$l->t('Su'),
109
-			(string)$l->t('Mo'),
110
-			(string)$l->t('Tu'),
111
-			(string)$l->t('We'),
112
-			(string)$l->t('Th'),
113
-			(string)$l->t('Fr'),
114
-			(string)$l->t('Sa')
108
+			(string) $l->t('Su'),
109
+			(string) $l->t('Mo'),
110
+			(string) $l->t('Tu'),
111
+			(string) $l->t('We'),
112
+			(string) $l->t('Th'),
113
+			(string) $l->t('Fr'),
114
+			(string) $l->t('Sa')
115 115
 		)
116 116
 	),
117 117
 	"monthNames" => json_encode(
118 118
 		array(
119
-			(string)$l->t('January'),
120
-			(string)$l->t('February'),
121
-			(string)$l->t('March'),
122
-			(string)$l->t('April'),
123
-			(string)$l->t('May'),
124
-			(string)$l->t('June'),
125
-			(string)$l->t('July'),
126
-			(string)$l->t('August'),
127
-			(string)$l->t('September'),
128
-			(string)$l->t('October'),
129
-			(string)$l->t('November'),
130
-			(string)$l->t('December')
119
+			(string) $l->t('January'),
120
+			(string) $l->t('February'),
121
+			(string) $l->t('March'),
122
+			(string) $l->t('April'),
123
+			(string) $l->t('May'),
124
+			(string) $l->t('June'),
125
+			(string) $l->t('July'),
126
+			(string) $l->t('August'),
127
+			(string) $l->t('September'),
128
+			(string) $l->t('October'),
129
+			(string) $l->t('November'),
130
+			(string) $l->t('December')
131 131
 		)
132 132
 	),
133 133
 	"monthNamesShort" => json_encode(
134 134
 		array(
135
-			(string)$l->t('Jan.'),
136
-			(string)$l->t('Feb.'),
137
-			(string)$l->t('Mar.'),
138
-			(string)$l->t('Apr.'),
139
-			(string)$l->t('May.'),
140
-			(string)$l->t('Jun.'),
141
-			(string)$l->t('Jul.'),
142
-			(string)$l->t('Aug.'),
143
-			(string)$l->t('Sep.'),
144
-			(string)$l->t('Oct.'),
145
-			(string)$l->t('Nov.'),
146
-			(string)$l->t('Dec.')
135
+			(string) $l->t('Jan.'),
136
+			(string) $l->t('Feb.'),
137
+			(string) $l->t('Mar.'),
138
+			(string) $l->t('Apr.'),
139
+			(string) $l->t('May.'),
140
+			(string) $l->t('Jun.'),
141
+			(string) $l->t('Jul.'),
142
+			(string) $l->t('Aug.'),
143
+			(string) $l->t('Sep.'),
144
+			(string) $l->t('Oct.'),
145
+			(string) $l->t('Nov.'),
146
+			(string) $l->t('Dec.')
147 147
 		)
148 148
 	),
149
-	"firstDay" => json_encode($l->l('firstday', null)) ,
149
+	"firstDay" => json_encode($l->l('firstday', null)),
150 150
 	"oc_config" => json_encode(
151 151
 		array(
152 152
 			'session_lifetime'	=> min(\OCP\Config::getSystemValue('session_lifetime', OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')), OC::$server->getIniWrapper()->getNumeric('session.gc_maxlifetime')),
@@ -195,5 +195,5 @@  discard block
 block discarded – undo
195 195
 
196 196
 // Echo it
197 197
 foreach ($array as  $setting => $value) {
198
-	echo("var ". $setting ."=".$value.";\n");
198
+	echo("var ".$setting."=".$value.";\n");
199 199
 }
Please login to merge, or discard this patch.
settings/templates/email.new_user.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
12 12
 					<td width="20px">&nbsp;</td>
13 13
 					<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">
14 14
 						<?php
15
-						print_unescaped($l->t('Hey there,<br><br>just letting you know that you now have an %s account.<br><br>Your username: %s<br>Access it: <a href="%s">%s</a><br><br>', array($theme->getName(), $_['username'], $_['url'], $_['url'])));
15
+                        print_unescaped($l->t('Hey there,<br><br>just letting you know that you now have an %s account.<br><br>Your username: %s<br>Access it: <a href="%s">%s</a><br><br>', array($theme->getName(), $_['username'], $_['url'], $_['url'])));
16 16
 
17
-						// TRANSLATORS term at the end of a mail
18
-						p($l->t('Cheers!'));
19
-						?>
17
+                        // TRANSLATORS term at the end of a mail
18
+                        p($l->t('Cheers!'));
19
+                        ?>
20 20
 					</td>
21 21
 				</tr>
22 22
 				<tr><td colspan="2">&nbsp;</td></tr>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 	<tr><td>
7 7
 			<table cellspacing="0" cellpadding="0" border="0" width="600px">
8 8
 				<tr>
9
-					<td bgcolor="<?php p($theme->getMailHeaderColor());?>" width="20px">&nbsp;</td>
10
-					<td bgcolor="<?php p($theme->getMailHeaderColor());?>">
9
+					<td bgcolor="<?php p($theme->getMailHeaderColor()); ?>" width="20px">&nbsp;</td>
10
+					<td bgcolor="<?php p($theme->getMailHeaderColor()); ?>">
11 11
 						<img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.gif'))); ?>" alt="<?php p($theme->getName()); ?>"/>
12 12
 					</td>
13 13
 				</tr>
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 					<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">--<br>
29 29
 						<?php p($theme->getName()); ?> -
30 30
 						<?php p($theme->getSlogan()); ?>
31
-						<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl());?></a>
31
+						<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl()); ?></a>
32 32
 					</td>
33 33
 				</tr>
34 34
 				<tr>
Please login to merge, or discard this patch.