Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/serverinfo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Controller/PageController.php')
-rw-r--r--lib/Controller/PageController.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
new file mode 100644
index 0000000..5d9c3e8
--- /dev/null
+++ b/lib/Controller/PageController.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * @copyright Copyright (c) 2016 Bjoern Schiessle <bjoern@schiessle.org>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\ServerInfo\Controller;
+
+use OCP\IRequest;
+use OCP\AppFramework\Http\TemplateResponse;
+use OCP\AppFramework\Http\DataResponse;
+use OCP\AppFramework\Controller;
+
+class PageController extends Controller {
+
+
+ private $userId;
+
+ public function __construct($AppName, IRequest $request, $UserId){
+ parent::__construct($AppName, $request);
+ $this->userId = $UserId;
+ }
+
+ /**
+ * Show app page with the server statistics
+ * @NoCSRFRequired
+ *
+ * @return TemplateResponse
+ */
+ public function index() {
+ $params = ['users' => 100];
+ return new TemplateResponse('serverinfo', 'main', $params); // templates/main.php
+ }
+
+ /**
+ * request data update
+ *
+ * @return TemplateResponse
+ */
+ public function update() {
+ $params = ['users' => 100];
+ return new TemplateResponse('serverinfo', 'main', $params); // templates/main.php
+
+ }
+
+ /**
+ * Simply method that posts back the payload of the request
+ * @NoAdminRequired
+ */
+ public function doEcho($echo) {
+ return new DataResponse(['echo' => $echo]);
+ }
+
+
+}