MCPcopy Index your code
hub / github.com/OWASP/SecurityShepherd / isModuleOpen

Method isModuleOpen

src/main/java/dbProcs/Getter.java:1905–1931  ·  view source on GitHub ↗
(String ApplicationRoot, String moduleId)

Source from the content-addressed store, hash-verified

1903 }
1904
1905 public static boolean isModuleOpen (String ApplicationRoot, String moduleId)
1906 {
1907 log.debug("*** Getter.isModuleOpen ***");
1908 boolean result = false;
1909 Connection conn = Database.getCoreConnection(ApplicationRoot);
1910 try
1911 {
1912 //Get the modules
1913 PreparedStatement prepStmt = conn.prepareCall("SELECT moduleStatus FROM modules WHERE moduleId = ?");
1914 prepStmt.setString(1, moduleId);
1915 ResultSet rs = prepStmt.executeQuery();
1916 if(rs.next())
1917 {
1918 if(rs.getString(1).equalsIgnoreCase("open"))
1919 {
1920 result = true;
1921 }
1922 }
1923 rs.close();
1924 }
1925 catch(Exception e)
1926 {
1927 log.error("isModuleOpen Error: " + e.toString());
1928 }
1929 Database.closeConnection(conn);
1930 return result;
1931 }
1932
1933 /**
1934 * @param ApplicationRoot The current running context of the application

Callers 4

testIsModuleOpenMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95

Calls 2

getCoreConnectionMethod · 0.95
closeConnectionMethod · 0.95

Tested by 1

testIsModuleOpenMethod · 0.76