mantisbt:7075:integration_with_dokuwiki
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mantisbt:7075:integration_with_dokuwiki [2006/05/17 10:35] – Updated authentication plug-in. vboctor | mantisbt:7075:integration_with_dokuwiki [2020/05/14 08:33] (current) – Since 2008, this page is just a redirect stub; deleting it after setting up a proper redirection using Redirect plugin dregad | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Integrating DokuWiki with Mantis ====== | ||
- | ===== Disclaimer ===== | ||
- | |||
- | This document describes the steps needed to integrate DokuWiki with Mantis. | ||
- | |||
- | |||
- | ===== Integration Functionality ===== | ||
- | |||
- | The integration between Mantis and DokuWiki so far achieves the following: | ||
- | |||
- | * Customises DokuWiki to honour Mantis authentication (i.e. single sign-on). | ||
- | * Customises DokuWiki authorisation based on Mantis access levels (i.e. groups). | ||
- | * Adds a Wiki link on the issue view simple/ | ||
- | * Adds a Wiki menu option which maps to the corresponding project Wiki page, or general page in case of "All Projects" | ||
- | * Provides a way for Wiki pages to link to Mantis issues, e.g. ~~Mantis: | ||
- | |||
- | ===== Tips ===== | ||
- | |||
- | Following are some tips that are of interest to Mantis / DokuWiki integration: | ||
- | |||
- | * To define a template for all Wiki pages within a namespace, create '' | ||
- | |||
- | ===== DockuWiki Steps ===== | ||
- | |||
- | ==== Installation ==== | ||
- | |||
- | Install [[http:// | ||
- | |||
- | ==== Configuration ==== | ||
- | |||
- | Modify the configuration values in '' | ||
- | |||
- | <code php> | ||
- | define( ' | ||
- | $conf[' | ||
- | $conf[' | ||
- | $conf[' | ||
- | </ | ||
- | |||
- | ==== Authentication (Single Sign-On) ==== | ||
- | |||
- | Create '' | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | /** | ||
- | * Mantis auth backend | ||
- | * | ||
- | * Uses external Trust mechanism to check against Mantis' | ||
- | * user cookie. | ||
- | * | ||
- | * @author | ||
- | */ | ||
- | |||
- | require_once( MANTIS_ROOT . ' | ||
- | |||
- | # | ||
- | |||
- | class auth_mantis extends auth_basic { | ||
- | /** | ||
- | * Constructor. | ||
- | * | ||
- | * Sets additional capabilities and config strings | ||
- | */ | ||
- | function auth_mantis(){ | ||
- | $this-> | ||
- | } | ||
- | |||
- | /** | ||
- | * Authenticates the user using Mantis APIs. | ||
- | */ | ||
- | function trustExternal($user, | ||
- | global $USERINFO; | ||
- | global $conf; | ||
- | |||
- | if ( auth_is_user_authenticated() ) { | ||
- | // okay we're logged in - set the globals | ||
- | $USERINFO[' | ||
- | $USERINFO[' | ||
- | $USERINFO[' | ||
- | |||
- | $t_project_name = getNS( getID() ); | ||
- | $t_project_id = project_get_id_by_name( $t_project_name ); | ||
- | $t_access_level = access_get_project_level( $t_project_id ); | ||
- | $t_access_level_string = strtoupper( get_enum_to_string( config_get( ' | ||
- | |||
- | $USERINFO[' | ||
- | |||
- | $_SERVER[' | ||
- | $_SESSION[$conf[' | ||
- | $_SESSION[$conf[' | ||
- | |||
- | return true; | ||
- | } | ||
- | |||
- | // to be sure | ||
- | auth_logoff(); | ||
- | |||
- | return false; | ||
- | } | ||
- | |||
- | /** | ||
- | * Logout from Mantis | ||
- | */ | ||
- | function logOff(){ | ||
- | auth_logout(); | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | ==== Authorisation Configuration ==== | ||
- | |||
- | Create '' | ||
- | |||
- | <code php> | ||
- | # acl.auth.php | ||
- | # <?php exit()?> | ||
- | # Don't modify the lines above | ||
- | # | ||
- | # Access Control Lists | ||
- | # | ||
- | # Editing this file by hand shouldn' | ||
- | # Manager interface instead. | ||
- | # | ||
- | # If your auth backend allows special char like spaces in groups | ||
- | # or user names you need to urlencode them (only chars <128, leave | ||
- | # UTF-8 multibyte chars as is) | ||
- | # | ||
- | # none 0 | ||
- | # read 1 | ||
- | # edit 2 | ||
- | # create 4 | ||
- | # upload 8 | ||
- | |||
- | * @VIEWER 1 | ||
- | * @REPORTER 2 | ||
- | * @DEVELOPER 8 | ||
- | * @MANAGER 8 | ||
- | * @ADMINISTRATOR 8 | ||
- | * @ALL 0 | ||
- | </ | ||
- | |||
- | ==== Mantis Syntax Plug-in ==== | ||
- | |||
- | This plugin is to be placed in '' | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | /** | ||
- | * Mantis Plugin: Displays Mantis related information. | ||
- | | ||
- | * @license | ||
- | * @author | ||
- | */ | ||
- | |||
- | |||
- | if(!defined(' | ||
- | if(!defined(' | ||
- | require_once(DOKU_PLUGIN.' | ||
- | |||
- | /** | ||
- | * All DokuWiki plugins to extend the parser/ | ||
- | * need to inherit from this class | ||
- | */ | ||
- | class syntax_plugin_mantis extends DokuWiki_Syntax_Plugin { | ||
- | |||
- | /** | ||
- | * return some info | ||
- | */ | ||
- | function getInfo(){ | ||
- | return array( | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ); | ||
- | } | ||
- | |||
- | /** | ||
- | * What kind of syntax are we? | ||
- | */ | ||
- | function getType(){ | ||
- | return ' | ||
- | } | ||
- | |||
- | /** | ||
- | * What about paragraphs? | ||
- | */ | ||
- | function getPType(){ | ||
- | return ' | ||
- | } | ||
- | |||
- | /** | ||
- | * Where to sort in? | ||
- | | ||
- | function getSort(){ | ||
- | return 156; | ||
- | } | ||
- | |||
- | |||
- | /** | ||
- | * Connect pattern to lexer | ||
- | */ | ||
- | function connectTo($mode) { | ||
- | $this-> | ||
- | } | ||
- | |||
- | |||
- | /** | ||
- | * Handle the match | ||
- | */ | ||
- | function handle($match, | ||
- | $match = substr($match, | ||
- | return array(strtolower($match)); | ||
- | } | ||
- | |||
- | /** | ||
- | * Create output | ||
- | */ | ||
- | function render($format, | ||
- | if($format == ' | ||
- | $renderer-> | ||
- | return true; | ||
- | } | ||
- | return false; | ||
- | } | ||
- | } | ||
- | ?> | ||
- | </ | ||
- | |||
- | ===== Mantis Steps ===== | ||
- | |||
- | ==== Configuration ==== | ||
- | |||
- | ==== wiki_api.php ==== | ||
- | |||
- | ==== wiki_dokuwiki_api.php ==== | ||
- | |||
- | ==== html_api.php ==== |
mantisbt/7075/integration_with_dokuwiki.1147876503.txt.gz · Last modified: 2008/10/29 04:36 (external edit)