*/
function showContent()
{
- $user = common_current_user();
+ $user = $this->scoped->getUser();
$this->elementStart('form', array('method' => 'post',
'id' => 'form_settings_email',
*/
function savePreferences()
{
- $user = common_current_user();
+ $user = $this->scoped->getUser();
if (Event::handle('StartEmailSaveForm', array($this, $this->scoped))) {
- $emailnotifysub = $this->boolean('emailnotifysub');
- $emailnotifymsg = $this->boolean('emailnotifymsg');
- $emailnotifynudge = $this->boolean('emailnotifynudge');
- $emailnotifyattn = $this->boolean('emailnotifyattn');
- $emailmicroid = $this->boolean('emailmicroid');
- $emailpost = $this->boolean('emailpost');
-
- assert(!is_null($user)); // should already be checked
+ $emailnotifysub = $this->booleanintstring('emailnotifysub');
+ $emailnotifymsg = $this->booleanintstring('emailnotifymsg');
+ $emailnotifynudge = $this->booleanintstring('emailnotifynudge');
+ $emailnotifyattn = $this->booleanintstring('emailnotifyattn');
+ $emailmicroid = $this->booleanintstring('emailmicroid');
+ $emailpost = $this->booleanintstring('emailpost');
$user->query('BEGIN');
if ($result === false) {
common_log_db_error($user, 'UPDATE', __FILE__);
+ $user->query('ROLLBACK');
// TRANS: Server error thrown on database error updating e-mail preferences.
$this->serverError(_('Could not update user.'));
}