Skip to content

Commit 1c1492a

Browse files
committed
Allow the endpoints
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 831def8 commit 1c1492a

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

lib/Controller/LogController.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function __construct($appName,
4949
}
5050

5151
/**
52+
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
5253
* @param int $count
5354
* @param int $offset
5455
* @param string $levels
@@ -71,6 +72,7 @@ private function getLastItem($levels) {
7172
}
7273

7374
/**
75+
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
7476
* @brief polls for a new log message since $lastReqId.
7577
* This method will sleep for maximum 20 seconds before returning an empty
7678
* result.
@@ -121,6 +123,7 @@ public function poll(string $lastReqId, string $levels = '11111'): JSONResponse
121123
}
122124

123125
/**
126+
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
124127
* @param string $query
125128
* @param int $count
126129
* @param int $offset
@@ -138,11 +141,17 @@ public function search($query = '', $count = 50, $offset = 0, $levels = '11111')
138141
return $this->responseFromIterator($iterator, $count, $offset);
139142
}
140143

141-
public function getLevels() {
144+
/**
145+
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
146+
*/
147+
public function getLevels(): JSONResponse {
142148
return new JSONResponse($this->config->getAppValue('logreader', 'levels', '11111'));
143149
}
144150

145-
public function getSettings() {
151+
/**
152+
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
153+
*/
154+
public function getSettings(): JSONResponse {
146155
return new JSONResponse([
147156
'levels' => $this->config->getAppValue('logreader', 'levels', '11111'),
148157
'dateformat' => $this->config->getSystemValue('logdateformat', \DateTime::ISO8601),
@@ -153,19 +162,26 @@ public function getSettings() {
153162
}
154163

155164
/**
165+
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
156166
* @param bool $relative
157167
*/
158168
public function setRelative($relative) {
159169
$this->config->setAppValue('logreader', 'relativedates', $relative);
160170
}
161171

162172
/**
173+
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
163174
* @param bool $live
164175
*/
165176
public function setLive($live) {
166177
$this->config->setAppValue('logreader', 'live', $live);
167178
}
168179

180+
/**
181+
* @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
182+
* @param string $levels
183+
* @return int
184+
*/
169185
public function setLevels($levels) {
170186
$intLevels = array_map('intval', str_split($levels));
171187
$minLevel = 4;

0 commit comments

Comments
 (0)