Skip to content

Commit 3e2730b

Browse files
committed
Added enabled to critera when returning systems
Added enabled to critera when returning systems by profile
1 parent 825d186 commit 3e2730b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/com/keybox/manage/db/ProfileDB.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static SortedSet getProfileSet(SortedSet sortedSet) {
5858
}
5959
String sql = "select distinct p.* from profiles p ";
6060
if (StringUtils.isNotEmpty(sortedSet.getFilterMap().get(FILTER_BY_SYSTEM))) {
61-
sql = sql + ", system_map m, system s where m.profile_id = p.id and m.system_id = s.id" +
61+
sql = sql + ", system_map m, system s where s.enabled=true and m.profile_id = p.id and m.system_id = s.id" +
6262
" and (lower(s.display_nm) like ? or lower(s.host) like ?)";
6363
} else if (StringUtils.isNotEmpty(sortedSet.getFilterMap().get(FILTER_BY_USER))) {
6464
sql = sql + ", user_map m, users u where m.profile_id = p.id and m.user_id = u.id" +

src/main/java/com/keybox/manage/db/ProfileSystemsDB.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static List<HostSystem> getSystemsByProfile(Connection con, Long profileI
8686

8787

8888
try {
89-
PreparedStatement stmt = con.prepareStatement("select * from system s, system_map m where s.id=m.system_id and m.profile_id=? order by display_nm asc");
89+
PreparedStatement stmt = con.prepareStatement("select * from system s, system_map m where s.enabled=true and s.id=m.system_id and m.profile_id=? order by display_nm asc");
9090
stmt.setLong(1, profileId);
9191
ResultSet rs = stmt.executeQuery();
9292

@@ -149,7 +149,7 @@ public static List<Long> getSystemIdsByProfile(Connection con, Long profileId) {
149149

150150

151151
try {
152-
PreparedStatement stmt = con.prepareStatement("select * from system s, system_map m where s.id=m.system_id and m.profile_id=? order by display_nm asc");
152+
PreparedStatement stmt = con.prepareStatement("select * from system s, system_map m where s.enabled=true and s.id=m.system_id and m.profile_id=? order by display_nm asc");
153153
stmt.setLong(1, profileId);
154154
ResultSet rs = stmt.executeQuery();
155155

0 commit comments

Comments
 (0)