Differences

This shows you the differences between the selected revision and the current version of the page.

mantisbt:issue:7075:integration_with_dokuwiki 2011/08/19 07:42 mantisbt:issue:7075:integration_with_dokuwiki 2012/12/01 07:26 current
Line 140: Line 140:
This will get you started. See the Tips section above for information about per-project group mappings. 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 268: Line 269:
    function logOff(){     function logOff(){
        auth_logout();         auth_logout();
 +    }
 +
 +    /**
 +    * Get user data
 +    * (needed for e-mail subscriptions)
 +    *
 +    * @author Martin Arends http://www.web-gestaltung.de
 +    */
 +    function getUserData($user)
 +    {
 +      $data = array();
 +     
 +      $t_user_id = user_get_id_by_name( $user );
 +
 +      if (isset($_REQUEST['media'])) {
 +          //media
 +          $t_project_name = explode( ':', getNS( getID("media",false) ) );
 +      } else {
 +          // normal page
 +          $t_project_name = explode( ':', getNS( getID() ) );
 +      }
 +
 +      $t_project_id  = project_get_id_by_name( $t_project_name[1] );
 +      $t_access_level = access_get_project_level( $t_project_id, $t_user_id );
 +      $t_access_level_string    = strtoupper( MantisEnum::getLabel( config_get( 'access_levels_enum_string' ),  $t_access_level ) );
 +      $t_access_level_string_ex = strtoupper( $t_project_name[1] ) . '_' . $t_access_level_string;
 +     
 +      $data['name'] = $user;
 +      $data['grps'] = array( $t_access_level_string, $t_access_level_string_ex );
 +      $data['mail'] = user_get_email( $t_user_id );
 +      return $data;
    }     }
} }
 
Logged in as: anonymous
mantisbt/issue/7075/integration_with_dokuwiki.txt · Last modified: 2012/12/01 07:26
 
SourceForge Logo