Пример #1
0
 private void setUserOrg(BaseUser user) {
   Organization org = organizationDao.findByResId(user.getId());
   if (org != null) {
     ActionContext.getContext()
         .getSession()
         .put(Constants.SESSION_USER_OWN_ORG, org.getSchoolName());
   }
 }
Пример #2
0
 @Action(
     value = "reInviteTeacher",
     results = {@Result(name = SUCCESS, type = "json")})
 public String reInviteTeacher() {
   ResultData<String> rd = new ResultData<String>();
   ActionContext.getContext().getValueStack().push(rd);
   try {
     BaseUser teacher = baseUserDao.findByEmail(user.getEmail());
     Organization org = organizationDao.findByResId(getSessionUserId());
     OrganizationTeacher orgTeacher =
         organizationTeacherDao.findByOrgIdAndTeacherId(org.getId(), teacher.getId());
     orgTeacher.setTeacherStatus(Constants.USER_STATUS_UNCONFIRMED);
     organizationTeacherDao.persistAbstract(orgTeacher);
     rd.setResult(200);
   } catch (Exception e) {
     rd.setResult(500);
     rd.setMessage("ReInvite Failure:" + e.getMessage());
     logger.error("ReInvite Failure", e);
   }
   return SUCCESS;
 }
Пример #3
0
 @Action(
     value = "deleteTeacher",
     results = {@Result(name = SUCCESS, type = "json")})
 public String deleteTeacher() {
   ResultData<String> rd = new ResultData<String>();
   ActionContext.getContext().getValueStack().push(rd);
   try {
     BaseUser teacher = baseUserDao.findByEmail(user.getEmail());
     Organization org = organizationDao.findByResId(getSessionUserId());
     OrganizationTeacher orgTeacher =
         organizationTeacherDao.findByOrgIdAndTeacherId(org.getId(), teacher.getId());
     // 删除用户
     organizationTeacherDao.delete(orgTeacher);
     // 不删除角色
     rd.setResult(200);
   } catch (Exception e) {
     rd.setResult(500);
     rd.setMessage("Delete Failure:" + e.getMessage());
     logger.error("Delete Failure", e);
   }
   return SUCCESS;
 }