mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-21 15:55:40 +00:00
[FIXED HUDSON-2959] Fix broken images by adding rootUrl in image links returned by
checkName; avoid NullPointerException in LDAP groupname lookup when groupSearchBase is not set. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15006 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
1396fd5541
commit
f6e780339f
2 files changed
+5
-4
No files matched your search
@@ -270,7 +270,7 @@ public class GlobalMatrixAuthorizationStrategy extends AuthorizationStrategy {
|
||||
}
|
||||
|
||||
private String makeImg(String gif) {
|
||||
return String.format("<img src='%s/images/16x16/%s' style='margin-right:0.2em'>", Hudson.RESOURCE_PATH, gif);
|
||||
return String.format("<img src='%s%s/images/16x16/%s' style='margin-right:0.2em'>", Hudson.getInstance().getRootUrlFromRequest(), Hudson.RESOURCE_PATH, gif);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,8 +250,8 @@ public class LDAPSecurityRealm extends SecurityRealm {
|
||||
if(Util.fixEmptyAndTrim(rootDN)==null) rootDN=Util.fixNull(inferRootDN(server));
|
||||
this.rootDN = rootDN.trim();
|
||||
this.userSearchBase = userSearchBase.trim();
|
||||
if(Util.fixEmptyAndTrim(userSearch)==null) userSearch="uid={0}";
|
||||
this.userSearch = userSearch.trim();
|
||||
userSearch = Util.fixEmptyAndTrim(userSearch);
|
||||
this.userSearch = userSearch!=null ? userSearch : "uid={0}";
|
||||
this.groupSearchBase = Util.fixEmptyAndTrim(groupSearchBase);
|
||||
this.managerDN = Util.fixEmpty(managerDN);
|
||||
this.managerPassword = Scrambler.scramble(Util.fixEmpty(managerPassword));
|
||||
@@ -327,7 +327,8 @@ public class LDAPSecurityRealm extends SecurityRealm {
|
||||
@Override
|
||||
public GroupDetails loadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException {
|
||||
// TODO: obtain a DN instead so that we can obtain multiple attributes later
|
||||
final Set<String> groups = (Set<String>)ldapTemplate.searchForSingleAttributeValues(groupSearchBase, GROUP_SEARCH,
|
||||
String searchBase = groupSearchBase != null ? groupSearchBase : "";
|
||||
final Set<String> groups = (Set<String>)ldapTemplate.searchForSingleAttributeValues(searchBase, GROUP_SEARCH,
|
||||
new String[]{groupname}, "cn");
|
||||
|
||||
if(groups.isEmpty())
|
||||
|
||||
Reference in new issue
Block a user