整合Mantis系統之技術文件

出自 NCUCCWiki
於 2008年3月19日 (三) 08:58 由 955002074 (對話 | 貢獻) 所做的修訂 (連結 wiki 時開新視窗)
前往: 導覽搜尋

Mantis 開放 LDAP、local 登入

在 config_inc.php 中加入以下數行:

   $g_login_method                 = LDAP;
   $g_ldap_server                  = 'tiger.cc.ncu.edu.tw';
   $g_ldap_port                    = '389';
   $g_ldap_root_dn                 = 'dc=cc,dc=ncu';
   $g_ldap_organization            = ;    
   $g_ldap_uid_field               = 'uid';
   $g_ldap_bind_dn                 = 'dc=cc,dc=ncu';
   $g_ldap_bind_passwd             = ;
   $g_use_ldap_email               = OFF;

在 core/authentication_api.php 中

 修改 function auth_does_password_match()
   將  $t_password = user_get_field( $p_user_id, 'password' ); 移到 if ( LDAP == $t_configured_login_method ) 這行前
   並將
     if ( LDAP == $t_configured_login_method ) {
         return ldap_authenticate( $p_user_id, $p_test_password );
     }
   修改成
     if ( LDAP == $t_configured_login_method ) {
         if($t_password == NULL)
             return ldap_authenticate( $p_user_id, $p_test_password );
     }
   下一行 array 中加上 LDAP
   $t_login_methods        = Array(MD5, CRYPT, PLAIN);
   變成 $t_login_methods        = Array(MD5, CRYPT, PLAIN, LDAP);
 修改 function auth_process_plain_password
   case MD5:
       $t_processed_password = md5( $p_password );
   加上 case LDAP:
     case MD5: case LDAP:
       $t_processed_password = md5( $p_password );

在 core/user_api.php 中 修改 function user_create()

 修改 $c_password = db_prepare_string( $t_password );
 為 $c_password = NULL; 

在 account_page.php 中

 修改 <?php if ( !helper_call_custom_function( 'auth_can_change_password', array() ) ) { ?> 
 為  <?php if(user_get_field($u_id,'password') == NULL){?> 

與 wiki 的連結

在 config_inc.php 中加入以下數行

   # Wiki Integration Enabled?
  $g_wiki_enable = ON;
  # Wiki Engine
  $g_wiki_engine = 'mediawiki';
  # Wiki namespace to be used as root for all pages relating to this mantis installation.
  $g_wiki_root_namespace = 'mantis';
  # URL under which the wiki engine is hosted. Must be on the same server.
  $g_wiki_engine_url = $t_protocol . '://'.$t_host.'/%wiki_engine%/';

連結 wiki 時開新視窗

在 bug_view_page.php 及 bug_view_advanced_page.php 中

 找到 print_bracket_link( 'wiki.php?id='.$f_bug_id, lang_get( 'wiki' ))
 加上第三個參數 true 變成 print_bracket_link( 'wiki.php?id='.$f_bug_id, lang_get( 'wiki' ), true )

在 core/html_api.php 中 找到

 $t_menu_options[] = '<a href="wiki.php?type=project&id=' . $t_current_project . '">' . lang_get( 'wiki' ) . '</a>';
 加上 target="_blank"
 變成 $t_menu_options[] = '<a href="wiki.php?type=project&id=' . $t_current_project . '" target="_blank">' . lang_     get( 'wiki' ) . '</a>';

與現行 HelpDesk 的資料庫整合

將 mantis 更換為較新版本 將舊版 mantis database 匯入後
登入頁面會出現 WARNING: The database structure may be out of date. Please upgrade here before logging in.
點選 here 更新資料庫即可