View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0011488 | mantisbt | feature | public | 2010-02-10 08:49 | 2014-01-03 05:56 |
| Reporter | rrp | Assigned To | dregad | ||
| Priority | normal | Severity | tweak | Reproducibility | N/A |
| Status | closed | Resolution | duplicate | ||
| Summary | 0011488: LDAP group based autentication | ||||
| Description | In many applications use LDAP group based autentication. Mantis LDAP autentication system allow to limit acess to only one branch in LDAP tree but does not allow limit mantis access to only one LDAP group. Patch attached ... | ||||
| Additional Information | This is similar to http://www.mantisbt.org/bugs/view.php?id=11470 but based on members in group instead of user attribute | ||||
| Tags | No tags attached. | ||||
| Attached Files | mantis-ldap-group.diff (1,948 bytes)
Wspólne podkatalogi: core-org2/disposable i core/disposable
diff -C3 core-org2/ldap_api.php core/ldap_api.php
*** core-org2/ldap_api.php 2010-02-10 13:05:00.000000000 +0000
--- core/ldap_api.php 2010-02-10 13:18:51.000000000 +0000
***************
*** 138,143 ****
--- 138,149 ----
$t_ldap_uid_field = config_get( 'ldap_uid_field', 'uid' ) ;
$t_search_filter = "(&$t_ldap_organization($t_ldap_uid_field=$t_username))";
$t_search_attrs = array( $t_ldap_uid_field, 'dn' );
+
+ $t_ldap_group_dn = config_get( 'ldap_group_dn', '');
+ $t_ldap_group_member_field = config_get( 'ldap_group_member_field', 'memberuid' ) ;
+ $t_search_attrs_group = array( $t_ldap_group_member_field, 'dn' );
+ $t_search_filter_group = "(&($t_ldap_group_member_field=$t_username))";
+
$t_ds = ldap_connect_bind();
# Search for the user id
***************
*** 153,160 ****
# Attempt to bind with the DN and password
if ( @ldap_bind( $t_ds, $t_dn, $p_password ) ) {
! $t_authenticated = true;
! break; # Don't need to go any further
}
}
}
--- 159,179 ----
# Attempt to bind with the DN and password
if ( @ldap_bind( $t_ds, $t_dn, $p_password ) ) {
! if ($t_ldap_group_dn != '') {
! # check for group mantis for this user
! $t_sr2 = ldap_read( $t_ds, $t_ldap_group_dn, $t_search_filter_group, $t_search_attrs_group);
! $t_info2 = ldap_get_entries( $t_ds, $t_sr2 );
! if ($t_info2[0]['memberuid']) {
! # We don't need check recived memberuid listi ($t_info2[0]['memberuid'])
! # becouse filter in ldap_read() guarantees (if $t_info2[0]['memberuid'] is not empty)
! # occurrence $t_username in this list
! $t_authenticated = true;
! break; # Don't need to go any further
! }
! } else {
! $t_authenticated = true;
! break; # Don't need to go any further
! }
}
}
}
mantis.ldap_group.for_1.2.5.diff (1,673 bytes)
*** core/ldap_api.php.orig 2011-04-05 18:24:17.000000000 +0000
--- core/ldap_api.php 2011-07-22 11:29:15.000000000 +0000
***************
*** 360,365 ****
--- 360,370 ----
'dn',
);
+ $t_ldap_group_dn = config_get( 'ldap_group_dn', '');
+ $t_ldap_group_member_field = config_get( 'ldap_group_member_field', 'memberuid' ) ;
+ $t_search_attrs_group = array( $t_ldap_group_member_field, 'dn' );
+ $t_search_filter_group = "(&($t_ldap_group_member_field=$c_username))";
+
# Bind
log_event( LOG_LDAP, "Binding to LDAP server" );
$t_ds = ldap_connect_bind();
***************
*** 396,403 ****
# Attempt to bind with the DN and password
if ( @ldap_bind( $t_ds, $t_dn, $p_password ) ) {
! $t_authenticated = true;
! break;
}
}
} else {
--- 401,421 ----
# Attempt to bind with the DN and password
if ( @ldap_bind( $t_ds, $t_dn, $p_password ) ) {
! if ($t_ldap_group_dn != '') {
! # check for group mantis for this user
! $t_sr2 = ldap_read( $t_ds, $t_ldap_group_dn, $t_search_filter_group, $t_search_attrs_group);
! $t_info2 = ldap_get_entries( $t_ds, $t_sr2 );
! if ($t_info2[0]['memberuid']) {
! # We don't need check recived memberuid listi ($t_info2[0]['memberuid'])
! # becouse filter in ldap_read() guarantees (if $t_info2[0]['memberuid'] is not empty)
! # occurrence $t_username in this list
! $t_authenticated = true;
! break; # Don't need to go any further
! }
! } else {
! $t_authenticated = true;
! break; # Don't need to go any further
! }
}
}
} else {
| ||||
|
I have this conf works every users from ou fine but I want set up goup cn=mantis $g_allow_signup = OFF; |
|