1<?php
2
3require_once dirname(__FILE__).'/accesscheck.php';
4
5//## add "Ajaxable actions" that just return the result, but show in the full page when not ajaxed
6
7$ajax = isset($_GET['ajaxed']);
8
9if ($ajax) {
10    @ob_end_clean();
11    @ob_start();
12    if (is_file(dirname(__FILE__).'/ui/'.$GLOBALS['ui'].'/pagetop_minimal.php')) {
13        include_once dirname(__FILE__).'/ui/'.$GLOBALS['ui'].'/pagetop_minimal.php';
14    }
15}
16$status = s('Failed');
17if (!empty($_GET['action'])) {
18    $action = basename($_GET['action']);
19    if (is_file(dirname(__FILE__).'/actions/'.$action.'.php')) {
20        include dirname(__FILE__).'/actions/'.$action.'.php';
21    } elseif (!empty($_GET['origpage'])) {
22        $action = basename($_GET['origpage']);
23        if (is_file(dirname(__FILE__).'/actions/'.$action.'.php')) {
24            include dirname(__FILE__).'/actions/'.$action.'.php';
25        }
26    }
27} else {
28    Redirect('home');
29}
30
31echo $status;
32if (0 && !empty($GLOBALS['developer_email'])) {
33    echo '<br/><a href="'.$_SERVER['REQUEST_URI'].'" target="_blank">'.$_SERVER['REQUEST_URI'].'</a>';
34}
35
36if ($ajax) {
37    echo '</body></html>';
38    exit;
39}
40