@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | $server->on('report', [$this, 'report']); |
| 76 | 76 | |
| 77 | - $server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] = |
|
| 77 | + $server->xml->elementMap['{'.self::NS_Nextcloud.'}calendar-search'] = |
|
| 78 | 78 | 'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport'; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function report($reportName, $report, $path) { |
| 90 | 90 | switch ($reportName) { |
| 91 | - case '{' . self::NS_Nextcloud . '}calendar-search': |
|
| 91 | + case '{'.self::NS_Nextcloud.'}calendar-search': |
|
| 92 | 92 | $this->server->transactionType = 'report-nc-calendar-search'; |
| 93 | 93 | $this->calendarSearch($report); |
| 94 | 94 | return false; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $reports = []; |
| 112 | 112 | if ($node instanceof CalendarHome) { |
| 113 | - $reports[] = '{' . self::NS_Nextcloud . '}calendar-search'; |
|
| 113 | + $reports[] = '{'.self::NS_Nextcloud.'}calendar-search'; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | return $reports; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | foreach ($nodePaths as $path) { |
| 142 | 142 | list($properties) = $this->server->getPropertiesForPath( |
| 143 | - $this->server->getRequestUri() . '/' . $path, |
|
| 143 | + $this->server->getRequestUri().'/'.$path, |
|
| 144 | 144 | $report->properties); |
| 145 | 145 | $result[] = $properties; |
| 146 | 146 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | public function __destruct() { |
| 67 | 67 | try { |
| 68 | 68 | $this->close(); |
| 69 | - } catch (SessionNotAvailableException $e){ |
|
| 69 | + } catch (SessionNotAvailableException $e) { |
|
| 70 | 70 | // This exception can occur if session is already closed |
| 71 | 71 | // So it is safe to ignore it and let the garbage collector to proceed |
| 72 | 72 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @return string|null Either the value or null |
| 103 | 103 | */ |
| 104 | 104 | public function get($key) { |
| 105 | - if(isset($this->sessionValues[$key])) { |
|
| 105 | + if (isset($this->sessionValues[$key])) { |
|
| 106 | 106 | return $this->sessionValues[$key]; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * Close the session and release the lock, also writes all changed data in batch |
| 169 | 169 | */ |
| 170 | 170 | public function close() { |
| 171 | - if($this->isModified) { |
|
| 171 | + if ($this->isModified) { |
|
| 172 | 172 | $encryptedValue = $this->crypto->encrypt(json_encode($this->sessionValues), $this->passphrase); |
| 173 | 173 | $this->session->set(self::encryptedSessionName, $encryptedValue); |
| 174 | 174 | $this->isModified = false; |
@@ -11,9 +11,9 @@ |
||
| 11 | 11 | <p class="settings-hint"><?php p($l->t('Allows users to share a personalized link to a file or folder by putting in an email address.')); ?></p> |
| 12 | 12 | |
| 13 | 13 | <p> |
| 14 | - <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) p('checked'); ?> /> |
|
| 14 | + <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if ($_['sendPasswordMail']) p('checked'); ?> /> |
|
| 15 | 15 | <label for="sendPasswordMail"><?php p($l->t('Send password by mail')); ?></label><br/> |
| 16 | - <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
| 16 | + <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if ($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
| 17 | 17 | <label for="enforcePasswordProtection"><?php p($l->t('Enforce password protection')); ?></label> |
| 18 | 18 | </p> |
| 19 | 19 | |
@@ -220,9 +220,9 @@ discard block |
||
| 220 | 220 | )) { |
| 221 | 221 | // note: pre-fetching only supported for depth <= 1 |
| 222 | 222 | $folderContent = $node->getChildren(); |
| 223 | - $fileIds[] = (int)$node->getId(); |
|
| 223 | + $fileIds[] = (int) $node->getId(); |
|
| 224 | 224 | foreach ($folderContent as $info) { |
| 225 | - $fileIds[] = (int)$info->getId(); |
|
| 225 | + $fileIds[] = (int) $info->getId(); |
|
| 226 | 226 | } |
| 227 | 227 | $tags = $this->getTagger()->getTagsForObjects($fileIds); |
| 228 | 228 | if ($tags === false) { |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | }); |
| 279 | 279 | |
| 280 | 280 | $propPatch->handle(self::FAVORITE_PROPERTYNAME, function($favState) use ($node) { |
| 281 | - if ((int)$favState === 1 || $favState === 'true') { |
|
| 281 | + if ((int) $favState === 1 || $favState === 'true') { |
|
| 282 | 282 | $this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE); |
| 283 | 283 | } else { |
| 284 | 284 | $this->getTagger()->unTag($node->getId(), self::TAG_FAVORITE); |
@@ -68,8 +68,8 @@ |
||
| 68 | 68 | $this->getBundles(), |
| 69 | 69 | $this->getDefaultInstallationBundle() |
| 70 | 70 | ); |
| 71 | - foreach($bundles as $bundle) { |
|
| 72 | - if($bundle->getIdentifier() === $identifier) { |
|
| 71 | + foreach ($bundles as $bundle) { |
|
| 72 | + if ($bundle->getIdentifier() === $identifier) { |
|
| 73 | 73 | return $bundle; |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -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 | } |
@@ -55,17 +55,17 @@ |
||
| 55 | 55 | |
| 56 | 56 | try { |
| 57 | 57 | $jobStartTime = time(); |
| 58 | - $logger->debug('Run ' . get_class($this) . ' job with ID ' . $this->getId(), ['app' => 'cron']); |
|
| 58 | + $logger->debug('Run '.get_class($this).' job with ID '.$this->getId(), ['app' => 'cron']); |
|
| 59 | 59 | $this->run($this->argument); |
| 60 | 60 | $timeTaken = time() - $jobStartTime; |
| 61 | 61 | |
| 62 | - $logger->debug('Finished ' . get_class($this) . ' job with ID ' . $this->getId() . ' in ' . $timeTaken . ' seconds', ['app' => 'cron']); |
|
| 62 | + $logger->debug('Finished '.get_class($this).' job with ID '.$this->getId().' in '.$timeTaken.' seconds', ['app' => 'cron']); |
|
| 63 | 63 | $jobList->setExecutionTime($this, $timeTaken); |
| 64 | 64 | } catch (\Exception $e) { |
| 65 | 65 | if ($logger) { |
| 66 | 66 | $logger->logException($e, [ |
| 67 | 67 | 'app' => 'core', |
| 68 | - 'message' => 'Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . ')' |
|
| 68 | + 'message' => 'Error while running background job (class: '.get_class($this).', arguments: '.print_r($this->argument, true).')' |
|
| 69 | 69 | ]); |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -107,32 +107,32 @@ discard block |
||
| 107 | 107 | case '{DAV:}prop': |
| 108 | 108 | $newProps['properties'] = array_keys($elem['value']); |
| 109 | 109 | break; |
| 110 | - case '{' . SearchPlugin::NS_Nextcloud . '}filter': |
|
| 110 | + case '{'.SearchPlugin::NS_Nextcloud.'}filter': |
|
| 111 | 111 | foreach ($elem['value'] as $subElem) { |
| 112 | - if ($subElem['name'] === '{' . SearchPlugin::NS_Nextcloud . '}comp-filter') { |
|
| 112 | + if ($subElem['name'] === '{'.SearchPlugin::NS_Nextcloud.'}comp-filter') { |
|
| 113 | 113 | if (!isset($newProps['filters']['comps']) || !is_array($newProps['filters']['comps'])) { |
| 114 | 114 | $newProps['filters']['comps'] = []; |
| 115 | 115 | } |
| 116 | 116 | $newProps['filters']['comps'][] = $subElem['value']; |
| 117 | - } elseif ($subElem['name'] === '{' . SearchPlugin::NS_Nextcloud . '}prop-filter') { |
|
| 117 | + } elseif ($subElem['name'] === '{'.SearchPlugin::NS_Nextcloud.'}prop-filter') { |
|
| 118 | 118 | if (!isset($newProps['filters']['props']) || !is_array($newProps['filters']['props'])) { |
| 119 | 119 | $newProps['filters']['props'] = []; |
| 120 | 120 | } |
| 121 | 121 | $newProps['filters']['props'][] = $subElem['value']; |
| 122 | - } elseif ($subElem['name'] === '{' . SearchPlugin::NS_Nextcloud . '}param-filter') { |
|
| 122 | + } elseif ($subElem['name'] === '{'.SearchPlugin::NS_Nextcloud.'}param-filter') { |
|
| 123 | 123 | if (!isset($newProps['filters']['params']) || !is_array($newProps['filters']['params'])) { |
| 124 | 124 | $newProps['filters']['params'] = []; |
| 125 | 125 | } |
| 126 | 126 | $newProps['filters']['params'][] = $subElem['value']; |
| 127 | - } elseif ($subElem['name'] === '{' . SearchPlugin::NS_Nextcloud . '}search-term') { |
|
| 127 | + } elseif ($subElem['name'] === '{'.SearchPlugin::NS_Nextcloud.'}search-term') { |
|
| 128 | 128 | $newProps['filters']['search-term'] = $subElem['value']; |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | break; |
| 132 | - case '{' . SearchPlugin::NS_Nextcloud . '}limit': |
|
| 132 | + case '{'.SearchPlugin::NS_Nextcloud.'}limit': |
|
| 133 | 133 | $newProps['limit'] = $elem['value']; |
| 134 | 134 | break; |
| 135 | - case '{' . SearchPlugin::NS_Nextcloud . '}offset': |
|
| 135 | + case '{'.SearchPlugin::NS_Nextcloud.'}offset': |
|
| 136 | 136 | $newProps['offset'] = $elem['value']; |
| 137 | 137 | break; |
| 138 | 138 | |
@@ -140,21 +140,21 @@ discard block |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | if (empty($newProps['filters'])) { |
| 143 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}filter element is required for this request'); |
|
| 143 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}filter element is required for this request'); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $propsOrParamsDefined = (!empty($newProps['filters']['props']) || !empty($newProps['filters']['params'])); |
| 147 | 147 | $noCompsDefined = empty($newProps['filters']['comps']); |
| 148 | 148 | if ($propsOrParamsDefined && $noCompsDefined) { |
| 149 | - throw new BadRequest('{' . SearchPlugin::NS_Nextcloud . '}prop-filter or {' . SearchPlugin::NS_Nextcloud . '}param-filter given without any {' . SearchPlugin::NS_Nextcloud . '}comp-filter'); |
|
| 149 | + throw new BadRequest('{'.SearchPlugin::NS_Nextcloud.'}prop-filter or {'.SearchPlugin::NS_Nextcloud.'}param-filter given without any {'.SearchPlugin::NS_Nextcloud.'}comp-filter'); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if (!isset($newProps['filters']['search-term'])) { |
| 153 | - throw new BadRequest('{' . SearchPlugin::NS_Nextcloud . '}search-term is required for this request'); |
|
| 153 | + throw new BadRequest('{'.SearchPlugin::NS_Nextcloud.'}search-term is required for this request'); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | if (empty($newProps['filters']['props']) && empty($newProps['filters']['params'])) { |
| 157 | - throw new BadRequest('At least one{' . SearchPlugin::NS_Nextcloud . '}prop-filter or {' . SearchPlugin::NS_Nextcloud . '}param-filter is required for this request'); |
|
| 157 | + throw new BadRequest('At least one{'.SearchPlugin::NS_Nextcloud.'}prop-filter or {'.SearchPlugin::NS_Nextcloud.'}param-filter is required for this request'); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
@@ -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 | } |