use of app.hongs.action.anno.Action 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.action.anno.Action in project HongsCORE by ihongs.
the class SignAction method signUpdate.
/**
* 更新
* 此动作可维持会话不过期
* @param ah
* @throws HongsException
*/
@Action("update")
public void signUpdate(ActionHelper ah) throws HongsException {
HttpSession ss = ah.getRequest().getSession(false);
if (null == ss) {
ah.reply(AuthKit.getWrong(null, "core.sign.phase.invalid"));
return;
}
AuthKit.signUpd(ss);
ah.reply("");
}
use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class SignAction method signCreate.
/**
* 登录
* @param ah
* @throws HongsException
*/
@Action("create")
@Verify(conf = "master", form = "sign")
public void signCreate(ActionHelper ah) throws HongsException {
String appid = Synt.declare(ah.getParameter("appid"), "_WEB_");
String place = Synt.declare(ah.getParameter("place"), "public");
String username = Synt.declare(ah.getParameter("username"), "");
String password = Synt.declare(ah.getParameter("password"), "");
String passcode;
DB db = DB.getInstance("master");
Table tb = db.getTable("user");
FetchCase fc;
Map ud;
// 验证密码
fc = new FetchCase().from(tb.tableName).select("password, passcode, id, name, head, mtime, state").filter("username = ?", username);
ud = db.fetchLess(fc);
if (ud.isEmpty()) {
ah.reply(AuthKit.getWrong("username", "core.username.invalid"));
return;
}
passcode = Synt.declare(ud.get("passcode"), "");
password = AuthKit.getCrypt(password + passcode);
if (!password.equals(ud.get("password"))) {
ah.reply(AuthKit.getWrong("passowrd", "core.password.invalid"));
return;
}
String usrid = (String) ud.get("id");
String uname = (String) ud.get("name");
String uhead = (String) ud.get("head");
int state = Synt.declare(ud.get("state"), 0);
long utime = Synt.declare(ud.get("mtime"), 0L) * 1000;
// 验证状态
if (1 != state) {
ah.reply(AuthKit.getWrong("state", "core.sign.state.invalid"));
return;
}
// 验证区域
Set rs = RoleSet.getInstance(usrid);
if (0 != place.length() && !rs.contains(place)) {
ah.reply(AuthKit.getWrong("place", "core.sign.place.invalid"));
return;
}
ah.reply(AuthKit.userSign(ah, place, appid, usrid, uname, uhead, utime));
}
use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class DeptAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
int rn = model.delete(rd);
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("master");
String ms = ln.translate("core.delete.dept.success", Integer.toString(rn));
helper.reply(ms, rn);
}
use of app.hongs.action.anno.Action in project HongsCORE by ihongs.
the class DeptAction method getList.
@Action("list")
public void getList(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
FetchCase fc = model.fetchCase();
fc.setOption("INCLUDE_REMOVED", Synt.declare(rd.get("include-removed"), false));
fc.setOption("INCLUDE_PARENTS", Synt.declare(rd.get("include-parents"), false));
rd = model.getList(rd, fc);
helper.reply(rd);
}
Aggregations