forked from rotdrop/nextcloud-app-dokuwiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
64 lines (49 loc) · 1.75 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**Embed a DokuWiki instance as app into ownCloud, intentionally with
* single-sign-on.
*
* @author Claus-Justus Heine
* @copyright 2013 Claus-Justus Heine <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
use DWEMBED\App;
use DWEMBED\Util;
$appName = App::APPNAME;
// Check if we are a user
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled($appName);
// Check if we are a user
if (!OCP\User::isLoggedIn()) {
header("Location: " . OCP\Util::linkTo('', 'index.php' ));
exit();
}
// Load our style
OCP\Util::addStyle($appName, $appName);
// add needed JS
OCP\Util::addScript($appName, $appName);
// add new navigation entry
OCP\App::setActiveNavigationEntry($appName);
$wikiLocation = OCP\Config::GetAppValue($appName, 'wikilocation', '');
$tmpl = new OCP\Template($appName, "wiki", "user");
$dokuWikiEmbed = new App($wikiLocation);
$wikiURL = $dokuWikiEmbed->wikiURL();
$wikiPath = Util::cgiValue('wikiPath', '');
$dokuWikiEmbed->emitAuthHeaders();
$tmpl->assign('app', $appName);
$tmpl->assign('wikilocation', $wikiLocation);
$tmpl->assign('wikiURL', $wikiURL);
$tmpl->assign('wikiPath', $wikiPath);
$tmpl->printpage();
?>