aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/SignUp.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-01-31 21:44:51 +0700
committerGravatar Ugnich Anton2014-01-31 21:44:51 +0700
commitab78d170650106d1d1113282598b6d8270ef2e76 (patch)
tree4ee839ab0d00cc4cec8ec55e94929cedd782302f /src/java/com/juick/http/www/SignUp.java
parentcd7016bd09dd1fc21f375765d5cc510a1ad0656b (diff)
Russian as default
Diffstat (limited to 'src/java/com/juick/http/www/SignUp.java')
-rw-r--r--src/java/com/juick/http/www/SignUp.java36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/java/com/juick/http/www/SignUp.java b/src/java/com/juick/http/www/SignUp.java
index f6212e3d..2fbe2e2d 100644
--- a/src/java/com/juick/http/www/SignUp.java
+++ b/src/java/com/juick/http/www/SignUp.java
@@ -24,8 +24,6 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.util.Locale;
-import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -39,8 +37,6 @@ public class SignUp {
protected void doGet(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
- Locale locale = request.getLocale();
- ResourceBundle rb = ResourceBundle.getBundle("SignUp", locale);
String type = request.getParameter("type");
String hash = request.getParameter("hash");
@@ -65,8 +61,8 @@ public class SignUp {
response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
try {
- PageTemplates.pageHead(out, rb.getString("Unknown account"), "");
- PageTemplates.pageNavigation(out, locale, visitor, null);
+ PageTemplates.pageHead(out, "Новый пользователь", "");
+ PageTemplates.pageNavigation(out, visitor, null);
out.println("<section id=\"content\">");
@@ -80,42 +76,35 @@ public class SignUp {
}
out.println(account + "</h1>");
- out.println("<h2 class=\"signup-h2\">" + rb.getString("Link with existing") + "</h2>");
+ out.println("<h2 class=\"signup-h2\">Связать с существующим аккаунтом Juick</h2>");
out.println("<form action=\"/signup\" method=\"post\">");
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) {
- out.println("<input type=\"submit\" value=\"" + rb.getString("Link with this") + "\"/>");
+ out.println("<input type=\"submit\" value=\"Связать с этим аккаунтом\"/>");
} else {
- out.println("<p>" + rb.getString("Username") + ": <input type=\"text\" name=\"username\"/></p>");
- out.println("<p>" + rb.getString("Password") + ": <input type=\"password\" name=\"password\"/></p>");
+ out.println("<p>Имя пользователя: <input type=\"text\" name=\"username\"/></p>");
+ out.println("<p>Пароль: <input type=\"password\" name=\"password\"/></p>");
out.println("<p><input type=\"submit\" value=\" OK \"/></p>");
}
out.println("</form>");
out.println("<hr class=\"signup-hr\"/>");
- out.println("<h2 class=\"signup-h2\">" + rb.getString("Create new") + "</h2>");
+ out.println("<h2 class=\"signup-h2\">Создать новый аккаунт Juick</h2>");
out.println("<form action=\"/signup\" method=\"post\">");
out.println("<input type=\"hidden\" name=\"action\" value=\"new\"/>");
out.println("<input type=\"hidden\" name=\"type\" value=\"" + type + "\"/>");
out.println("<input type=\"hidden\" name=\"hash\" value=\"" + hash + "\"/>");
- out.println("<p>" + rb.getString("Username") + ": <input type=\"text\" name=\"username\" id=\"username\" onblur=\"checkUsername()\"/><br/><i>" + rb.getString("Username restrictions") + "</i></p>");
- out.println("<p>" + rb.getString("Password") + ": <input type=\"password\" name=\"password\"/><br/><i>" + rb.getString("Password restrictions") + "</i></p>");
- out.println("<p>" + rb.getString("Language") + ": <select name=\"lang\">");
- String langs[] = rb.getString("Languages").split(",");
- String langcodes[] = rb.getString("Language codes").split(",");
- for (int i = 0; i < langs.length; i++) {
- out.println(" <option value=\"" + langcodes[i] + "\">" + langs[i] + "</option>");
- }
- out.println("</select></p>");
+ out.println("<p>Имя пользователя: <input type=\"text\" name=\"username\" id=\"username\" onblur=\"checkUsername()\"/><br/><i>(От 2-х до 16-и латинских символов и/или цифр, дефис)</i></p>");
+ out.println("<p>Пароль: <input type=\"password\" name=\"password\"/><br/><i>(от 6-и до 32-х символов)</i></p>");
out.println("<p><input type=\"submit\" value=\" OK \"/></p>");
out.println("</form>");
out.println("</section>");
- PageTemplates.pageFooter(request, out, locale, visitor, false);
+ PageTemplates.pageFooter(request, out, visitor, false);
PageTemplates.pageEnd(out);
} finally {
out.close();
@@ -163,15 +152,14 @@ public class SignUp {
} else { // Create new account
String username = request.getParameter("username");
String password = request.getParameter("password");
- String lang = request.getParameter("lang");
- if (username == null || password == null || lang == null || username.length() < 2 || username.length() > 16 || !username.matches("^[a-zA-Z0-9\\-]+$") || password.length() < 6 || password.length() > 32 || lang.length() != 2) {
+ if (username == null || password == null || username.length() < 2 || username.length() > 16 || !username.matches("^[a-zA-Z0-9\\-]+$") || password.length() < 6 || password.length() > 32) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
// CHECK USERNAME
- uid = UserQueries.createUser(sql, username, password, lang);
+ uid = UserQueries.createUser(sql, username, password);
if (uid <= 0) {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;