コード例 #1
0
ファイル: UserSession.java プロジェクト: pwa/wahlzeit
 public boolean isPhotoOwner(Photo photo) {
   boolean result = false;
   Client client = getClient();
   if ((photo != null) && (client instanceof User)) {
     User user = (User) client;
     result = photo.getOwnerName().equals(user.getName());
   }
   return result;
 }
コード例 #2
0
ファイル: UserSession.java プロジェクト: pwa/wahlzeit
 /** Returns some signifier of current user */
 public String getClientName() {
   String result = "anon";
   if (!StringUtil.isNullOrEmptyString(getEmailAddressAsString())) {
     result = getEmailAddressAsString();
     if (client instanceof User) {
       User user = (User) client;
       result = user.getName();
     }
   }
   return result;
 }
コード例 #3
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);
  }
コード例 #4
0
ファイル: UserManager.java プロジェクト: chscqe/wahlzeit
  public User getUserByEmailAddress(EmailAddress emailAddress) {
    User result;
    result = readObject(User.class, User.EMAIL_ADDRESS, emailAddress.asString());

    if (result != null) {
      User current = getUserById(result.getId());
      if (current == null) {
        doAddClient(result);
      } else {
        result = current;
      }
    }

    return result;
  }