mantisbt:issue:7075:integration_with_dokuwiki
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
mantisbt:issue:7075:integration_with_dokuwiki [2011/08/15 11:07] – toddpw | mantisbt:issue:7075:integration_with_dokuwiki [2013/09/18 00:27] – thu.doan | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Integrating DokuWiki with Mantis ====== | ====== Integrating DokuWiki with Mantis ====== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===== Disclaimer ===== | ===== Disclaimer ===== | ||
Line 7: | Line 15: | ||
and should work with subsequent versions (modulo bugs). | and should work with subsequent versions (modulo bugs). | ||
It may work with older versions of mantis provided you make the File Changes described below. | It may work with older versions of mantis provided you make the File Changes described below. | ||
+ | ---- | ||
+ | |||
+ | |||
+ | |||
+ | |||
===== Integration Functionality ===== | ===== Integration Functionality ===== | ||
Line 18: | Line 31: | ||
* Provides a way for Wiki pages to link to Mantis issues, e.g. ~~Mantis: | * Provides a way for Wiki pages to link to Mantis issues, e.g. ~~Mantis: | ||
* Correctly manages HTTP Authentication. See (http:// | * Correctly manages HTTP Authentication. See (http:// | ||
+ | |||
+ | |||
+ | |||
===== Tips ===== | ===== Tips ===== | ||
Line 23: | Line 39: | ||
Following are some tips that are of interest to Mantis / DokuWiki integration: | Following are some tips that are of interest to Mantis / DokuWiki integration: | ||
- | * To define a template for all Wiki pages within a namespace, create '' | + | * To define a template for all Wiki pages within a namespace, create '' |
+ | |||
+ | * The Wiki menu links in Mantis are equivalent to internal links for '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | * The View Issue Details Wiki links in Mantis are equivalent to internal links for '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | * How Wiki access levels are determined: The Mantis auth backend included below takes the namespace containing the object being accessed, extracts the 2nd component, and looks it up in a flat list of Mantis projects. If there is a match, that project' | ||
+ | |||
+ | * Another consequence of the simplistic code here is that it fails to adjust when '' | ||
+ | |||
+ | * Rename (if necessary) your projects and subprojects so that all their names are legal [[doku> | ||
+ | |||
+ | * DokuWiki will see groups for each combination of Mantis project and access level that exist for the current user. For example: | ||
+ | |||
+ | < | ||
+ | my_namespace: | ||
+ | my_namespace: | ||
+ | my_namespace: | ||
+ | </ | ||
===== Mantis Configuration ===== | ===== Mantis Configuration ===== | ||
Line 64: | Line 103: | ||
Install [[http:// | Install [[http:// | ||
- | ==== Configuration ==== | + | ==== Core Configuration ==== |
Add/modify the configuration values show below in your DokuWiki installation. | Add/modify the configuration values show below in your DokuWiki installation. | ||
Line 82: | Line 121: | ||
# | # | ||
- | # Modify | + | # Once you have inc\auth\mantis.class.php created, modify |
- | # With modern versions of dokuwiki, the bundled config plugin can set | + | # With modern versions of dokuwiki, the bundled config plugin can set these values, otherwise uncomment them here. |
- | # these once you have inc\auth\mantis.class.php created. | + | |
# | # | ||
Line 91: | Line 129: | ||
# $conf[' | # $conf[' | ||
# $conf[' | # $conf[' | ||
+ | |||
+ | # | ||
+ | # If selecting the mantis auth backend results in fatal errors from redeclaration of utf8 functions, uncomment this: | ||
+ | # | ||
+ | # require_once( MANTIS_ROOT . ' | ||
</ | </ | ||
- | If dokuwiki fails with the folowing | + | (utf8 redeclaration |
- | < | + | |
- | (http://www.mantisbt.org/ | + | |
+ | ==== Authorisation Configuration ==== | ||
+ | |||
+ | Add the following | ||
+ | |||
+ | < | ||
+ | * @VIEWER 1 | ||
+ | * @REPORTER 2 | ||
+ | * @UPDATER 4 | ||
+ | * @DEVELOPER 8 | ||
+ | * @MANAGER 16 | ||
+ | * @ADMINISTRATOR 16 | ||
+ | </ | ||
+ | |||
+ | This will get you started. See the Tips section above for information about per-project group mappings. | ||
==== Mantis Authentication Backend (Single Sign-On) ==== | ==== Mantis Authentication Backend (Single Sign-On) ==== | ||
Line 166: | Line 224: | ||
if ( !$silent ) | if ( !$silent ) | ||
{ | { | ||
- | | + | |
} | } | ||
| | ||
Line 224: | Line 282: | ||
function logOff(){ | function logOff(){ | ||
auth_logout(); | auth_logout(); | ||
+ | } | ||
+ | |||
+ | /** | ||
+ | * Get user data | ||
+ | * (needed for e-mail subscriptions) | ||
+ | * | ||
+ | * @author Martin Arends http:// | ||
+ | */ | ||
+ | function getUserData($user) | ||
+ | { | ||
+ | $data = array(); | ||
+ | | ||
+ | $t_user_id = user_get_id_by_name( $user ); | ||
+ | |||
+ | if (isset($_REQUEST[' | ||
+ | //media | ||
+ | $t_project_name = explode( ':', | ||
+ | } else { | ||
+ | // normal page | ||
+ | $t_project_name = explode( ':', | ||
+ | } | ||
+ | |||
+ | $t_project_id | ||
+ | $t_access_level = access_get_project_level( $t_project_id, | ||
+ | $t_access_level_string | ||
+ | $t_access_level_string_ex = strtoupper( $t_project_name[1] ) . ' | ||
+ | | ||
+ | $data[' | ||
+ | $data[' | ||
+ | $data[' | ||
+ | return $data; | ||
} | } | ||
} | } | ||
- | ?> | ||
</ | </ | ||
This codes already contains the following mods: | This codes already contains the following mods: | ||
Line 232: | Line 320: | ||
* Support logging in/out from DokuWiki' | * Support logging in/out from DokuWiki' | ||
If you want the original code, you can see the wiki history | If you want the original code, you can see the wiki history | ||
- | |||
- | |||
- | ==== Authorisation Configuration ==== | ||
- | |||
- | You can set per project(namespace) user right as follows: | ||
- | for each project the user has access on mantis it will be created a group: PROJECT_USERRIGHT | ||
- | i.e | ||
- | my_namespace: | ||
- | my_namespace: | ||
- | my_namespace: | ||
- | |||
- | and you can still use the defaults. Follows a basic one acl.auth.php | ||
- | |||
- | <code php conf\acl.auth.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 | ||
- | # delete 16 | ||
- | |||
- | * @VIEWER 1 | ||
- | * @REPORTER 2 | ||
- | * @DEVELOPER 8 | ||
- | * @MANAGER 8 | ||
- | * @ADMINISTRATOR 8 | ||
- | * @ALL 0 | ||
- | </ | ||
==== Mantis Syntax Plug-in ==== | ==== Mantis Syntax Plug-in ==== | ||
Line 365: | Line 412: | ||
} | } | ||
} | } | ||
- | ?> | ||
</ | </ | ||
mantisbt/issue/7075/integration_with_dokuwiki.txt · Last modified: 2015/02/13 18:11 by dregad