]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/smssettings.php
Added filler text to popular page for when it's empty, encouraging user to add favori...
[quix0rs-gnu-social.git] / actions / smssettings.php
index 489fd1f587f21028789c143b4bc82d3715c5ef10..922bab9a4e3bc2ccec5bd15ad9df102d19e376ff 100644 (file)
@@ -113,7 +113,7 @@ class SmssettingsAction extends ConnectSettingsAction
                 $this->hidden('carrier', $confirm->address_extra);
                 $this->submit('cancel', _('Cancel'));
 
-                $this->elementStart('ul', 'form_datas');
+                $this->elementStart('ul', 'form_data');
                 $this->elementStart('li');
                 $this->input('code', _('Confirmation code'), null,
                              _('Enter the code you received on your phone.'));
@@ -121,7 +121,7 @@ class SmssettingsAction extends ConnectSettingsAction
                 $this->elementEnd('ul');
                 $this->submit('confirm', _('Confirm'));
             } else {
-                $this->elementStart('ul', 'form_datas');
+                $this->elementStart('ul', 'form_data');
                 $this->elementStart('li');
                 $this->input('sms', _('SMS Phone number'),
                              ($this->arg('sms')) ? $this->arg('sms') : null,
@@ -156,7 +156,7 @@ class SmssettingsAction extends ConnectSettingsAction
         $this->elementStart('fieldset', array('id' => 'settings_sms_preferences'));
         $this->element('legend', null, _('Preferences'));
 
-        $this->elementStart('ul', 'form_datas');
+        $this->elementStart('ul', 'form_data');
         $this->elementStart('li');
         $this->checkbox('smsnotify',
                         _('Send me notices through SMS; '.
@@ -448,7 +448,7 @@ class SmssettingsAction extends ConnectSettingsAction
 
         $cnt = $carrier->find();
 
-        $this->elementStart('ul', 'form_datas');
+        $this->elementStart('ul', 'form_data');
         $this->elementStart('li');
         $this->element('label', array('for' => 'carrier'), _('Mobile carrier'));
         $this->elementStart('select', array('name' => 'carrier',
@@ -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);
     }
 }