From 48f040f9aac805fb80df4d4bde649c5e36353261 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 21 Aug 2014 08:32:36 +0200 Subject: index page showing server setting --- controller/guicontroller.php | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 controller/guicontroller.php (limited to 'controller') diff --git a/controller/guicontroller.php b/controller/guicontroller.php new file mode 100644 index 0000000..f3fce6b --- /dev/null +++ b/controller/guicontroller.php @@ -0,0 +1,70 @@ + + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @link http://cweiske.de/grauphel.htm + */ +namespace OCA\Grauphel\Controller; + +use \OCP\AppFramework\Controller; +use \OCP\AppFramework\Http\TemplateResponse; + +/** + * Owncloud frontend + * + * @category Tools + * @package Grauphel + * @author Christian Weiske + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @version Release: @package_version@ + * @link http://cweiske.de/grauphel.htm + */ +class GuiController extends Controller +{ + /** + * constructor of the controller + * + * @param string $appName Name of the app + * @param IRequest $request Instance of the request + */ + public function __construct($appName, \OCP\IRequest $request, $user, $urlGen) + { + parent::__construct($appName, $request); + $this->user = $user; + $this->urlGen = $urlGen; + + //default http header: we assume something is broken + header('HTTP/1.0 500 Internal Server Error'); + } + + /** + * Main page / + * + * @NoAdminRequired + * @NoCSRFRequired + */ + public function index() + { + $res = new TemplateResponse('grauphel', 'index'); + $res->setParams( + array( + 'apiurl' => $this->urlGen->getAbsoluteURL( + $this->urlGen->linkToRoute( + 'grauphel.gui.index' + ) + ), + ) + ); + return $res; + + } +} +?> -- cgit v1.2.3