summaryrefslogtreecommitdiffstats
path: root/Dozentenmodulserver/src/sql
diff options
context:
space:
mode:
Diffstat (limited to 'Dozentenmodulserver/src/sql')
-rw-r--r--Dozentenmodulserver/src/sql/SQL.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java
index 3ba59923..0f222249 100644
--- a/Dozentenmodulserver/src/sql/SQL.java
+++ b/Dozentenmodulserver/src/sql/SQL.java
@@ -894,4 +894,62 @@ public class SQL {
}
return ret;
}
+
+ public int setImageRights(String pk_person, String pk_image,int role ,int read, int write, int changePermission, int admin,int linkallowed) {
+
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ String uid = UUID.randomUUID().toString();
+ stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_image`(`GUID`,`GUID_imageID`,`roleID`,`userID`,`image_read`,`image_write`,`image_admin`,`image_changePermission`,`link_allowed`)VALUES('"
+ + uid
+ + "','"
+ + pk_image
+ + "','"
+ + role
+ + "','"
+ + pk_person
+ + "','"
+ + read
+ + "','"
+ + write
+ + "','"
+ + admin
+ + "','"
+ + changePermission
+ + "','"
+ + linkallowed+ "');");
+ con.commit();
+ con.close();
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to setImageRights.");
+ e.printStackTrace();
+ }
+ return 0;
+
+ }
+ public int getRoleID(String role) {
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ ResultSet rs=stm
+ .executeQuery("SELECT roleID FROM bwLehrpool.m_role where name like '"+ role+ "';");
+ rs.first();
+
+ return rs.getInt("roleID");
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to getRoleID.");
+ e.printStackTrace();
+ }
+ return -1;
+ }
}