Dateiverwaltung für die WebBox
ulrich
2017-02-19 b7475d69c0d52f1639a13fae0afc617767852173
commit | author | age
b7475d 1 /*
U 2  *  Nutzerverwaltung - User and role management in your browser
3  *  Copyright (C) 2011-2017 Ulrich Hilger, http://uhilger.de
4  *
5  *  This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 3 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program.  If not, see http://www.gnu.org/licenses/
17  */
18
19 package de.uhilger.filecms.pub;
20
21 //import de.uhilger.um.api.Api;
22 //import static de.uhilger.um.api.UserMgr.MP_USER_DATA;
23 //import static de.uhilger.um.api.UserMgr.SQL_GET_USER_DATA;
24 //import static de.uhilger.um.api.UserMgr.WITHOUT_BLOBS;
25 //import de.uhilger.um.daten.UserData;
26 import de.uhilger.filecms.api.Api;
27 import java.util.logging.Logger;
28
29 /**
30  *
31  */
32 public class SessionManager extends Api {
33   
34   private static final Logger logger = Logger.getLogger(SessionManager.class.getName());
35   
36   // /um/pub?c=de.uhilger.um.pub.SessionManager&m=getSessionUser
37   /*
38   public UserData getSessionUser() {
39     UserData userData = new UserData();
40     userData.setFirstName("nicht angemeldet");
41     userData.setLastName("nicht angemeldet");
42     userData.setId("nicht angemeldet");
43     userData.setEmail("nicht angemeldet");
44     Object p = getRequest().getUserPrincipal();
45     if(p instanceof Principal) {
46       String id = ((Principal) p).getName();
47       logger.finer("User-ID: " + id);
48       List userDataList = getDb().select(getSql(SQL_GET_USER_DATA), getMapper(MP_USER_DATA), WITHOUT_BLOBS, id);
49       if(userDataList != null && userDataList.size() > 0) {
50         Object o = userDataList.get(0);
51         if(o instanceof UserData) {
52           userData = (UserData) o;
53         }
54       }
55     } else {
56       logger.finer("getUserPrincipal returned null or no Principal");
57     }
58     return userData;
59   }
60 */
61   
62   public String expireSession() {
63     getRequest().getSession().invalidate();
64     return "Die aktuelle Sitzung ist nicht mehr gueltig.";
65   }
66   
67   
68 }