diff --git a/maxkey-webs/maxkey-web-maxkey/bin/main/messages/message.properties b/maxkey-webs/maxkey-web-maxkey/bin/main/messages/message.properties index 4b57cf314..665c8e65c 100644 --- a/maxkey-webs/maxkey-web-maxkey/bin/main/messages/message.properties +++ b/maxkey-webs/maxkey-web-maxkey/bin/main/messages/message.properties @@ -47,19 +47,62 @@ login.text.register=\u7528\u6237\u6CE8\u518C login.password.expired=\u5BC6\u7801\u8FC7\u671F login.password.expired.tip=\u5BC6\u7801\u8FC7\u671F\uFF0C\u8BF7\u4FEE\u6539\u5BC6\u7801 +login.password.oldPassword=\u539F\u5BC6\u7801 login.password.newPassword=\u65B0\u5BC6\u7801 login.password.confirmPassword=\u786E\u8BA4\u65B0\u5BC6\u7801 login.password.initial.change.tip=\u9996\u6B21\u767B\u5F55\uFF0C\u8BF7\u4FEE\u6539\u521D\u59CB\u5316\u5BC6\u7801 +login.password.changepassword=\u5BC6\u7801\u4FEE\u6539 +login.password.applogin.changepassword=\u5E94\u7528\u767B\u5F55\u5BC6\u7801\u8BBE\u7F6E -userinfo.displayName=\u7528\u6237 -userinfo.username=\u767B\u5F55\u540D +login.social.link=\u7ED1\u5B9A +login.social.unlink=\u89E3\u9664 +login.social.icon=\u56FE\u6807 +login.social.provider=\u4F9B\u5E94\u5546 +userinfo.displayName=\u7528\u6237\u540D +userinfo.username=\u767B\u5F55\u8D26\u53F7 +userinfo.email=\u90AE\u7BB1\u5730\u5740 +userinfo.mobile=\u624B\u673A\u53F7\u7801 +userinfo.authnType=\u767B\u5F55\u65B9\u5F0F +userinfo.authnType.authnType.1=\u666E\u901A\u767B\u5F55 +userinfo.authnType.authnType.2=\u624B\u673A\u4EE4\u724C +userinfo.authnType.authnType.3=\u77ED\u4FE1\u9A8C\u8BC1 +userinfo.authnType.authnType.4=\u90AE\u4EF6\u9A8C\u8BC1 +userinfo.authnType.authnType.5=\u65F6\u95F4\u4EE4\u724C +userinfo.authnType.authnType.6=\u8BA1\u6570\u5668\u4EE4\u724C +userinfo.authnType.authnType.7=HOTP\u4EE4\u724C +userinfo.authnType.authnType.8=RSA\u4EE4\u724C +userinfo.authnType.authnType.9=\u6570\u5B57\u8BC1\u4E66 +userinfo.authnType.authnType.10=USB Key + +login.totp.sharedSecret=\u5171\u4EAB\u5BC6\u7801 +login.totp.period=\u5468\u671F +login.totp.digits=\u6570\u5B57 +login.totp.crypto=\u52A0\u5BC6\u65B9\u5F0F +login.totp.generate=\u91CD\u65B0\u751F\u6210 +login.totp.title=TimeBased One Time Password + +login.hotp.sharedSecret=\u5171\u4EAB\u5BC6\u7801 +login.hotp.period=\u5468\u671F +login.hotp.digits=\u6570\u5B57 +login.hotp.crypto=\u52A0\u5BC6\u65B9\u5F0F +login.hotp.generate=\u91CD\u65B0\u751F\u6210 +login.hotp.title=HOTP One Time Password + +login.counter.sharedSecret=\u5171\u4EAB\u5BC6\u7801 +login.counter.period=\u5468\u671F +login.counter.digits=\u6570\u5B57 +login.counter.crypto=\u52A0\u5BC6\u65B9\u5F0F +login.counter.generate=\u91CD\u65B0\u751F\u6210 +login.counter.title=Counter Based One Time Password apps.icon=\u56FE\u6807 apps.name=\u5E94\u7528\u540D\u79F0 apps.protocol=\u8BBF\u95EE\u534F\u8BAE apps.category=\u7C7B\u578B + button.text.action=\u8BBF\u95EE button.text.visit=\u8BBF\u95EE button.text.save=\u4FDD\u5B58 +button.text.select=\u8BF7\u9009\u62E9 diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ContactsController.java b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ContactsController.java deleted file mode 100644 index 8dcb0608f..000000000 --- a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/ContactsController.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.maxkey.web.contorller; - -import java.awt.image.BufferedImage; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.util.UUID; - -import org.apache.mybatis.jpa.persistence.JpaPageResults; -import org.maxkey.dao.service.UserInfoService; -import org.maxkey.domain.UserInfo; -import org.maxkey.util.DateUtils; -import org.maxkey.util.RQCodeUtils; -import org.maxkey.web.WebContext; -import org.maxkey.web.endpoint.ImageEndpoint; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - - -@Controller -@RequestMapping(value={"/contact"}) -public class ContactsController { - final static Logger _logger = LoggerFactory.getLogger(ContactsController.class); - - @Autowired - private UserInfoService userInfoService; - - @RequestMapping(value={"/list"}) - public ModelAndView forward(){ - return new ModelAndView("contact/contactList"); - } - - @RequestMapping(value={"/grid"}) - @ResponseBody - public JpaPageResults forwardUserInfoList(@ModelAttribute("userinfo") UserInfo userinfo){ - return userInfoService.queryPageResults(userinfo); - - } - - @RequestMapping(value={"/details/{id}"}) - public ModelAndView details(@PathVariable("id") String id) { - ModelAndView modelAndView=new ModelAndView("contact/details"); - UserInfo userInfo=new UserInfo(); - userInfo.setId(id); - userInfo=userInfoService.load(userInfo); - WebContext.getSession().setAttribute(userInfo.getId(), userInfo.getPicture()); - modelAndView.addObject("rqcode", RQVCard(userInfo)); - modelAndView.addObject("model", userInfo); - return modelAndView; - } - - /* - * BEGIN:VCARD - * VERSION:3.0 - * N:Gump;Forrest;;Mr. - * FN:Forrest Gump - * ORG:Bubba Gump Shrimp Co. - * TITLE:Shrimp Man - * PHOTO;VALUE=URL;TYPE=GIF:http://www.example.com/dir_photos/my_photo.gif - * TEL;TYPE=WORK,VOICE:(111) 555-12121 - * TEL;TYPE=HOME,VOICE:(404) 555-1212 - * ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America - * LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of America - * ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America - * LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of America - * EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com - * REV:2008-04-24T19:52:43Z - * END:VCARD - - - - * BEGIN:VCARD - * VERSION:4.0 - * N:Gump;Forrest;;; - * FN:Forrest Gump - * ORG:Bubba Gump Shrimp Co. - * TITLE:Shrimp Man - * PHOTO;MEDIATYPE=image/gif:http://www.example.com/dir_photos/my_photo.gif - * TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212 - * TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212 - * ADR;TYPE=work;LABEL="100 Waters Edge\nBaytown, LA 30314\nUnited States of America" - * :;;100 Waters Edge;Baytown;LA;30314;United States of America - * ADR;TYPE=home;LABEL="42 Plantation St.\nBaytown, LA 30314\nUnited States of America" - * :;;42 Plantation St.;Baytown;LA;30314;United States of America - * EMAIL:forrestgump@example.com - * REV:20080424T195243Z - * END:VCARD - */ - public String RQVCard(UserInfo userInfo){ - String strRQVCard = - "BEGIN:VCARD\n" + - "VERSION:3.0\n" + - "N:"+userInfo.getDisplayName()+"\n" + - "ORG:"+userInfo.getOrganization()+"\n" + - "TITLE:"+userInfo.getJobTitle()+"\n" + - "TEL;TYPE=WORK,VOICE:"+userInfo.getMobile()+"\n" + - "ADR;TYPE=WORK:"+userInfo.getWorkStreetAddress()+"\n" + - "EMAIL:"+userInfo.getEmail()+"\n" + - "URL:"+userInfo.getWebSite()+"\n" + - "GENDER:"+(userInfo.getGender()==1?"F":"M")+"\n" + - "REV:"+DateUtils.toUtc(new Date())+"\n" + - "END:VCARD\n" ; - _logger.debug("RQVCard : \n"+strRQVCard); - BufferedImage bufferedImage; - try { - bufferedImage = RQCodeUtils.write2BufferedImage(new String(strRQVCard.getBytes("UTF-8"),"iso-8859-1"), "gif", 300, 300); - byte[] imageByte=ImageEndpoint.bufferedImage2Byte(bufferedImage); - String uuid=UUID.randomUUID().toString().toLowerCase(); - WebContext.getSession().setAttribute(uuid, imageByte); - return uuid; - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - - return null; - } - -} diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/OneTimePasswordController.java b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/OneTimePasswordController.java index 08c4af1cf..fcce9d467 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/OneTimePasswordController.java +++ b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/OneTimePasswordController.java @@ -27,7 +27,7 @@ import org.springframework.web.servlet.ModelAndView; * */ @Controller -@RequestMapping(value = { "/otp" }) +@RequestMapping(value = { "/safe/otp" }) public class OneTimePasswordController { final static Logger _logger = LoggerFactory.getLogger(OneTimePasswordController.class); @@ -78,7 +78,7 @@ public class OneTimePasswordController { userInfo.setSharedSecret(sharedSecret); userInfoService.changeSharedSecret(userInfo); WebContext.setUserInfo(userInfo); - return WebContext.redirect("/otp/timebased"); + return WebContext.redirect("/safe/otp/timebased"); } @@ -112,7 +112,7 @@ public class OneTimePasswordController { userInfo.setSharedCounter("0"); userInfoService.changeSharedSecret(userInfo); WebContext.setUserInfo(userInfo); - return WebContext.redirect("/otp/counterbased"); + return WebContext.redirect("/safe/otp/counterbased"); } @RequestMapping(value={"/hotp"}) @@ -144,7 +144,7 @@ public class OneTimePasswordController { userInfo.setSharedCounter("0"); userInfoService.changeSharedSecret(userInfo); WebContext.setUserInfo(userInfo); - return WebContext.redirect("/otp/hotp"); + return WebContext.redirect("/safe/otp/hotp"); } diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java index edc584fc8..b6e29cdba 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java +++ b/maxkey-webs/maxkey-web-maxkey/src/main/java/org/maxkey/web/contorller/SafeController.java @@ -145,73 +145,21 @@ public class SafeController { @ResponseBody @RequestMapping(value="/setting") public Message setting( - @RequestParam("authnType") String authnType) { + @RequestParam("authnType") String authnType, + @RequestParam("mobile") String mobile, + @RequestParam("mobileVerify") String mobileVerify, + @RequestParam("email") String email, + @RequestParam("emailVerify") String emailVerify) { UserInfo userInfo =WebContext.getUserInfo(); userInfo.setAuthnType(Integer.parseInt(authnType)); - userInfoService.changeAuthnType(userInfo); - return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success); - - } - - @RequestMapping(value="/forward/question") - public ModelAndView fowardQuestion() { - ModelAndView modelAndView=new ModelAndView("safe/question"); - modelAndView.addObject("model", WebContext.getUserInfo()); - return modelAndView; - } - - @ResponseBody - @RequestMapping(value="/question") - public Message question( - @RequestParam("passwordQuestion") String passwordQuestion, - @RequestParam("passwordAnswer") String passwordAnswer) { - UserInfo userInfo =WebContext.getUserInfo(); - userInfo.setPasswordQuestion(userInfo.getPasswordQuestion()); - userInfo.setPasswordAnswer(userInfo.getPasswordAnswer()); - userInfoService.changePasswordQuestion(userInfo); - return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success); - - } - - @RequestMapping(value="/forward/mobile") - public ModelAndView fowardMobile() { - ModelAndView modelAndView=new ModelAndView("safe/mobile"); - modelAndView.addObject("model", WebContext.getUserInfo()); - return modelAndView; - } - - @ResponseBody - @RequestMapping(value="/mobile") - public Message mobile( - @RequestParam("mobile") String mobile, - @RequestParam("verify") String verify) { - - UserInfo userInfo =WebContext.getUserInfo(); userInfo.setMobile(mobile); userInfoService.changeMobile(userInfo); - return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success); - } - - @RequestMapping(value="/forward/email") - public ModelAndView fowardEmail() { - ModelAndView modelAndView=new ModelAndView("safe/email"); - modelAndView.addObject("model", WebContext.getUserInfo()); - return modelAndView; - } - - @ResponseBody - @RequestMapping(value="/email") - public Message email( - @RequestParam("email") String email, - @RequestParam("verify") String verify) { - - UserInfo userInfo =WebContext.getUserInfo(); userInfo.setEmail(email); userInfoService.changeEmail(userInfo); - + return new Message(WebContext.getI18nValue(OPERATEMESSAGE.UPDATE_SUCCESS),MessageType.success); } diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message.properties b/maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message.properties index 4b57cf314..665c8e65c 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message.properties +++ b/maxkey-webs/maxkey-web-maxkey/src/main/resources/messages/message.properties @@ -47,19 +47,62 @@ login.text.register=\u7528\u6237\u6CE8\u518C login.password.expired=\u5BC6\u7801\u8FC7\u671F login.password.expired.tip=\u5BC6\u7801\u8FC7\u671F\uFF0C\u8BF7\u4FEE\u6539\u5BC6\u7801 +login.password.oldPassword=\u539F\u5BC6\u7801 login.password.newPassword=\u65B0\u5BC6\u7801 login.password.confirmPassword=\u786E\u8BA4\u65B0\u5BC6\u7801 login.password.initial.change.tip=\u9996\u6B21\u767B\u5F55\uFF0C\u8BF7\u4FEE\u6539\u521D\u59CB\u5316\u5BC6\u7801 +login.password.changepassword=\u5BC6\u7801\u4FEE\u6539 +login.password.applogin.changepassword=\u5E94\u7528\u767B\u5F55\u5BC6\u7801\u8BBE\u7F6E -userinfo.displayName=\u7528\u6237 -userinfo.username=\u767B\u5F55\u540D +login.social.link=\u7ED1\u5B9A +login.social.unlink=\u89E3\u9664 +login.social.icon=\u56FE\u6807 +login.social.provider=\u4F9B\u5E94\u5546 +userinfo.displayName=\u7528\u6237\u540D +userinfo.username=\u767B\u5F55\u8D26\u53F7 +userinfo.email=\u90AE\u7BB1\u5730\u5740 +userinfo.mobile=\u624B\u673A\u53F7\u7801 +userinfo.authnType=\u767B\u5F55\u65B9\u5F0F +userinfo.authnType.authnType.1=\u666E\u901A\u767B\u5F55 +userinfo.authnType.authnType.2=\u624B\u673A\u4EE4\u724C +userinfo.authnType.authnType.3=\u77ED\u4FE1\u9A8C\u8BC1 +userinfo.authnType.authnType.4=\u90AE\u4EF6\u9A8C\u8BC1 +userinfo.authnType.authnType.5=\u65F6\u95F4\u4EE4\u724C +userinfo.authnType.authnType.6=\u8BA1\u6570\u5668\u4EE4\u724C +userinfo.authnType.authnType.7=HOTP\u4EE4\u724C +userinfo.authnType.authnType.8=RSA\u4EE4\u724C +userinfo.authnType.authnType.9=\u6570\u5B57\u8BC1\u4E66 +userinfo.authnType.authnType.10=USB Key + +login.totp.sharedSecret=\u5171\u4EAB\u5BC6\u7801 +login.totp.period=\u5468\u671F +login.totp.digits=\u6570\u5B57 +login.totp.crypto=\u52A0\u5BC6\u65B9\u5F0F +login.totp.generate=\u91CD\u65B0\u751F\u6210 +login.totp.title=TimeBased One Time Password + +login.hotp.sharedSecret=\u5171\u4EAB\u5BC6\u7801 +login.hotp.period=\u5468\u671F +login.hotp.digits=\u6570\u5B57 +login.hotp.crypto=\u52A0\u5BC6\u65B9\u5F0F +login.hotp.generate=\u91CD\u65B0\u751F\u6210 +login.hotp.title=HOTP One Time Password + +login.counter.sharedSecret=\u5171\u4EAB\u5BC6\u7801 +login.counter.period=\u5468\u671F +login.counter.digits=\u6570\u5B57 +login.counter.crypto=\u52A0\u5BC6\u65B9\u5F0F +login.counter.generate=\u91CD\u65B0\u751F\u6210 +login.counter.title=Counter Based One Time Password apps.icon=\u56FE\u6807 apps.name=\u5E94\u7528\u540D\u79F0 apps.protocol=\u8BBF\u95EE\u534F\u8BAE apps.category=\u7C7B\u578B + button.text.action=\u8BBF\u95EE button.text.visit=\u8BBF\u95EE button.text.save=\u4FDD\u5B58 +button.text.select=\u8BF7\u9009\u62E9 diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/contact/contactList.jsp b/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/contact/contactList.jsp deleted file mode 100644 index e7067913e..000000000 --- a/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/contact/contactList.jsp +++ /dev/null @@ -1,96 +0,0 @@ -<%@ page contentType="text/html; charset=UTF-8" import="java.util.Map,java.util.LinkedHashMap" %> -<%@ page import="org.maxkey.web.*"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> - - -
- - - - - - -
- : - -
- - "> - " expandValue="" collapseValue=""> - -
-
- " /> -
-
- - -
- - - - \ No newline at end of file diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/contact/details.jsp b/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/contact/details.jsp deleted file mode 100644 index 8dc077fdd..000000000 --- a/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/contact/details.jsp +++ /dev/null @@ -1,64 +0,0 @@ -<%@ page contentType="text/html; charset=UTF-8" import="java.util.Map,java.util.LinkedHashMap" %> -<%@ page import="org.maxkey.web.*"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="s" uri="http://www.connsec.com/tags" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> - - - - - - - -
- - " /> - - - " /> - -
- " /> -
- " /> - - - - - - - - - - - - - - - - - - - - - - - - - -
-
diff --git a/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/layout/nav_primary.jsp b/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/layout/nav_primary.jsp index 504845e55..0a2072521 100644 --- a/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/layout/nav_primary.jsp +++ b/maxkey-webs/maxkey-web-maxkey/src/main/webapp/WEB-INF/views/layout/nav_primary.jsp @@ -1,77 +1,105 @@ -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> -<%@ page language="java" import="org.maxkey.web.*" %> -<%@ page language="java" import="org.maxkey.domain.*"%> -<%@ page language="java" import="org.maxkey.domain.userinfo.*"%> -<%@ taglib prefix="s" uri="http://sso.maxkey.org/tags" %> -