Completed
Pull Request — stable9 (#4226)
by Lukas
11:11
created
settings/ajax/togglesubadmins.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,20 +24,20 @@
 block discarded – undo
24 24
 OC_JSON::checkAdminUser();
25 25
 OCP\JSON::callCheck();
26 26
 
27
-$username = (string)$_POST['username'];
28
-$group = (string)$_POST['group'];
27
+$username = (string) $_POST['username'];
28
+$group = (string) $_POST['group'];
29 29
 
30 30
 $subAdminManager = \OC::$server->getGroupManager()->getSubAdmin();
31 31
 $targetUserObject = \OC::$server->getUserManager()->get($username);
32 32
 $targetGroupObject = \OC::$server->getGroupManager()->get($group);
33 33
 
34 34
 $isSubAdminOfGroup = false;
35
-if($targetUserObject !== null && $targetUserObject !== null) {
35
+if ($targetUserObject !== null && $targetUserObject !== null) {
36 36
 	$isSubAdminOfGroup = $subAdminManager->isSubAdminofGroup($targetUserObject, $targetGroupObject);
37 37
 }
38 38
 
39 39
 // Toggle group
40
-if($isSubAdminOfGroup) {
40
+if ($isSubAdminOfGroup) {
41 41
 	$subAdminManager->deleteSubAdmin($targetUserObject, $targetGroupObject);
42 42
 } else {
43 43
 	$subAdminManager->createSubAdmin($targetUserObject, $targetGroupObject);
Please login to merge, or discard this patch.
settings/ajax/disableapp.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
 	exit;
30 30
 }
31 31
 
32
-$appId = (string)$_POST['appid'];
32
+$appId = (string) $_POST['appid'];
33 33
 $appId = OC_App::cleanAppId($appId);
34 34
 
35 35
 OC_App::disable($appId);
Please login to merge, or discard this patch.
settings/ajax/enableapp.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@
 block discarded – undo
28 28
 OC_JSON::checkAdminUser();
29 29
 OCP\JSON::callCheck();
30 30
 
31
-$groups = isset($_POST['groups']) ? (array)$_POST['groups'] : null;
31
+$groups = isset($_POST['groups']) ? (array) $_POST['groups'] : null;
32 32
 
33 33
 try {
34
-	$app = OC_App::cleanAppId((string)$_POST['appid']);
34
+	$app = OC_App::cleanAppId((string) $_POST['appid']);
35 35
 	OC_App::enable($app, $groups);
36 36
 	OC_JSON::success(['data' => ['update_required' => \OC_App::shouldUpgrade($app)]]);
37 37
 } catch (Exception $e) {
38 38
 	\OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR);
39
-	OC_JSON::error(array("data" => array("message" => $e->getMessage()) ));
39
+	OC_JSON::error(array("data" => array("message" => $e->getMessage())));
40 40
 }
Please login to merge, or discard this patch.
settings/ajax/togglegroups.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 OCP\JSON::callCheck();
30 30
 
31 31
 $success = true;
32
-$username = (string)$_POST['username'];
33
-$group = (string)$_POST['group'];
32
+$username = (string) $_POST['username'];
33
+$group = (string) $_POST['group'];
34 34
 
35
-if($username === OC_User::getUser() && $group === "admin" &&  OC_User::isAdminUser($username)) {
35
+if ($username === OC_User::getUser() && $group === "admin" && OC_User::isAdminUser($username)) {
36 36
 	$l = \OC::$server->getL10N('core');
37
-	OC_JSON::error(array( 'data' => array( 'message' => $l->t('Admins can\'t remove themself from the admin group'))));
37
+	OC_JSON::error(array('data' => array('message' => $l->t('Admins can\'t remove themself from the admin group'))));
38 38
 	exit();
39 39
 }
40 40
 
@@ -43,20 +43,20 @@  discard block
 block discarded – undo
43 43
 $currentUserObject = \OC::$server->getUserSession()->getUser();
44 44
 $targetUserObject = \OC::$server->getUserManager()->get($username);
45 45
 $targetGroupObject = \OC::$server->getGroupManager()->get($group);
46
-if($targetUserObject !== null && $currentUserObject !== null && $targetGroupObject !== null) {
46
+if ($targetUserObject !== null && $currentUserObject !== null && $targetGroupObject !== null) {
47 47
 	$isUserAccessible = \OC::$server->getGroupManager()->getSubAdmin()->isUserAccessible($currentUserObject, $targetUserObject);
48 48
 	$isGroupAccessible = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdminofGroup($currentUserObject, $targetGroupObject);
49 49
 }
50 50
 
51
-if(!OC_User::isAdminUser(OC_User::getUser())
51
+if (!OC_User::isAdminUser(OC_User::getUser())
52 52
 	&& (!$isUserAccessible
53 53
 		|| !$isGroupAccessible)) {
54 54
 	$l = \OC::$server->getL10N('core');
55
-	OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
55
+	OC_JSON::error(array('data' => array('message' => $l->t('Authentication error'))));
56 56
 	exit();
57 57
 }
58 58
 
59
-if(!OC_Group::groupExists($group)) {
59
+if (!OC_Group::groupExists($group)) {
60 60
 	OC_Group::createGroup($group);
61 61
 }
62 62
 
@@ -66,20 +66,20 @@  discard block
 block discarded – undo
66 66
 $action = "add";
67 67
 
68 68
 // Toggle group
69
-if( OC_Group::inGroup( $username, $group )) {
69
+if (OC_Group::inGroup($username, $group)) {
70 70
 	$action = "remove";
71 71
 	$error = $l->t("Unable to remove user from group %s", $group);
72
-	$success = OC_Group::removeFromGroup( $username, $group );
73
-	$usersInGroup=OC_Group::usersInGroup($group);
72
+	$success = OC_Group::removeFromGroup($username, $group);
73
+	$usersInGroup = OC_Group::usersInGroup($group);
74 74
 }
75
-else{
76
-	$success = OC_Group::addToGroup( $username, $group );
75
+else {
76
+	$success = OC_Group::addToGroup($username, $group);
77 77
 }
78 78
 
79 79
 // Return Success story
80
-if( $success ) {
81
-	OC_JSON::success(array("data" => array( "username" => $username, "action" => $action, "groupname" => $group )));
80
+if ($success) {
81
+	OC_JSON::success(array("data" => array("username" => $username, "action" => $action, "groupname" => $group)));
82 82
 }
83
-else{
84
-	OC_JSON::error(array("data" => array( "message" => $error )));
83
+else {
84
+	OC_JSON::error(array("data" => array("message" => $error)));
85 85
 }
Please login to merge, or discard this patch.
settings/ajax/setquota.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -32,38 +32,38 @@
 block discarded – undo
32 32
 OC_JSON::checkSubAdminUser();
33 33
 OCP\JSON::callCheck();
34 34
 
35
-$username = isset($_POST["username"]) ? (string)$_POST["username"] : '';
35
+$username = isset($_POST["username"]) ? (string) $_POST["username"] : '';
36 36
 
37 37
 $isUserAccessible = false;
38 38
 $currentUserObject = \OC::$server->getUserSession()->getUser();
39 39
 $targetUserObject = \OC::$server->getUserManager()->get($username);
40
-if($targetUserObject !== null && $currentUserObject !== null) {
40
+if ($targetUserObject !== null && $currentUserObject !== null) {
41 41
 	$isUserAccessible = \OC::$server->getGroupManager()->getSubAdmin()->isUserAccessible($currentUserObject, $targetUserObject);
42 42
 }
43 43
 
44
-if(($username === '' && !OC_User::isAdminUser(OC_User::getUser()))
44
+if (($username === '' && !OC_User::isAdminUser(OC_User::getUser()))
45 45
 	|| (!OC_User::isAdminUser(OC_User::getUser())
46 46
 		&& !$isUserAccessible)) {
47 47
 	$l = \OC::$server->getL10N('core');
48
-	OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
48
+	OC_JSON::error(array('data' => array('message' => $l->t('Authentication error'))));
49 49
 	exit();
50 50
 }
51 51
 
52 52
 //make sure the quota is in the expected format
53
-$quota= (string)$_POST["quota"];
54
-if($quota !== 'none' and $quota !== 'default') {
55
-	$quota= OC_Helper::computerFileSize($quota);
56
-	$quota=OC_Helper::humanFileSize($quota);
53
+$quota = (string) $_POST["quota"];
54
+if ($quota !== 'none' and $quota !== 'default') {
55
+	$quota = OC_Helper::computerFileSize($quota);
56
+	$quota = OC_Helper::humanFileSize($quota);
57 57
 }
58 58
 
59 59
 // Return Success story
60
-if($username) {
60
+if ($username) {
61 61
 	$targetUserObject->setQuota($quota);
62
-}else{//set the default quota when no username is specified
63
-	if($quota === 'default') {//'default' as default quota makes no sense
64
-		$quota='none';
62
+} else {//set the default quota when no username is specified
63
+	if ($quota === 'default') {//'default' as default quota makes no sense
64
+		$quota = 'none';
65 65
 	}
66 66
 	\OC::$server->getAppConfig()->setValue('files', 'default_quota', $quota);
67 67
 }
68
-OC_JSON::success(array("data" => array( "username" => $username , 'quota' => $quota)));
68
+OC_JSON::success(array("data" => array("username" => $username, 'quota' => $quota)));
69 69
 
Please login to merge, or discard this patch.
settings/ajax/installapp.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@
 block discarded – undo
29 29
 	exit;
30 30
 }
31 31
 
32
-$appId = (string)$_POST['appid'];
32
+$appId = (string) $_POST['appid'];
33 33
 $appId = OC_App::cleanAppId($appId);
34 34
 
35 35
 $result = OC_App::installApp($appId);
36
-if($result !== false) {
36
+if ($result !== false) {
37 37
 	// FIXME: Clear the cache - move that into some sane helper method
38 38
 	\OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-0');
39 39
 	\OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-1');
40 40
 	OC_JSON::success(array('data' => array('appid' => $appId)));
41 41
 } else {
42 42
 	$l = \OC::$server->getL10N('settings');
43
-	OC_JSON::error(array("data" => array( "message" => $l->t("Couldn't remove app.") )));
43
+	OC_JSON::error(array("data" => array("message" => $l->t("Couldn't remove app."))));
44 44
 }
Please login to merge, or discard this patch.
settings/ajax/uninstallapp.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@
 block discarded – undo
29 29
 	exit;
30 30
 }
31 31
 
32
-$appId = (string)$_POST['appid'];
32
+$appId = (string) $_POST['appid'];
33 33
 $appId = OC_App::cleanAppId($appId);
34 34
 
35 35
 $result = OC_App::removeApp($appId);
36
-if($result !== false) {
36
+if ($result !== false) {
37 37
 	// FIXME: Clear the cache - move that into some sane helper method
38 38
 	\OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-0');
39 39
 	\OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-1');
40 40
 	OC_JSON::success(array('data' => array('appid' => $appId)));
41 41
 } else {
42 42
 	$l = \OC::$server->getL10N('settings');
43
-	OC_JSON::error(array("data" => array( "message" => $l->t("Couldn't remove app.") )));
43
+	OC_JSON::error(array("data" => array("message" => $l->t("Couldn't remove app."))));
44 44
 }
Please login to merge, or discard this patch.
status.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,13 +29,13 @@
 block discarded – undo
29 29
 
30 30
 try {
31 31
 
32
-	require_once __DIR__ . '/lib/base.php';
32
+	require_once __DIR__.'/lib/base.php';
33 33
 
34 34
 	$systemConfig = \OC::$server->getSystemConfig();
35 35
 
36 36
 	$installed = (bool) $systemConfig->getValue('installed', false);
37 37
 	$maintenance = (bool) $systemConfig->getValue('maintenance', false);
38
-	$values=array(
38
+	$values = array(
39 39
 		'installed'=>$installed,
40 40
 		'maintenance' => $maintenance,
41 41
 		'version'=>implode('.', \OCP\Util::getVersion()),
Please login to merge, or discard this patch.
core/templates/mail.php 1 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.