diff options
| author | Michael Wilson | 2014-10-21 18:07:08 +0200 |
|---|---|---|
| committer | Michael Wilson | 2014-10-21 18:07:08 +0200 |
| commit | 549a3587a883c1d4e0336aeaf1b680423bd9a9dd (patch) | |
| tree | 38bbe7b84edfacc4019c84eedb3e6a750d7f1847 /dozentenmodulserver/src/main/java/sql/SQL.java | |
| parent | -Fehler behoben, Liste der Benutzer für Berechtigung nun korrekt (diff) | |
| parent | fixed bug (diff) | |
| download | tutor-module-549a3587a883c1d4e0336aeaf1b680423bd9a9dd.tar.gz tutor-module-549a3587a883c1d4e0336aeaf1b680423bd9a9dd.tar.xz tutor-module-549a3587a883c1d4e0336aeaf1b680423bd9a9dd.zip | |
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Conflicts:
dozentenmodulserver/src/main/java/sql/SQL.java
Diffstat (limited to 'dozentenmodulserver/src/main/java/sql/SQL.java')
| -rw-r--r-- | dozentenmodulserver/src/main/java/sql/SQL.java | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/dozentenmodulserver/src/main/java/sql/SQL.java b/dozentenmodulserver/src/main/java/sql/SQL.java index 99b4219f..3bd672e6 100644 --- a/dozentenmodulserver/src/main/java/sql/SQL.java +++ b/dozentenmodulserver/src/main/java/sql/SQL.java @@ -460,7 +460,8 @@ public class SQL { ResultSet res = stm
.executeQuery("SELECT l.lectureID, l.name, l.isActive, l.startTime, l.endTime, l.lastUsed, l.description, i.image_name, concat(u.Nachname,' ',u.Vorname) as user "
+ "FROM bwLehrpool.m_VLData_lecture l, bwLehrpool.m_VLData_imageInfo i, bwLehrpool.pm_VLData_lecture pml, bwLehrpool.m_user u "
- + "WHERE i.GUID_imageID=l.imageID AND pml.rec_read=true AND u.userID=pml.userID AND u.userID='"+userID+";");
+ + "WHERE i.GUID_imageID=l.imageID AND pml.rec_read=true AND u.userID=pml.userID AND u.userID='"
+ + userID + ";");
while (res.next()) {
list.add(new Lecture(res.getString("lectureID"), res
@@ -478,9 +479,8 @@ public class SQL { e.printStackTrace();
}
return list;
- }//end getLectureListPermissionRead
-
-
+ }// end getLectureListPermissionRead
+
public List<Lecture> getLectureListPermissionWrite(String userID) {
List<Lecture> list = new ArrayList<Lecture>();
@@ -490,7 +490,8 @@ public class SQL { ResultSet res = stm
.executeQuery("SELECT l.lectureID, l.name, l.isActive, l.startTime, l.endTime, l.lastUsed, l.description, i.image_name, concat(u.Nachname,' ',u.Vorname) as user "
+ "FROM bwLehrpool.m_VLData_lecture l, bwLehrpool.m_VLData_imageInfo i, bwLehrpool.pm_VLData_lecture pml, bwLehrpool.m_user u "
- + "WHERE i.GUID_imageID=l.imageID AND pml.rec_write=true AND u.userID=pml.userID AND u.userID='"+userID+";");
+ + "WHERE i.GUID_imageID=l.imageID AND pml.rec_write=true AND u.userID=pml.userID AND u.userID='"
+ + userID + ";");
while (res.next()) {
list.add(new Lecture(res.getString("lectureID"), res
@@ -508,9 +509,8 @@ public class SQL { e.printStackTrace();
}
return list;
- }//end getLectureListPermissionWrite
-
-
+ }// end getLectureListPermissionWrite
+
public List<Lecture> getLectureListPermissionAdmin(String userID) {
List<Lecture> list = new ArrayList<Lecture>();
@@ -520,7 +520,8 @@ public class SQL { ResultSet res = stm
.executeQuery("SELECT l.lectureID, l.name, l.isActive, l.startTime, l.endTime, l.lastUsed, l.description, i.image_name, concat(u.Nachname,' ',u.Vorname) as user "
+ "FROM bwLehrpool.m_VLData_lecture l, bwLehrpool.m_VLData_imageInfo i, bwLehrpool.pm_VLData_lecture pml, bwLehrpool.m_user u "
- + "WHERE i.GUID_imageID=l.imageID AND pml.rec_admin=true AND u.userID=pml.userID AND u.userID='"+userID+";");
+ + "WHERE i.GUID_imageID=l.imageID AND pml.rec_admin=true AND u.userID=pml.userID AND u.userID='"
+ + userID + ";");
while (res.next()) {
list.add(new Lecture(res.getString("lectureID"), res
@@ -538,9 +539,7 @@ public class SQL { e.printStackTrace();
}
return list;
- }//end getLectureListPermissionAdmin
-
-
+ }// end getLectureListPermissionAdmin
public List<Lecture> getLectureList() {
List<Lecture> list = new ArrayList<Lecture>();
@@ -1460,6 +1459,20 @@ public class SQL { // TODO Auto-generated catch block
e.printStackTrace();
}
+
+ try {
+
+ stm = con.createStatement();
+ int ret = stm
+ .executeUpdate("DELETE FROM pm_VLData_image WHERE GUID_imageID = '"
+ + imageID + "' AND userID != '" + userID + "';");
+
+ con.commit();
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
}
}// end class
|
