Cookie management

This commit is contained in:
quenenni 2013-04-04 20:56:19 +02:00
parent 0bccbc5ce1
commit fddc835f82

View file

@ -64,6 +64,9 @@ exports.handleClientMessage_emailSubscriptionSuccess = function(hook, context){
} else { } else {
showRegistrationSuccess(); showRegistrationSuccess();
// Add cookie to say an email is registered for this pad
cookie.setPref(pad.getPadId() + "email", "true");
if (clientVars.panelDisplayLocation.mysettings == true && $('.ep_email_settings').is(":visible")) { if (clientVars.panelDisplayLocation.mysettings == true && $('.ep_email_settings').is(":visible")) {
$('.ep_email_settings').slideToggle(); $('.ep_email_settings').slideToggle();
$('#options-emailNotifications').prop('checked', false); $('#options-emailNotifications').prop('checked', false);
@ -82,6 +85,9 @@ exports.handleClientMessage_emailUnsubscriptionSuccess = function(hook, context)
} else { } else {
showUnregistrationSuccess(); showUnregistrationSuccess();
// Set cookie to say no email is registered for this pad
cookie.setPref(pad.getPadId() + "email", "false");
if (clientVars.panelDisplayLocation.mysettings == true && $('.ep_email_settings').is(":visible")) { if (clientVars.panelDisplayLocation.mysettings == true && $('.ep_email_settings').is(":visible")) {
$('.ep_email_settings').slideToggle(); $('.ep_email_settings').slideToggle();
$('#options-emailNotifications').prop('checked', false); $('#options-emailNotifications').prop('checked', false);
@ -239,7 +245,6 @@ function sendEmailToServer(formName){
message.userInfo.userId = userId; message.userInfo.userId = userId;
if(email){ if(email){
pad.collabClient.sendMessage(message); pad.collabClient.sendMessage(message);
cookie.setPref(message.padId+"email", "true");
} }
} }