*/ // must be run within DokuWiki if(!defined('DOKU_INC')) die(); require_once("common.php"); class action_plugin_hackerbase extends DokuWiki_Action_Plugin { /** @inheritDoc */ public function register(Doku_Event_Handler $controller) { $controller->register_hook('ACTION_ACT_PREPROCESS', 'BEFORE', $this, 'handleActionActPreprocess'); } /** * Event handler for ACTION_ACT_PREPROCESS * * @see https://www.dokuwiki.org/devel:events:ACTION_ACT_PREPROCESS * @param Doku_Event $event Event object * @param mixed $param optional parameter passed when event was registered * @return void */ public function handleActionActPreprocess(Doku_Event $event, $param) { $act = act_clean($event->data); if ($act === 'payments') { global $INPUT; $user = $INPUT->server->str('REMOTE_USER'); echo file_get_contents($this->getConf("htmlexports") . '/' . $user . ".html"); die(); } else if ($act === 'brmstatus') { $spaceapi_status_json = $this->getConf("spaceapijson"); $status = hackerbase_spaceapi_html_snippet($spaceapi_status_json); // The following was taken from original /var/www/status-renderer/status.php verbatim for now: echo ''; echo ''; echo ''; echo 'Brmlab space status page'; echo ''; echo ''; echo ''; echo $status; echo ''; echo ''; die(); } } }