コード例 #1
0
ファイル: UserManager.java プロジェクト: chscqe/wahlzeit
  public void emailWelcomeMessage(UserSession us, User user) {
    ModelConfig config = us.getClient().getLanguageConfiguration();
    EmailAddress from = config.getAdministratorEmailAddress();
    EmailAddress to = user.getEmailAddress();

    String emailSubject = config.getWelcomeEmailSubject();
    String emailBody = config.getWelcomeEmailBody() + "\n\n";
    emailBody += config.getWelcomeEmailUserName() + user.getNickName() + "\n\n";
    emailBody += config.getGeneralEmailRegards() + "\n\n----\n";
    emailBody += config.getGeneralEmailFooter() + "\n\n";

    EmailService emailService = EmailServiceManager.getDefaultService();
    emailService.sendEmailIgnoreException(
        from, to, config.getAuditEmailAddress(), emailSubject, emailBody);
  }
コード例 #2
0
  protected String doHandlePost(UserSession us, Map args) {
    String id = us.getAndSaveAsString(args, "photoId");
    Photo photo = PhotoManager.getInstance().getPhoto(id);

    String tags = us.getAndSaveAsString(args, Photo.TAGS);
    photo.setTags(new Tags(tags));
    String status = us.getAndSaveAsString(args, Photo.STATUS);
    photo.setStatus(PhotoStatus.getFromString(status));

    AsyncTaskExecutor.savePhotoAsync(id);

    log.info(
        LogBuilder.createUserMessage()
            .addAction("AdminUserPhoto")
            .addParameter("Photo", photo.getId().asString())
            .toString());

    us.setMessage(us.getClient().getLanguageConfiguration().getPhotoUpdateSucceeded());

    return PartUtil.SHOW_ADMIN_PAGE_NAME;
  }