xref: /dokuwiki/doku.php (revision b625487d2258a6f1f875813206adc9a5857dab24)
1<?php
2/**
3 * DokuWiki mainscript
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Andreas Gohr <andi@splitbrain.org>
7 */
8
9  //xdebug_start_profiling();
10
11  if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__)).'/');
12  require_once(DOKU_INC.'inc/init.php');
13  require_once(DOKU_INC.'inc/common.php');
14  require_once(DOKU_INC.'inc/pageutils.php');
15  require_once(DOKU_INC.'inc/html.php');
16  require_once(DOKU_INC.'inc/parser.php');
17  require_once(DOKU_INC.'lang/en/lang.php');
18  require_once(DOKU_INC.'lang/'.$conf['lang'].'/lang.php');
19  require_once(DOKU_INC.'inc/auth.php');
20  require_once(DOKU_INC.'inc/actions.php');
21
22  //import variables
23  $QUERY = trim($_REQUEST['id']);
24  $ID    = cleanID($_REQUEST['id']);
25  $REV   = $_REQUEST['rev'];
26  $ACT   = $_REQUEST['do'];
27  $IDX   = $_REQUEST['idx'];
28  $DATE  = $_REQUEST['date'];
29  $RANGE = $_REQUEST['lines'];
30  $HIGH  = $_REQUEST['s'];
31  if(empty($HIGH)) $HIGH = getGoogleQuery();
32
33#  $ACL_USER     = urldecode($_REQUEST['acl_user']);
34#  $ACL_SCOPE    = urldecode($_REQUEST['acl_scope']);
35#  $ACL_LEVEL    = $_REQUEST['acl_level'];
36#  $ACL_CHECKBOX = $_REQUEST['acl_checkbox'];
37
38  $TEXT  = cleanText($_POST['wikitext']);
39  $PRE   = cleanText($_POST['prefix']);
40  $SUF   = cleanText($_POST['suffix']);
41  $SUM   = $_REQUEST['summary'];
42
43  //sanitize revision
44  $REV = preg_replace('/[^0-9]/','',$REV);
45
46  //we accept the do param as HTTP header, too:
47  if(!empty($_SERVER['HTTP_X_DOKUWIKI_DO'])){
48    $ACT = trim(strtolower($_SERVER['HTTP_X_DOKUWIKI_DO']));
49  }
50
51  if(!empty($IDX)) $ACT='index';
52  //set defaults
53  if(empty($ID))  $ID  = $conf['start'];
54  if(empty($ACT)) $ACT = 'show';
55
56
57  if($ACT == 'debug'){
58    html_debug();
59    exit;
60  }
61
62  //make infos about the selected page available
63  $INFO = pageinfo();
64
65  act_dispatch($ACT);
66
67  //restore old umask
68  umask($conf['oldumask']);
69
70  //xdebug_dump_function_profile(3);
71?>
72