◆ confirmEmail()
static SignUp org.turro.contacts.zul.register.RegisterControl.confirmEmail |
( |
String |
id | ) |
throws Exception |
|
static |
Definition at line 195 of file RegisterControl.java.
196 if(!Strings.isBlank(
id)) {
197 Dao dao =
new ContactsPU();
198 SignUp su = dao.find(SignUp.class,
id);
201 if(!su.isConfirmed()) {
203 su.setConfirmed(
true);
206 sendWelcomeMailToUser(su);
◆ createContact()
static void org.turro.contacts.zul.register.RegisterControl.createContact |
( |
SignUp |
signUp | ) |
throws Exception |
|
static |
Definition at line 230 of file RegisterControl.java.
231 if(!existEmail(signUp.getEmail())) {
232 Contact contact =
new Contact();
233 contact.setName(signUp.getName());
234 contact.getComplexName().setFull(signUp.getName());
235 contact.setUserMenu(
true);
236 Connector email =
new Connector();
237 email.setContact(contact);
238 email.setDescription(IUser.CONNECTOR_EMAIL);
239 email.setValue(signUp.getEmail());
240 contact.getConnectors().add(email);
242 KeyValueMap kvm = signUp.getValues();
243 for(String key : kvm.keySet()) {
244 if(!Strings.isBlank(key) && !Strings.isBlank(kvm.get(key))) {
245 Connector suv =
new Connector();
246 suv.setContact(contact);
247 suv.setDescription(key);
248 suv.setValue(kvm.get(key));
249 contact.getConnectors().add(suv);
252 }
catch(Exception ex) {}
253 if(!Strings.isBlank(ElephantContext.getSiteSyndicate())) {
254 String groups[] = ElephantContext.getSiteSyndicate().split(
",");
255 SocialGroups.syndicate(List.of(contact), Set.of(groups),
null);
257 new ContactWrapper(contact).save();
◆ doFinally()
void org.turro.contacts.zul.register.RegisterControl.doFinally |
( |
| ) |
|
◆ onRegister()
void org.turro.contacts.zul.register.RegisterControl.onRegister |
( |
Event |
event | ) |
|
Definition at line 106 of file RegisterControl.java.
107 SignUp su =
new SignUp();
108 su.setName(name.getValue());
109 su.setEmail(email.getValue());
110 su.setComment(comment.getValue());
111 su.setValueMap(keepValues());
113 if(existPending(su.getEmail())) {
114 Messages.confirmProcess().add(I_.get(
"Email pending to confirm"))
115 .paragraph().add(I_.get(
"Resend confirmation e-mail")).show(() -> {
118 Clients.showNotification(I_.format(
"Confirmation e-mail has been sent to %s", sue.
getEmail()));
119 }
catch (EmailException ex) {
120 Logger.getLogger(RegisterControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
123 }
else if(existEmail(su.getEmail())) {
124 Clients.showNotification(I_.format(
"%s already exists", su.getEmail()));
125 Application.getApplication().sendRedirect(
"/user?" + Actions.createRightNowAction(
"email=" + su.getEmail()));
127 if(termsrow.isVisible() && accepted !=
null && !accepted.isChecked()) {
128 Clients.showNotification(I_.get(
"Read and accepted") +
"?");
130 su =
new ContactsPU().saveObject(su);
133 Clients.showNotification(I_.format(
"Confirmation e-mail has been sent to %s", su.getEmail()));
134 }
catch (EmailException ex) {
135 Logger.getLogger(RegisterControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
140 Clients.showNotification(
"No valid values");
◆ onTerms()
void org.turro.contacts.zul.register.RegisterControl.onTerms |
( |
Event |
event | ) |
|
Definition at line 95 of file RegisterControl.java.
96 if(termsBox !=
null) {
97 if(accepted.isChecked()) {
98 SelectionDialog.showComponent(getPage(), I_.get(
"Terms of Use"), termsBox,
"70%",
"500px",
null);
◆ writeResultConfirmAction()
static void org.turro.contacts.zul.register.RegisterControl.writeResultConfirmAction |
( |
IConstructor |
constructor, |
|
|
SignUp |
signUp |
|
) |
| throws Exception |
|
static |
Definition at line 215 of file RegisterControl.java.
216 ElephantMarker em =
new ElephantMarker(constructor);
217 if(signUp !=
null && signUp.isConfirmed()) {
218 em.put(
"signUp", signUp);
220 em.put(
"link", ElephantContext.getRootWebPath() +
"?" + Actions.createAction(signUp.getEmail(),
"/user/changepass"));
221 }
catch (Exception ex) {
222 Logger.getLogger(RegisterControl.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
224 em.process(
"signup",
"confirmed");
226 em.process(
"signup",
"failed");
The documentation for this class was generated from the following file: