summaryrefslogtreecommitdiff
path: root/actions/confirmaddress.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-01-18 18:41:41 +0000
committerEvan Prodromou <evan@controlyourself.ca>2009-01-18 18:41:41 +0000
commitf2b06b8bbd56ce94d7b46ffcec36e2be3f260fe9 (patch)
tree59f9d95f1186f35fc15393eec88c8a76ee5cf35b /actions/confirmaddress.php
parentc0f23a2703edbc64486a00ea72b87f5be62cc445 (diff)
update commitaddress
Diffstat (limited to 'actions/confirmaddress.php')
-rw-r--r--actions/confirmaddress.php86
1 files changed, 76 insertions, 10 deletions
diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php
index 3d1a3c275..725c1f1e3 100644
--- a/actions/confirmaddress.php
+++ b/actions/confirmaddress.php
@@ -1,9 +1,12 @@
<?php
-/*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+/**
+ * Laconica, the distributed open-source microblogging tool
*
- * This program is free software: you can redistribute it and/or modify
+ * Confirm an address
+ *
+ * PHP version 5
+ *
+ * LICENCE: This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@@ -15,12 +18,49 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @category Confirm
+ * @package Laconica
+ * @author Evan Prodromou <evan@controlyourself.ca>
+ * @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 <evan@controlyourself.ca>
+ * @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));
}
}