Пример #1
0
  public static long getCurrentSiteID() {
    String id = (String) User.getValue("_CurrentSiteID");
    if (XString.isEmpty(id)) {
      if ("admin".equals(User.getUserName())) {
        LogUtil.error("请在站点管理->站点列表下先创建站点");
        return 0L;
      }
      LogUtil.error("用户:" + User.getUserName() + "没有任何站点的浏览权限,请先设置权限再登陆");
      return 0L;
    }

    return Long.parseLong(id);
  }
Пример #2
0
 public void changePassword() throws SQLException {
   String OldPassword = $V("OldPassword");
   String Password = $V("Password");
   QueryBuilder qb =
       new QueryBuilder("update ZDUser set Password=? where UserName=? and Password=?");
   qb.add(XString.md5Hex(Password));
   qb.add(User.getUserName());
   qb.add(XString.md5Hex(OldPassword));
   if (qb.executeNoQuery() > 0) {
     UserLogPage.log("User", "EditPassword", "修改密码成功", this.request.getClientIP());
     this.response.setMessage("修改密码成功");
     this.response.setStatus(1);
   } else {
     UserLogPage.log("User", "EditPassword", "修改密码失败", this.request.getClientIP());
     this.response.setStatus(0);
     this.response.setMessage("修改密码失败,旧密码不正确");
   }
 }
Пример #3
0
 public static void setCurrentSiteID(String siteID) {
   if (XString.isEmpty(siteID)) User.setValue("_CurrentSiteID", "");
   else User.setValue("_CurrentSiteID", siteID);
 }