Testlink的配置文件是config.inc.php,为了配置文件中的参数便于管理。我们可以新建一个custom_config.inc.php配置文件。 这个配置文件会覆盖config.inc.php中的参数。因为config.inc.php的文件最后有这么一句代码: if ( file_exists( TL_ABS_PATH . 'custom_config.inc.php' ) ) { require_once( TL_ABS_PATH . 'custom_config.inc.php' ); }
$tlCfg->authentication['method'] = 'LDAP'; $tlCfg->authentication['ldap_server'] = 'xxx.xxx.xxx.xxx'; $tlCfg->authentication['ldap_port'] = '389'; $tlCfg->authentication['ldap_version'] = '3'; // could be '2' in some cases $tlCfg->authentication['ldap_root_dn'] = 'ou=People,dc=1v,dc=cn'; $tlCfg->authentication['ldap_bind_dn'] = ''; // Left empty for anonymous LDAP binding $tlCfg->authentication['ldap_bind_passwd'] = ''; // Left empty for anonymous LDAP binding $tlCfg->authentication['ldap_tls'] = false; // true -> use tls $tlCfg->authentication['ldap_organization'] = ''; // e.g. '(organizationname=*Traffic)' $tlCfg->authentication['ldap_uid_field'] = 'uid'; // Use 'sAMAccountName' for Active Directory //一定要设置为true,否则每个ldap用户第一次登陆时需要注册 $tlCfg->authentication['ldap_automatic_user_creation'] = true; // Configure following fields in custom_config.inc.php according your configuration $tlCfg->authentication['ldap_email_field'] = 'mail'; $tlCfg->authentication['ldap_firstname_field'] = 'givenname'; $tlCfg->authentication['ldap_surname_field'] = 'sn'; /** Enable/disable Users to create accounts on login page */ $tlCfg->user_self_signup = TRUE;
$g_smtp_host = 'smtp.exmail.qq.com'; # SMTP server MUST BE configured # Configure using custom_config.inc.php $g_tl_admin_email = 'luxfang@1v.cn'; # for problem/error notification $g_from_email = 'wepu@1v.cn'; # email sender $g_return_path_email = 'wepu@1v.cn'; $g_phpMailer_method = PHPMAILER_METHOD_SMTP; /** Configure only if SMTP server requires authentication */ $g_smtp_username = 'wepu@1v.cn'; # user $g_smtp_password = 'xxxx'; # password $g_smtp_port = 25;