@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | protected function execute(InputInterface $input, OutputInterface $output) { |
74 | - $groups = $this->groupManager->search('', (int)$input->getOption('limit'), (int)$input->getOption('offset')); |
|
74 | + $groups = $this->groupManager->search('', (int) $input->getOption('limit'), (int) $input->getOption('offset')); |
|
75 | 75 | $this->writeArrayInOutputFormat($input, $output, $this->formatGroups($groups)); |
76 | 76 | } |
77 | 77 | |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | * @return array |
81 | 81 | */ |
82 | 82 | private function formatGroups(array $groups) { |
83 | - $keys = array_map(function (IGroup $group) { |
|
83 | + $keys = array_map(function(IGroup $group) { |
|
84 | 84 | return $group->getGID(); |
85 | 85 | }, $groups); |
86 | - $values = array_map(function (IGroup $group) { |
|
86 | + $values = array_map(function(IGroup $group) { |
|
87 | 87 | return array_keys($group->getUsers()); |
88 | 88 | }, $groups); |
89 | 89 | return array_combine($keys, $values); |
@@ -4,6 +4,6 @@ |
||
4 | 4 | * See the COPYING-README file. |
5 | 5 | */?> |
6 | 6 | |
7 | -<?php foreach($_['forms'] as $form) { |
|
7 | +<?php foreach ($_['forms'] as $form) { |
|
8 | 8 | print_unescaped($form); |
9 | 9 | }; |
@@ -1,35 +1,35 @@ |
||
1 | 1 | <div class="quota"> |
2 | 2 | <!-- Default storage --> |
3 | - <span><?php p($l->t('Default quota'));?></span> |
|
4 | - <?php if((bool) $_['isAdmin']): ?> |
|
3 | + <span><?php p($l->t('Default quota')); ?></span> |
|
4 | + <?php if ((bool) $_['isAdmin']): ?> |
|
5 | 5 | <select id='default_quota' data-inputtitle="<?php p($l->t('Please enter storage quota (ex: "512 MB" or "12 GB")')) ?>" data-tipsy-gravity="s"> |
6 | - <option <?php if($_['default_quota'] === 'none') print_unescaped('selected="selected"');?> value='none'> |
|
7 | - <?php p($l->t('Unlimited'));?> |
|
6 | + <option <?php if ($_['default_quota'] === 'none') print_unescaped('selected="selected"'); ?> value='none'> |
|
7 | + <?php p($l->t('Unlimited')); ?> |
|
8 | 8 | </option> |
9 | - <?php foreach($_['quota_preset'] as $preset):?> |
|
10 | - <?php if($preset !== 'default'):?> |
|
11 | - <option <?php if($_['default_quota']==$preset) print_unescaped('selected="selected"');?> value='<?php p($preset);?>'> |
|
12 | - <?php p($preset);?> |
|
9 | + <?php foreach ($_['quota_preset'] as $preset):?> |
|
10 | + <?php if ($preset !== 'default'):?> |
|
11 | + <option <?php if ($_['default_quota'] == $preset) print_unescaped('selected="selected"'); ?> value='<?php p($preset); ?>'> |
|
12 | + <?php p($preset); ?> |
|
13 | 13 | </option> |
14 | - <?php endif;?> |
|
15 | - <?php endforeach;?> |
|
16 | - <?php if($_['defaultQuotaIsUserDefined']):?> |
|
17 | - <option selected="selected" value='<?php p($_['default_quota']);?>'> |
|
18 | - <?php p($_['default_quota']);?> |
|
14 | + <?php endif; ?> |
|
15 | + <?php endforeach; ?> |
|
16 | + <?php if ($_['defaultQuotaIsUserDefined']):?> |
|
17 | + <option selected="selected" value='<?php p($_['default_quota']); ?>'> |
|
18 | + <?php p($_['default_quota']); ?> |
|
19 | 19 | </option> |
20 | - <?php endif;?> |
|
20 | + <?php endif; ?> |
|
21 | 21 | <option data-new value='other'> |
22 | - <?php p($l->t('Other'));?> |
|
22 | + <?php p($l->t('Other')); ?> |
|
23 | 23 | ... |
24 | 24 | </option> |
25 | 25 | </select> |
26 | 26 | <?php endif; ?> |
27 | - <?php if((bool) !$_['isAdmin']): ?> |
|
27 | + <?php if ((bool) !$_['isAdmin']): ?> |
|
28 | 28 | : |
29 | - <?php if( $_['default_quota'] === 'none'): ?> |
|
30 | - <?php p($l->t('Unlimited'));?> |
|
29 | + <?php if ($_['default_quota'] === 'none'): ?> |
|
30 | + <?php p($l->t('Unlimited')); ?> |
|
31 | 31 | <?php else: ?> |
32 | - <?php p($_['default_quota']);?> |
|
32 | + <?php p($_['default_quota']); ?> |
|
33 | 33 | <?php endif; ?> |
34 | 34 | <?php endif; ?> |
35 | 35 | </div> |
@@ -13,7 +13,7 @@ |
||
13 | 13 | <div class="groups"><div class="groupsListContainer multiselect button" data-placeholder="<?php p($l->t('Groups'))?>"><span class="title groupsList"></span><span class="icon-triangle-s"></span></div></div> |
14 | 14 | <input type="submit" class="button" value="<?php p($l->t('Create'))?>" /> |
15 | 15 | </form> |
16 | - <?php if((bool)$_['recoveryAdminEnabled']): ?> |
|
16 | + <?php if ((bool) $_['recoveryAdminEnabled']): ?> |
|
17 | 17 | <div class="recoveryPassword"> |
18 | 18 | <input id="recoveryPassword" |
19 | 19 | type="password" |
@@ -35,42 +35,42 @@ |
||
35 | 35 | $lastConfirm = (int) \OC::$server->getSession()->get('last-password-confirm'); |
36 | 36 | if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay |
37 | 37 | $l = \OC::$server->getL10N('core'); |
38 | - OC_JSON::error(array( 'data' => array( 'message' => $l->t('Password confirmation is required')))); |
|
38 | + OC_JSON::error(array('data' => array('message' => $l->t('Password confirmation is required')))); |
|
39 | 39 | exit(); |
40 | 40 | } |
41 | 41 | |
42 | -$username = isset($_POST["username"]) ? (string)$_POST["username"] : ''; |
|
42 | +$username = isset($_POST["username"]) ? (string) $_POST["username"] : ''; |
|
43 | 43 | |
44 | 44 | $isUserAccessible = false; |
45 | 45 | $currentUserObject = \OC::$server->getUserSession()->getUser(); |
46 | 46 | $targetUserObject = \OC::$server->getUserManager()->get($username); |
47 | -if($targetUserObject !== null && $currentUserObject !== null) { |
|
47 | +if ($targetUserObject !== null && $currentUserObject !== null) { |
|
48 | 48 | $isUserAccessible = \OC::$server->getGroupManager()->getSubAdmin()->isUserAccessible($currentUserObject, $targetUserObject); |
49 | 49 | } |
50 | 50 | |
51 | -if(($username === '' && !OC_User::isAdminUser(OC_User::getUser())) |
|
51 | +if (($username === '' && !OC_User::isAdminUser(OC_User::getUser())) |
|
52 | 52 | || (!OC_User::isAdminUser(OC_User::getUser()) |
53 | 53 | && !$isUserAccessible)) { |
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 | 59 | //make sure the quota is in the expected format |
60 | -$quota= (string)$_POST["quota"]; |
|
61 | -if($quota !== 'none' and $quota !== 'default') { |
|
62 | - $quota= OC_Helper::computerFileSize($quota); |
|
63 | - $quota=OC_Helper::humanFileSize($quota); |
|
60 | +$quota = (string) $_POST["quota"]; |
|
61 | +if ($quota !== 'none' and $quota !== 'default') { |
|
62 | + $quota = OC_Helper::computerFileSize($quota); |
|
63 | + $quota = OC_Helper::humanFileSize($quota); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | // Return Success story |
67 | -if($username) { |
|
67 | +if ($username) { |
|
68 | 68 | $targetUserObject->setQuota($quota); |
69 | -}else{//set the default quota when no username is specified |
|
70 | - if($quota === 'default') {//'default' as default quota makes no sense |
|
71 | - $quota='none'; |
|
69 | +} else {//set the default quota when no username is specified |
|
70 | + if ($quota === 'default') {//'default' as default quota makes no sense |
|
71 | + $quota = 'none'; |
|
72 | 72 | } |
73 | 73 | \OC::$server->getAppConfig()->setValue('files', 'default_quota', $quota); |
74 | 74 | } |
75 | -OC_JSON::success(array("data" => array( "username" => $username , 'quota' => $quota))); |
|
75 | +OC_JSON::success(array("data" => array("username" => $username, 'quota' => $quota))); |
|
76 | 76 |
@@ -130,7 +130,7 @@ |
||
130 | 130 | } catch (\Exception $e) { |
131 | 131 | return [ |
132 | 132 | 'data' => [ |
133 | - 'message' => (string)$this->l10n->t('A problem occurred, please check your log files (Error: %s)', [$e->getMessage()]), |
|
133 | + 'message' => (string) $this->l10n->t('A problem occurred, please check your log files (Error: %s)', [$e->getMessage()]), |
|
134 | 134 | ], |
135 | 135 | 'status' => 'error', |
136 | 136 | ]; |
@@ -97,7 +97,7 @@ |
||
97 | 97 | |
98 | 98 | $params = get_defined_vars(); |
99 | 99 | $configs = []; |
100 | - foreach($params as $key => $value) { |
|
100 | + foreach ($params as $key => $value) { |
|
101 | 101 | $configs[$key] = (empty($value)) ? null : $value; |
102 | 102 | } |
103 | 103 |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | * @throws \Exception |
60 | 60 | */ |
61 | 61 | public function beforeController($controller, $methodName) { |
62 | - if(!$this->reflector->hasAnnotation('NoSubadminRequired')) { |
|
63 | - if(!$this->isSubAdmin) { |
|
62 | + if (!$this->reflector->hasAnnotation('NoSubadminRequired')) { |
|
63 | + if (!$this->isSubAdmin) { |
|
64 | 64 | throw new NotAdminException('Logged in user must be a subadmin'); |
65 | 65 | } |
66 | 66 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @throws \Exception |
76 | 76 | */ |
77 | 77 | public function afterException($controller, $methodName, \Exception $exception) { |
78 | - if($exception instanceof NotAdminException) { |
|
78 | + if ($exception instanceof NotAdminException) { |
|
79 | 79 | $response = new TemplateResponse('core', '403', array(), 'guest'); |
80 | 80 | $response->setStatus(Http::STATUS_FORBIDDEN); |
81 | 81 | return $response; |
@@ -31,28 +31,28 @@ |
||
31 | 31 | OC_Util::checkLoggedIn(); |
32 | 32 | |
33 | 33 | // Load the files we need |
34 | -OC_Util::addStyle( "settings", "settings" ); |
|
34 | +OC_Util::addStyle("settings", "settings"); |
|
35 | 35 | \OC::$server->getNavigationManager()->setActiveEntry('help'); |
36 | 36 | |
37 | 37 | |
38 | -if(isset($_GET['mode']) and $_GET['mode'] === 'admin') { |
|
39 | - $url=\OCP\Util::linkToAbsolute( 'core', 'doc/admin/index.html' ); |
|
40 | - $style1=''; |
|
41 | - $style2=' active'; |
|
42 | -}else{ |
|
43 | - $url=\OCP\Util::linkToAbsolute( 'core', 'doc/user/index.html' ); |
|
44 | - $style1=' active'; |
|
45 | - $style2=''; |
|
38 | +if (isset($_GET['mode']) and $_GET['mode'] === 'admin') { |
|
39 | + $url = \OCP\Util::linkToAbsolute('core', 'doc/admin/index.html'); |
|
40 | + $style1 = ''; |
|
41 | + $style2 = ' active'; |
|
42 | +} else { |
|
43 | + $url = \OCP\Util::linkToAbsolute('core', 'doc/user/index.html'); |
|
44 | + $style1 = ' active'; |
|
45 | + $style2 = ''; |
|
46 | 46 | } |
47 | 47 | |
48 | -$url1=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=user'; |
|
49 | -$url2=\OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=admin'; |
|
48 | +$url1 = \OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=user'; |
|
49 | +$url2 = \OC::$server->getURLGenerator()->linkToRoute('settings_help').'?mode=admin'; |
|
50 | 50 | |
51 | -$tmpl = new OC_Template( "settings", "help", "user" ); |
|
52 | -$tmpl->assign( "admin", OC_User::isAdminUser(OC_User::getUser())); |
|
53 | -$tmpl->assign( "url", $url ); |
|
54 | -$tmpl->assign( "url1", $url1 ); |
|
55 | -$tmpl->assign( "url2", $url2 ); |
|
56 | -$tmpl->assign( "style1", $style1 ); |
|
57 | -$tmpl->assign( "style2", $style2 ); |
|
51 | +$tmpl = new OC_Template("settings", "help", "user"); |
|
52 | +$tmpl->assign("admin", OC_User::isAdminUser(OC_User::getUser())); |
|
53 | +$tmpl->assign("url", $url); |
|
54 | +$tmpl->assign("url1", $url1); |
|
55 | +$tmpl->assign("url2", $url2); |
|
56 | +$tmpl->assign("style1", $style1); |
|
57 | +$tmpl->assign("style2", $style2); |
|
58 | 58 | $tmpl->printPage(); |