From 4afd47551044dae707c1d7160940d07855158380 Mon Sep 17 00:00:00 2001 From: hns Date: Thu, 6 Dec 2007 20:13:59 +0000 Subject: [PATCH] * deprecated SessionManager.loginSession() and logoutSession() as they have a twin in the Application class. Change implementations to proxy to the Application methods. --- src/helma/framework/core/SessionManager.java | 35 +++----------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/src/helma/framework/core/SessionManager.java b/src/helma/framework/core/SessionManager.java index 6e73e528..4e66e9c9 100644 --- a/src/helma/framework/core/SessionManager.java +++ b/src/helma/framework/core/SessionManager.java @@ -79,49 +79,24 @@ public class SessionManager { * Remove the session from the sessions-table and logout the user. */ public void discardSession(Session session) { - logoutSession(session); + session.logout(); sessions.remove(session.getSessionId()); } /** * Log in a user given his or her user name and password. + * @deprecated */ public boolean loginSession(String uname, String password, Session session) { - // Check the name/password of a user and log it in to the current session - if (uname == null) { - return false; - } - - uname = uname.toLowerCase().trim(); - - if ("".equals(uname)) { - return false; - } - - try { - INode users = app.getUserRoot(); - Node unode = (Node) users.getChildElement(uname); - String pw = unode.getString("password"); - - if ((pw != null) && pw.equals(password)) { - // let the old user-object forget about this session - logoutSession(session); - session.login(unode); - - return true; - } - } catch (Exception x) { - return false; - } - - return false; + return app.loginSession(uname, password, session); } /** * Log out a session from this application. + * @deprecated */ public void logoutSession(Session session) { - session.logout(); + app.logoutSession(session); }