summaryrefslogtreecommitdiff
path: root/actions/smssettings.php
diff options
context:
space:
mode:
authorSean Murphy <sgmurphy@gmail.com>2009-02-07 11:02:10 -0500
committerSean Murphy <sgmurphy@gmail.com>2009-02-07 11:02:10 -0500
commita3d5e00f64b3c166e34a8d36fcb4f5b757394e9b (patch)
tree91576e428997bc6cc826fa2cead37794961de23c /actions/smssettings.php
parentd90089314944ed1696f66cabbb6935ea61e4b2e6 (diff)
parent08db50b24eaf9e6e5f651448c394f1f50dd2409b (diff)
Merge commit 'upstream/0.7.x' into 0.7.x
Conflicts: actions/showstream.php
Diffstat (limited to 'actions/smssettings.php')
-rw-r--r--actions/smssettings.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/actions/smssettings.php b/actions/smssettings.php
index f89cbe1ab..a5f75d266 100644
--- a/actions/smssettings.php
+++ b/actions/smssettings.php
@@ -490,4 +490,55 @@ class SmssettingsAction extends ConnectSettingsAction
common_redirect(common_local_url('confirmaddress',
array('code' => $code)));
}
+
+ /**
+ * 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);
+ }
}