Merge branch '0.9.x' into emailsummary

This commit is contained in:
Evan Prodromou 2010-11-09 15:01:07 -05:00
commit 41a0f18301
3 changed files with 117 additions and 82 deletions

View File

@ -302,6 +302,20 @@ StartProfileSaveForm: before starting to save a profile settings form
EndProfileSaveForm: after saving a profile settings form (after commit, no profile or user object!) EndProfileSaveForm: after saving a profile settings form (after commit, no profile or user object!)
- $action: action object being shown - $action: action object being shown
StartEmailFormData: just before showing text entry fields on email settings page
- $action: action object being shown
EndEmailFormData: just after showing text entry fields on email settings page
- $action: action object being shown
StartEmailSaveForm: before starting to save a email settings form
- $action: action object being shown
- &$user: user being saved
EndEmailSaveForm: after saving a email settings form (after commit)
- $action: action object being shown
- &$user: user being saved
StartRegistrationFormData: just before showing text entry fields on registration page StartRegistrationFormData: just before showing text entry fields on registration page
- $action: action object being shown - $action: action object being shown

View File

@ -178,6 +178,8 @@ class EmailsettingsAction extends AccountSettingsAction
$this->element('legend', null, _('Email preferences')); $this->element('legend', null, _('Email preferences'));
$this->elementStart('ul', 'form_data'); $this->elementStart('ul', 'form_data');
if (Event::handle('StartEmailFormData', array($this))) {
$this->elementStart('li'); $this->elementStart('li');
$this->checkbox('emailnotifysub', $this->checkbox('emailnotifysub',
// TRANS: Checkbox label in e-mail preferences form. // TRANS: Checkbox label in e-mail preferences form.
@ -223,6 +225,8 @@ class EmailsettingsAction extends AccountSettingsAction
_('Publish a MicroID for my email address.'), _('Publish a MicroID for my email address.'),
$user->emailmicroid); $user->emailmicroid);
$this->elementEnd('li'); $this->elementEnd('li');
Event::handle('EndEmailFormData', array($this));
}
$this->elementEnd('ul'); $this->elementEnd('ul');
// TRANS: Button label to save e-mail preferences. // TRANS: Button label to save e-mail preferences.
$this->submit('save', _m('BUTTON','Save')); $this->submit('save', _m('BUTTON','Save'));
@ -299,6 +303,10 @@ class EmailsettingsAction extends AccountSettingsAction
function savePreferences() function savePreferences()
{ {
$user = common_current_user();
if (Event::handle('StartEmailSaveForm', array($this, &$user))) {
$emailnotifysub = $this->boolean('emailnotifysub'); $emailnotifysub = $this->boolean('emailnotifysub');
$emailnotifyfav = $this->boolean('emailnotifyfav'); $emailnotifyfav = $this->boolean('emailnotifyfav');
$emailnotifymsg = $this->boolean('emailnotifymsg'); $emailnotifymsg = $this->boolean('emailnotifymsg');
@ -307,8 +315,6 @@ class EmailsettingsAction extends AccountSettingsAction
$emailmicroid = $this->boolean('emailmicroid'); $emailmicroid = $this->boolean('emailmicroid');
$emailpost = $this->boolean('emailpost'); $emailpost = $this->boolean('emailpost');
$user = common_current_user();
assert(!is_null($user)); // should already be checked assert(!is_null($user)); // should already be checked
$user->query('BEGIN'); $user->query('BEGIN');
@ -334,9 +340,12 @@ class EmailsettingsAction extends AccountSettingsAction
$user->query('COMMIT'); $user->query('COMMIT');
Event::handle('EndEmailSaveForm', array($this));
// TRANS: Confirmation message for successful e-mail preferences save. // TRANS: Confirmation message for successful e-mail preferences save.
$this->showForm(_('Email preferences saved.'), true); $this->showForm(_('Email preferences saved.'), true);
} }
}
/** /**
* Add the address passed in by the user * Add the address passed in by the user

View File

@ -107,3 +107,15 @@ create table group_alias (
index group_alias_group_id_idx (group_id) index group_alias_group_id_idx (group_id)
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin; ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
create table session (
id varchar(32) primary key comment 'session ID',
session_data text comment 'session data',
created datetime not null comment 'date this record was created',
modified timestamp comment 'date this record was modified',
index session_modified_idx (modified)
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;