1<?php 2/** 3 */ 4 5if(!defined('DOKU_INC')) die(); 6if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 7require_once(DOKU_PLUGIN.'action.php'); 8 9class action_plugin_cryptsign extends DokuWiki_Action_Plugin { 10 11 /** 12 * Register its handlers with the DokuWiki's event controller 13 */ 14 function register(Doku_Event_Handler $controller) { 15 $controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, '_adduser'); 16 } 17 18 /** 19 * export username to JS 20 */ 21 function _adduser(&$event, $param) { 22 if (!isset($_SERVER['REMOTE_USER'])) { 23 return; 24 } 25 global $JSINFO; 26 $JSINFO['user'] = $_SERVER['REMOTE_USER']; 27 } 28} 29