Changeset 7114
- Timestamp:
- Mar 16, 2016, 9:17:01 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/config/dist/web.xml
r6632 r7114 36 36 <exception-type>java.lang.Throwable</exception-type> 37 37 <location>/exception/exception.jsp</location> 38 </error-page> 39 40 <error-page> 41 <error-code>404</error-code> 42 <location>/exception/404.jsp</location> 38 43 </error-page> 39 44 -
trunk/www/exception/not_logged_in.jsp
r6635 r7114 100 100 <input type="hidden" name="ID" value="<%=ID%>"> 101 101 <input type="hidden" name="redirect" value="<%=redirect%>"> 102 <input type="hidden" name="useAutoStartPage" value="0"> 102 103 103 104 <table style="margin: auto; width: 700px; margin-top:5em; "> -
trunk/www/login.js
r7001 r7114 154 154 if (frm.login && frm.login.disabled) return; 155 155 156 // Disable start page extension if special key is used 157 var specialKey = event.altKey || event.ctrlKey || event.shiftKey; 158 156 159 // Check if the login is not recommended 157 160 var denyLogin = Doc.element('denyLogin'); … … 186 189 else 187 190 { 188 frm.redirect.value = App.getRoot()+'my_base/index.jsp?ID='+getSessionId(); 189 } 190 } 191 frm.useAutoStartPage.value = '1'; 192 frm.redirect.value = App.getRoot()+'my_base/index.jsp?ID='+App.getSessionId(); 193 } 194 } 195 196 if (specialKey && frm.useAutoStartPage) frm.useAutoStartPage.value = '0'; 191 197 192 198 if (frm.target) Dialogs.openPopup('', frm.target, 300, 200); -
trunk/www/login.jsp
r6424 r7114 28 28 @param login The login for the user. 29 29 @param password The password for the user. 30 @param nextpage The URL for the next page to show. If not31 specified the current page is reloaded32 30 33 31 @author Nicklas … … 37 35 import="net.sf.basedb.core.*" 38 36 import="net.sf.basedb.core.authentication.LoginRequest" 37 import="net.sf.basedb.util.extensions.ExtensionsInvoker" 39 38 import="net.sf.basedb.clients.web.Base" 40 39 import="net.sf.basedb.clients.web.WebException" 40 import="net.sf.basedb.clients.web.extensions.JspContext" 41 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 42 import="net.sf.basedb.clients.web.extensions.startpage.StartPageAction" 41 43 import="net.sf.basedb.clients.web.util.HTML" 42 44 import="net.sf.basedb.util.Values" 45 import="java.util.Iterator" 43 46 %> 44 47 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 48 51 String cmd = request.getParameter("cmd"); 49 52 String again = request.getParameter("again"); 53 boolean useAutoStartPage = Values.getBoolean(request.getParameter("useAutoStartPage")); 50 54 String root = request.getContextPath()+"/"; 51 55 String redirect = Values.getStringOrNull(request.getParameter("redirect")); … … 57 61 { 58 62 String password = request.getParameter("password"); 63 DbControl dc = null; 59 64 try 60 65 { … … 62 67 LoginRequest loginRequest = new LoginRequest(login, password); 63 68 sc.login(loginRequest); 69 70 if (useAutoStartPage) 71 { 72 String startPageId = sc.getUserClientSetting("start-page-id"); 73 if (startPageId != null) 74 { 75 dc = sc.newDbControl(); 76 User user = User.getById(dc, sc.getLoggedInUserId()); 77 JspContext context = ExtensionsControl.createContext(dc, pageContext, null, user); 78 ExtensionsInvoker<StartPageAction> invoker = (ExtensionsInvoker<StartPageAction>)ExtensionsControl.useExtensions(context, "net.sf.basedb.clients.web.start-page"); 79 Iterator<StartPageAction> it = invoker.iterator(); 80 while (it.hasNext()) 81 { 82 try 83 { 84 StartPageAction action = it.next(); 85 if (startPageId.equals(action.getId())) 86 { 87 String startPage = action.getUrl(); 88 if (startPage != null) 89 { 90 redirect = startPage.replace("$SESSION-ID$", sc.getId()); 91 } 92 break; 93 } 94 } 95 catch (RuntimeException ex) 96 {} 97 } 98 } 99 } 64 100 } 65 101 catch (LoginException ex) … … 83 119 errorMessage = ex.getMessage(); 84 120 } 85 121 finally 122 { 123 if (dc != null) dc.close(); 124 } 86 125 } 87 126 else if ("Impersonate".equals(cmd)) -
trunk/www/main.jsp
r6632 r7114 111 111 <form name="login" action="login.jsp" method="post"> 112 112 <input type="hidden" name="ID" value="<%=ID%>"> 113 <input type="hidden" name=" nextpage" value="<%=root%>my_base/user/index.jsp">113 <input type="hidden" name="useAutoStartPage" value="1"> 114 114 115 115 <table style="margin: auto; width: 700px;"> -
trunk/www/switch.jsp
r6607 r7114 92 92 <input type="hidden" name="again" value="1"> 93 93 <input type="hidden" name="redirect" value=""> 94 <input type="hidden" name="useAutoStartPage" value="0"> 94 95 95 96 <div class="content">
Note: See TracChangeset
for help on using the changeset viewer.