if (hash == null) {
// No hash
Long default_lang_id = Long.valueOf(
getConfigurationmanagement().getConfKey(3,
"default_lang_id").getConf_value()).longValue();
Fieldlanguagesvalues labelid669 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(669), default_lang_id);
Fieldlanguagesvalues labelid672 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(672), default_lang_id);
ctx.put("message", labelid669.getValue());
ctx.put("link",
"<a href='" + loginURL + "'>" + labelid672.getValue()
+ "</a>");
return getVelocityView().getVelocityEngine().getTemplate(
"activation_template.vm");
}
//
Users user = getUsermanagement().getUserByActivationHash(hash);
if (user == null) {
// No User Found with this Hash
Long default_lang_id = Long.valueOf(
getConfigurationmanagement().getConfKey(3,
"default_lang_id").getConf_value()).longValue();
Fieldlanguagesvalues labelid669 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(669), default_lang_id);
Fieldlanguagesvalues labelid672 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(672), default_lang_id);
ctx.put("message", labelid669.getValue());
ctx.put("link",
"<a href='" + loginURL + "'>" + labelid672.getValue()
+ "</a>");
return getVelocityView().getVelocityEngine().getTemplate(
"activation_template.vm");
} else if (user.getStatus() == 1) {
// already activated
Long default_lang_id = Long.valueOf(
getConfigurationmanagement().getConfKey(3,
"default_lang_id").getConf_value()).longValue();
Fieldlanguagesvalues labelid670 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(670), default_lang_id);
Fieldlanguagesvalues labelid672 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(672), default_lang_id);
ctx.put("message", labelid670.getValue());
ctx.put("link",
"<a href='" + loginURL + "'>" + labelid672.getValue()
+ "</a>");
return getVelocityView().getVelocityEngine().getTemplate(
"activation_template.vm");
} else if (user.getStatus() == 0) {
// activate
user.setStatus(1);
user.setUpdatetime(new Date());
getUsermanagement().updateUser(user);
Long default_lang_id = Long.valueOf(
getConfigurationmanagement().getConfKey(3,
"default_lang_id").getConf_value()).longValue();
Fieldlanguagesvalues labelid671 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(671), default_lang_id);
Fieldlanguagesvalues labelid672 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(672), default_lang_id);
ctx.put("message", labelid671.getValue());
ctx.put("link",
"<a href='" + loginURL + "'>" + labelid672.getValue()
+ "</a>");
return getVelocityView().getVelocityEngine().getTemplate(
"activation_template.vm");
} else {
// unkown Status
Long default_lang_id = Long.valueOf(
getConfigurationmanagement().getConfKey(3,
"default_lang_id").getConf_value()).longValue();
Fieldlanguagesvalues labelid672 = getFieldmanagment()
.getFieldByIdAndLanguage(new Long(672), default_lang_id);
ctx.put("message", "Unkown Status");
ctx.put("link",
"<a href='" + loginURL + "'>" + labelid672.getValue()
+ "</a>");
return getVelocityView().getVelocityEngine().getTemplate(
"activation_template.vm");
}