diff options
Diffstat (limited to 'juick-www/src/main')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/SignUp.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/juick-www/src/main/java/com/juick/www/SignUp.java b/juick-www/src/main/java/com/juick/www/SignUp.java index 865fc453..a67d049a 100644 --- a/juick-www/src/main/java/com/juick/www/SignUp.java +++ b/juick-www/src/main/java/com/juick/www/SignUp.java @@ -85,7 +85,7 @@ public class SignUp { out.println("<input type=\"hidden\" name=\"action\" value=\"link\"/>"); out.println("<input type=\"hidden\" name=\"type\" value=\"" + type + "\"/>"); out.println("<input type=\"hidden\" name=\"hash\" value=\"" + hash + "\"/>"); - if (visitor != null) { + if (visitor.getUID() > 0) { out.println("<input type=\"submit\" value=\"Связать с этим аккаунтом\"/>"); } else { out.println("<p>Имя пользователя: <input type=\"text\" name=\"username\"/></p>"); @@ -208,7 +208,12 @@ public class SignUp { private String getFacebookNameByHash(JdbcTemplate sql, String hash) { try { - return sql.queryForObject("SELECT fb_name,fb_link FROM facebook WHERE loginhash=?", String.class, hash); + List<Pair<String, String>> fb = sql.query("SELECT fb_name,fb_link FROM facebook WHERE loginhash=?", + (rs, num) -> Pair.of(rs.getString(1), rs.getString(2)), hash); + if (fb.size() > 0) { + return "<a href=\"" + fb.get(0).getRight() + "\" rel=\"nofollow\">" + fb.get(0).getLeft() + "</a>"; + } + return null; } catch (EmptyResultDataAccessException e) { return null; } |