- common_redirect(common_local_url('confirmaddress',
- array('code' => $code)));
+ $orig = clone($user);
+
+ $user->incomingemail = null;
+
+ // Throws exception on failure. Also performs it within a transaction.
+ $user->updateWithKeys($orig);
+
+ // TRANS: Confirmation text after updating SMS settings.
+ return _('Incoming email address removed.');
+ }
+
+ /**
+ * Generate a new incoming email address
+ *
+ * @return void
+ *
+ * @see Emailsettings::newIncoming
+ */
+ function newIncoming()
+ {
+ $user = $this->scoped->getUser();
+
+ $orig = clone($user);
+
+ $user->incomingemail = mail_new_incoming_address();
+
+ // Throws exception on failure. Also performs it within a transaction.
+ $user->updateWithKeys($orig);
+
+ // TRANS: Confirmation text after updating SMS settings.
+ return _('New incoming email address added.');