dimanche 24 novembre 2013

TestLink : Configuration LDAP

Lorsqu'on modifi la méthode d'authentification à "LDAP" dans le fichier de configuration personnalisé, TestLink sait que les mots de passe sont gérés par la connexion LDAP, plutôt que la base de données TestLink.

Editer le fichier de configuration "config.inc.php" et mettre à jours les paramètres de connexion LDAP comme suit :

$tlCfg->authentication['method'] = 'LDAP';
$tlCfg->authentication['ldap_server'] = 'xxx.xxx.xx.xxx';
$tlCfg->authentication['ldap_port'] = 'xxx';
$tlCfg->authentication['ldap_version'] = '3';
$tlCfg->authentication['ldap_root_dn'] = 'dc=business,dc=xxx';
$tlCfg->authentication['ldap_uid_field'] = 'sAMAccountName';
$tlCfg->authentication['ldap_bind_dn'] = 'domain.account@business.xxx';

$tlCfg->authentication['ldap_bind_passwd'] = 'password';

Activer / Désactiver la création de compte dans la page d'authentification.
Ajouter dans le fichier de configuration la ligne :

$tlCfg->user_self_signup = FALSE;



Mantis : Ajouter un statut personnalisé

Editer le fichier de configuration "config_inc.php" et ajouter les lignes :

$g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,60:to be tested,90:closed';

# Status color additions
$g_status_colors['to be tested'] = '#ACE7AE';

$g_status_enum_workflow[NEW_]=
    '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:to be tested';
$g_status_enum_workflow[FEEDBACK] =
    '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:to be tested';
$g_status_enum_workflow[ACKNOWLEDGED] =
    '20:feedback,30:acknowledged,40:confirmed,50:assigned,60:to be tested';
$g_status_enum_workflow[CONFIRMED] =
    '20:feedback,40:confirmed,50:assigned,60:to be tested';
$g_status_enum_workflow[ASSIGNED] =
    '20:feedback,50:assigned,60:to be tested,90:closed';
$g_status_enum_workflow[RESOLVED] =
    '50:assigned,80:resolved,60:to be tested,90:closed';
$g_status_enum_workflow[TEST] =
    '10:new,20:feedback,50:assigned,80:resolved,60:to be tested,90:closed';
$g_status_enum_workflow[CLOSED] =
    '50:assigned,90:closed';

Ajouter un nouveau fichier "custom_constant_inc.php" avec le contenu suivant :

<?php
define ( 'TEST', 60 );
?>

Configuration Mantis :

Dans Mantis, choisir l'élément de Menu "Administration > Gérer la configuration"
Modifier les élément de configuration de la base de données comme suit :

array (
  20 => 10,
  30 => 10,
  40 => 10,
  50 => 10,
  80 => 10,
  60 => 10,
  90 => 10,
)

array (
  10 => '20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,60:to be tested,90:closed',
  20 => '10:new,30:acknowledged,40:confirmed,50:assigned,80:resolved,60:to be tested,90:closed',
  30 => '10:new,20:feedback,40:confirmed,50:assigned,80:resolved,60:to be tested,90:closed',
  40 => '10:new,20:feedback,30:acknowledged,50:assigned,80:resolved,60:to be tested,90:closed',
  50 => '10:new,20:feedback,30:acknowledged,40:confirmed,80:resolved,60:to be tested,90:closed',
  80 => '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,90:closed',
  60 => '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,90:closed',
  90 => '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,60:to be tested',
)

Mantis : Configuration LDAP

Configuration LDAP

Editer le fichier de configuration "config_inc.php" et ajouter les paramètres de connexion LDAP
$g_login_method = LDAP;
$g_ldap_server = 'ldap://adresseIPserveur/';
$g_ldap_port = 389;
$g_ldap_root_dn = 'DC=???,DC=???';
$g_ldap_uid_field = 'sAMAccountName';
$g_ldap_realname_field = 'cn';
$g_ldap_bind_dn = 'nomUser';
$g_ldap_bind_passwd = 'password';
$g_use_ldap_email = ON;
$g_use_ldap_realname = OFF;
$g_ldap_protocol_version = 3;
$g_ldap_follow_referrals = OFF;

Configuration Authentification LDAP & MD5 à la fois

Editer le fichier "\core\authentication_api.php" et modifier la fonction "auth_does_password_match"
function auth_does_password_match( $p_user_id, $p_test_password ) {
      $t_configured_login_method = config_get( 'login_method' );

      $t_password         = user_get_field( $p_user_id, 'password' );
      $t_login_methods   = Array(MD5, CRYPT, PLAIN);
      foreach ( $t_login_methods as $t_login_method ) {

         # pass the stored password in as the salt
         if ( auth_process_plain_password( $p_test_password, $t_password, $t_login_method ) == $t_password ) {
            # Check for migration to another login method and test whether the password was encrypted
            # with our previously insecure implemention of the CRYPT method
            if ( ( $t_login_method != $t_configured_login_method ) ||
               ( ( CRYPT == $t_configured_login_method ) && substr( $t_password, 0, 2 ) == substr( $p_test_password, 0, 2 ) ) ) {
               user_set_password( $p_user_id, $p_test_password, true );
            }

            return true;
         }
      }
 
      if ( LDAP == $t_configured_login_method ) {
         return ldap_authenticate( $p_user_id, $p_test_password );
      }


      return false;
   }