diff options
| author | Tobias Spitzer | 2014-08-25 12:59:12 +0200 |
|---|---|---|
| committer | Tobias Spitzer | 2014-08-25 12:59:12 +0200 |
| commit | 393fe2056e4e750a8dcbc6176f230564dad04ef8 (patch) | |
| tree | 7b278068a1ca4c3f7020253e3cd006e4d8dad1de /Dozentenmodulserver/src/sql | |
| parent | Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module (diff) | |
| download | tutor-module-393fe2056e4e750a8dcbc6176f230564dad04ef8.tar.gz tutor-module-393fe2056e4e750a8dcbc6176f230564dad04ef8.tar.xz tutor-module-393fe2056e4e750a8dcbc6176f230564dad04ef8.zip | |
Initialrechte für Veranstaltungen nun Verfügbar
Diffstat (limited to 'Dozentenmodulserver/src/sql')
| -rw-r--r-- | Dozentenmodulserver/src/sql/SQL.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index 0f222249..8a4e9ae2 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -952,4 +952,60 @@ public class SQL { }
return -1;
}
+ public int setLectureRights(String pk_person, String pk_lecture,int role ,int read, int write, int changePermission, int admin) {
+
+
+
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+
+ String uid = UUID.randomUUID().toString();
+ stm.executeUpdate("INSERT INTO `bwLehrpool`.`pm_VLData_lecture`(`GUID`,`lectureID`,`roleID`,`userID`,`rec_read`,`rec_write`,`rec_admin`,`rec_changePermission`)VALUES('"
+ + uid
+ + "','"
+ + pk_lecture
+ + "','"
+ + role
+ + "','"
+ + pk_person
+ + "','"
+ + read
+ + "','"
+ + write
+ + "','"
+ + admin
+ + "','"
+ + changePermission+ "');");
+ con.commit();
+ con.close();
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to setLectureRights.");
+ e.printStackTrace();
+ }
+ return 0;
+
+ }
+ public String getLectureID(String name) {
+ String id=null;
+ try {
+ Connection con=getConnection();
+ Statement stm = con.createStatement();
+ ResultSet lecture= stm
+ .executeQuery("SELECT lectureID FROM bwLehrpool.m_VLData_lecture where name like '"
+ + name + "';");
+ while (lecture.next()) {
+ id=lecture.getString("lectureID");
+
+ }
+ con.close();
+ return id;
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ log.info(new Date() + " - Failed to LectureID.");
+ e.printStackTrace();
+ }
+ return id;
+ }
}
|
