X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fsmssettings.php;h=922bab9a4e3bc2ccec5bd15ad9df102d19e376ff;hb=b4e649fe906a793cd5e62d6390065ea5d41c40db;hp=f89cbe1ab9dda11bec07ced6f3203ed27e28a2a3;hpb=4b9df58c90e25ea79aeec64c6e96f828fe06d7df;p=quix0rs-gnu-social.git diff --git a/actions/smssettings.php b/actions/smssettings.php index f89cbe1ab9..922bab9a4e 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -488,6 +488,58 @@ class SmssettingsAction extends ConnectSettingsAction } common_redirect(common_local_url('confirmaddress', - array('code' => $code))); + array('code' => $code)), + 303); + } + + /** + * Handle a request to remove an incoming email address + * + * @return void + */ + + function removeIncoming() + { + $user = common_current_user(); + + if (!$user->incomingemail) { + $this->showForm(_('No incoming email address.')); + return; + } + + $orig = clone($user); + + $user->incomingemail = null; + + if (!$user->updateKeys($orig)) { + common_log_db_error($user, 'UPDATE', __FILE__); + $this->serverError(_("Couldn't update user record.")); + } + + $this->showForm(_('Incoming email address removed.'), true); + } + + /** + * Generate a new incoming email address + * + * @return void + * + * @see Emailsettings::newIncoming + */ + + function newIncoming() + { + $user = common_current_user(); + + $orig = clone($user); + + $user->incomingemail = mail_new_incoming_address(); + + if (!$user->updateKeys($orig)) { + common_log_db_error($user, 'UPDATE', __FILE__); + $this->serverError(_("Couldn't update user record.")); + } + + $this->showForm(_('New incoming email address added.'), true); } }