From f2b06b8bbd56ce94d7b46ffcec36e2be3f260fe9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 18 Jan 2009 18:41:41 +0000 Subject: [PATCH] update commitaddress --- actions/confirmaddress.php | 86 +++++++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 10 deletions(-) diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 3d1a3c275d..725c1f1e3b 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -1,9 +1,12 @@ . + * + * @category Confirm + * @package Laconica + * @author Evan Prodromou + * @copyright 2008-2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Confirm an address + * + * When users change their SMS, email, Jabber, or other addresses, we send out + * a confirmation code to make sure the owner of that address approves. This class + * accepts those codes. + * + * @category Confirm + * @package Laconica + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ class ConfirmaddressAction extends Action { + /** type of confirmation. */ + + var $type = null; + + /** + * Accept a confirmation code + * + * Checks the code and confirms the address in the + * user record + * + * @param args $args $_REQUEST array + * + * @return void + */ function handle($args) { @@ -62,8 +102,8 @@ class ConfirmaddressAction extends Action $cur->$type = $confirm->address; if ($type == 'sms') { - $cur->carrier = ($confirm->address_extra)+0; - $carrier = Sms_carrier::staticGet($cur->carrier); + $cur->carrier = ($confirm->address_extra)+0; + $carrier = Sms_carrier::staticGet($cur->carrier); $cur->smsemail = $carrier->toEmailAddress($cur->sms); } @@ -89,9 +129,35 @@ class ConfirmaddressAction extends Action $cur->query('COMMIT'); - common_show_header(_('Confirm Address')); + $this->type = $type; + $this->showPage(); + } + + /** + * Title of the page + * + * @return string title + */ + + function title() + { + return _('Confirm Address'); + } + + /** + * Show a confirmation message. + * + * @return void + */ + + function showContent() + { + $cur = common_current_user(); + $type = $this->type; + $this->element('p', null, - sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type)); - common_show_footer(); + sprintf(_('The address "%s" has been '. + 'confirmed for your account.'), + $cur->$type)); } }