@@ -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 | ]; |
@@ -100,15 +100,15 @@ discard block |
||
100 | 100 | * @return DataResponse |
101 | 101 | */ |
102 | 102 | public function create($id) { |
103 | - if($this->groupManager->groupExists($id)) { |
|
103 | + if ($this->groupManager->groupExists($id)) { |
|
104 | 104 | return new DataResponse( |
105 | 105 | array( |
106 | - 'message' => (string)$this->l10n->t('Group already exists.') |
|
106 | + 'message' => (string) $this->l10n->t('Group already exists.') |
|
107 | 107 | ), |
108 | 108 | Http::STATUS_CONFLICT |
109 | 109 | ); |
110 | 110 | } |
111 | - if($this->groupManager->createGroup($id)) { |
|
111 | + if ($this->groupManager->createGroup($id)) { |
|
112 | 112 | return new DataResponse( |
113 | 113 | array( |
114 | 114 | 'groupname' => $id |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | array( |
122 | 122 | 'status' => 'error', |
123 | 123 | 'data' => array( |
124 | - 'message' => (string)$this->l10n->t('Unable to add group.') |
|
124 | + 'message' => (string) $this->l10n->t('Unable to add group.') |
|
125 | 125 | ) |
126 | 126 | ), |
127 | 127 | Http::STATUS_FORBIDDEN |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | array( |
153 | 153 | 'status' => 'error', |
154 | 154 | 'data' => array( |
155 | - 'message' => (string)$this->l10n->t('Unable to delete group.') |
|
155 | + 'message' => (string) $this->l10n->t('Unable to delete group.') |
|
156 | 156 | ), |
157 | 157 | ), |
158 | 158 | Http::STATUS_FORBIDDEN |
@@ -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(); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | * @param string $msg the error message |
38 | 38 | * @since 7.0.0 |
39 | 39 | */ |
40 | - public function __construct($msg){ |
|
40 | + public function __construct($msg) { |
|
41 | 41 | parent::__construct($msg); |
42 | 42 | } |
43 | 43 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | */ |
62 | 62 | public function addEntityCollection($name, \Closure $entityExistsFunction) { |
63 | 63 | if (isset($this->collections[$name])) { |
64 | - throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"'); |
|
64 | + throw new \OutOfBoundsException('Duplicate entity name "'.$name.'"'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $this->collections[$name] = $entityExistsFunction; |
@@ -197,7 +197,7 @@ |
||
197 | 197 | protected function setSubjects(IEvent $event, $subject, array $parameters) { |
198 | 198 | $placeholders = $replacements = []; |
199 | 199 | foreach ($parameters as $placeholder => $parameter) { |
200 | - $placeholders[] = '{' . $placeholder . '}'; |
|
200 | + $placeholders[] = '{'.$placeholder.'}'; |
|
201 | 201 | if ($parameter['type'] === 'file') { |
202 | 202 | $replacements[] = $parameter['path']; |
203 | 203 | } else { |