diff options
Diffstat (limited to 'actions/confirmaddress.php')
-rw-r--r-- | actions/confirmaddress.php | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 44280e08a..1d5c53ff2 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -19,9 +19,11 @@ if (!defined('LACONICA')) { exit(1); } -class ConfirmaddressAction extends Action { +class ConfirmaddressAction extends Action +{ - function handle($args) { + function handle($args) + { parent::handle($args); if (!common_logged_in()) { common_set_returnto($this->self_url()); @@ -43,44 +45,44 @@ class ConfirmaddressAction extends Action { $this->client_error(_('That confirmation code is not for you!')); return; } - $type = $confirm->address_type; - if (!in_array($type, array('email', 'jabber', 'sms'))) { - $this->server_error(sprintf(_('Unrecognized address type %s'), $type)); - return; - } + $type = $confirm->address_type; + if (!in_array($type, array('email', 'jabber', 'sms'))) { + $this->server_error(sprintf(_('Unrecognized address type %s'), $type)); + return; + } if ($cur->$type == $confirm->address) { $this->client_error(_('That address has already been confirmed.')); - return; - } + return; + } $cur->query('BEGIN'); $orig_user = clone($cur); - $cur->$type = $confirm->address; + $cur->$type = $confirm->address; - if ($type == 'sms') { - $cur->carrier = ($confirm->address_extra)+0; - $carrier = Sms_carrier::staticGet($cur->carrier); - $cur->smsemail = $carrier->toEmailAddress($cur->sms); - } + if ($type == 'sms') { + $cur->carrier = ($confirm->address_extra)+0; + $carrier = Sms_carrier::staticGet($cur->carrier); + $cur->smsemail = $carrier->toEmailAddress($cur->sms); + } - $result = $cur->updateKeys($orig_user); + $result = $cur->updateKeys($orig_user); if (!$result) { - common_log_db_error($cur, 'UPDATE', __FILE__); + common_log_db_error($cur, 'UPDATE', __FILE__); $this->server_error(_('Couldn\'t update user.')); return; } - if ($type == 'email') { - $cur->emailChanged(); - } + if ($type == 'email') { + $cur->emailChanged(); + } $result = $confirm->delete(); if (!$result) { - common_log_db_error($confirm, 'DELETE', __FILE__); + common_log_db_error($confirm, 'DELETE', __FILE__); $this->server_error(_('Couldn\'t delete email confirmation.')); return; } @@ -88,7 +90,7 @@ class ConfirmaddressAction extends Action { $cur->query('COMMIT'); common_show_header(_('Confirm Address')); - common_element('p', NULL, + common_element('p', null, sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type)); common_show_footer(); } |