use of app.hongs.serv.master.UserAction in project HongsCORE by ihongs.
the class MineAction method mineInfo.
@Action("info")
@Preset(conf = "master", form = "mine")
public void mineInfo(ActionHelper ah) throws HongsException {
Map rd = ah.getRequestData();
String id = (String) ah.getSessibute(Cnst.UID_SES);
rd.put("id", id);
UserAction ua = new UserAction();
ua.getInfo(ah);
}
use of app.hongs.serv.master.UserAction in project HongsCORE by ihongs.
the class MineAction method mineUpdate.
@Action("update")
@Verify(conf = "master", form = "mine", type = 1, trim = 1)
public void mineUpdate(ActionHelper ah) throws HongsException {
Map rd = ah.getRequestData();
String id = (String) ah.getSessibute(Cnst.UID_SES);
// 禁止危险修改
rd.put("id", id);
rd.remove("roles");
rd.remove("rtime");
rd.remove("mtime");
rd.remove("ctime");
rd.remove("state");
// 验证原始密码
String pw = (String) rd.get("password");
String po = (String) rd.get("passolde");
if (pw != null && !"".equals(pw)) {
Map xd = new HashMap();
Map ed = new HashMap();
xd.put("errs", ed);
xd.put("ok", false);
xd.put("msg", CoreLocale.getInstance().translate("fore.form.invalid"));
if (po != null && !"".equals(po)) {
Map row = DB.getInstance("master").getTable("user").fetchCase().filter("id = ?", id).select("password").one();
po = AuthKit.getCrypt(po);
if (!po.equals(row.get("password"))) {
ed.put("passolde", "旧密码不正确");
ah.reply(xd);
return;
}
} else {
ed.put("passolde", "请填写旧密码");
ah.reply(xd);
return;
}
}
UserAction ua = new UserAction();
ua.doSave(ah);
}