-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
76 lines (71 loc) · 1.99 KB
/
index.php
File metadata and controls
76 lines (71 loc) · 1.99 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* EGroupware Wiki - UserInterface
*
* @link http://www.egroupware.org
* @package wiki
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @copyright (C) 2004-17 by RalfBecker-AT-outdoor-training.de
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
use EGroupware\Api;
/* $Id$ */
if (isset($_GET['action'])) // calling the old code
{
include('lib/main.php');
exit;
}
else
{
/**
* Check if we allow anon access and with which creditials
*
* @param array &$anon_account anon account_info with keys 'login', 'passwd' and optional 'passwd_type'
* @return boolean true if we allow anon access, false otherwise
*/
function wiki_check_anon_access(&$anon_account)
{
$config = Api\Config::read('wiki');
if ($config['allow_anonymous'] && $config['anonymous_username'])
{
$anon_account = array(
'login' => $config['anonymous_username'],
'passwd' => $config['anonymous_password'],
'passwd_type' => 'text',
);
return true;
}
return false;
}
}
// uncomment the next line if wiki should use a eGW domain different from the first one defined in your header.inc.php
// and of cause change the name accordingly ;-)
// $GLOBALS['egw_info']['user']['domain'] = $GLOBALS['egw_info']['server']['default_domain'] = 'developers';
$GLOBALS['egw_info']['flags'] = array(
'disable_Template_class' => True,
'noheader' => True,
'currentapp' => 'wiki',
'autocreate_session_callback' => 'wiki_check_anon_access',
);
include('../header.inc.php');
$goto = 'wiki.wiki_ui.view';
if (!empty($_REQUEST['menuaction']))
{
$buff = explode('.',$_REQUEST['menuaction']);
if ($buff[0]=='wiki' && method_exists($buff[1],$buff[2]))// if wiki and method exists, allow to go there
{
$goto = implode('.',$buff);
}
}
ExecMethod($goto);
// Expire old versions, etc.
if (!is_object($GLOBALS['wiki_ui']))
{
ExecMethod('wiki.wiki_ui.maintain');
}
else
{
$GLOBALS['wiki_ui']->maintain();
}
echo $GLOBALS['egw']->framework->footer();