Changeset 8040 for branches/3.19-stable
- Timestamp:
- Jun 2, 2022, 10:00:56 AM (10 months ago)
- Location:
- branches/3.19-stable/src/core/net/sf/basedb/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.19-stable/src/core/net/sf/basedb/core/SessionControl.java
r8038 r8040 576 576 updateLastAccess(); 577 577 // Are we already logged in? 578 if (isLoggedIn())579 {580 throw new AlreadyLoggedInException(loginInfo.userLogin);581 }582 578 if (loginRequest == null) throw new InvalidUseOfNullException("loginRequest"); 583 579 if (loginRequest.getLogin() == null) throw new InvalidUseOfNullException("loginRequest.login"); 580 if (isLoggedIn() && !loginRequest.isVerifyOnly()) 581 { 582 throw new AlreadyLoggedInException(loginInfo.userLogin); 583 } 584 584 585 585 org.hibernate.Session session = null; … … 617 617 throw new LoginException(ex.getMessage(), ex); 618 618 } 619 620 // Return now if the login request is for verification only 621 if (loginRequest.isVerifyOnly()) return; 619 622 620 623 // The login was ok so far... check device verification … … 1298 1301 currentContexts.clear(); 1299 1302 allowedClients.clear(); 1300 sessionSettings.clear();1301 1303 loginInfo = null; 1302 1304 } -
branches/3.19-stable/src/core/net/sf/basedb/core/authentication/LoginRequest.java
r7408 r8040 24 24 import java.util.HashMap; 25 25 import java.util.Map; 26 27 import net.sf.basedb.core.SessionControl; 26 28 27 29 /** … … 34 36 public class LoginRequest 35 37 { 36 38 private boolean verifyOnly; 37 39 private int userId; 38 40 private String login; … … 86 88 } 87 89 90 /** 91 Set a flag to indicate if the login request should only verify 92 the login parameters and not do a full login. 93 @since 3.19.3 94 */ 95 public void setVerifyOnly(boolean verifyOnly) 96 { 97 this.verifyOnly = verifyOnly; 98 } 99 100 /** 101 If this flag is set, the login parameters are only verified and 102 the actual login is aborted. If the verification is successful, the 103 {@link SessionControl#login(LoginRequest)} returns normally, otherwise 104 an exception is thrown. 105 @since 3.19.3 106 */ 107 public boolean isVerifyOnly() 108 { 109 return verifyOnly; 110 } 88 111 89 112 /**
Note: See TracChangeset
for help on using the changeset viewer.