Commit a3318598 authored by Jeffrey I. Schiller's avatar Jeffrey I. Schiller Committed by Evan W. Patton

Make sure autoload property propagates

Make sure the “autoload” query parameter is passed through all of the
various login paths.

Change-Id: I445355d325f2e5d1964bda270b52c4ef6d43e0dd
parent debd8518
......@@ -902,7 +902,7 @@ public class Ode implements EntryPoint {
}
private String makeUri(String base) {
String[] params = new String[] { "locale", "repo", "galleryId" };
String[] params = new String[] { "locale", "repo", "galleryId", "autoload" };
String separator = "?";
StringBuilder sb = new StringBuilder(base);
for (String param : params) {
......
......@@ -99,6 +99,7 @@ public class LoginServlet extends HttpServlet {
String repo = params.get("repo");
String galleryId = params.get("galleryId");
String redirect = params.get("redirect");
String autoload = params.get("autoload");
if (DEBUG) {
LOG.info("locale = " + locale + " bundle: " + new Locale(locale));
......@@ -151,6 +152,7 @@ public class LoginServlet extends HttpServlet {
uri = new UriBuilder(uri)
.add("locale", locale)
.add("repo", repo)
.add("autoload", autoload)
.add("galleryId", galleryId).build();
resp.sendRedirect(uri);
return;
......@@ -245,6 +247,7 @@ public class LoginServlet extends HttpServlet {
req.setAttribute("localeLabel", locale);
req.setAttribute("pleaselogin", bundle.getString("pleaselogin"));
req.setAttribute("login", bundle.getString("login"));
req.setAttribute("autoload", autoload);
req.setAttribute("repo", repo);
req.setAttribute("locale", locale);
req.setAttribute("galleryId", galleryId);
......@@ -279,6 +282,7 @@ public class LoginServlet extends HttpServlet {
String repo = params.get("repo");
String galleryId = params.get("galleryId");
String redirect = params.get("redirect");
String autoload = params.get("autoload");
if (locale == null) {
locale = "en";
......@@ -332,6 +336,7 @@ public class LoginServlet extends HttpServlet {
String uri = new UriBuilder("/")
.add("locale", locale)
.add("repo", repo)
.add("autoload", autoload)
.add("galleryId", galleryId).build();
resp.sendRedirect(uri); // Logged in, go to service
return;
......@@ -380,6 +385,7 @@ public class LoginServlet extends HttpServlet {
}
uri = new UriBuilder(uri)
.add("locale", locale)
.add("autoload", autoload)
.add("repo", repo)
.add("galleryId", galleryId).build();
resp.sendRedirect(uri);
......
......@@ -8,6 +8,7 @@
String locale = request.getParameter("locale");
String redirect = request.getParameter("redirect");
String repo = (String) request.getAttribute("repo");
String autoload = (String) request.getAttribute("autoload");
String galleryId = (String) request.getAttribute("galleryId");
if (locale == null) {
locale = "en";
......@@ -42,6 +43,10 @@ out.println("<center><font color=red><b>" + error + "</b></font></center><br/>")
if (repo != null && !repo.equals("")) {
%>
<input type=hidden name=repo value="<%= repo %>">
<% }
if (autoload != null && !autoload.equals("")) {
%>
<input type=hidden name=autoload value="<%= autoload %>">
<% }
if (galleryId != null && !galleryId.equals("")) {
%>
......@@ -59,6 +64,7 @@ out.println("<center><font color=red><b>" + error + "</b></font></center><br/>")
<% if (useGoogleLabel != null && useGoogleLabel.equals("true")) { %>
<center><p><a href="<%= new UriBuilder("/login/google")
.add("locale", locale)
.add("autoload", autoload)
.add("repo", repo)
.add("galleryId", galleryId)
.add("redirect", redirect).build() %>" style="text-decoration:none;">Click Here to use your Google Account to login</a></p></center>
......@@ -67,16 +73,19 @@ out.println("<center><font color=red><b>" + error + "</b></font></center><br/>")
<center><a href="<%= new UriBuilder("/login")
.add("locale", "zh_CN")
.add("repo", repo)
.add("autoload", autoload)
.add("galleryId", galleryId)
.add("redirect", redirect).build() %>" style="text-decoration:none;" >中文</a>&nbsp;
<a href="<%= new UriBuilder("/login")
.add("locale", "pt")
.add("repo", repo)
.add("autoload", autoload)
.add("galleryId", galleryId)
.add("redirect", redirect).build() %>" style="text-decoration:none;" >Português</a>&nbsp;
<a href="<%= new UriBuilder("/login")
.add("locale", "en")
.add("repo", repo)
.add("autoload", autoload)
.add("galleryId", galleryId)
.add("redirect", redirect).build() %>" style="text-decoration:none;" >English</a></center>
<p></p>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment