summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/confirmemail.php12
-rw-r--r--actions/register.php8
2 files changed, 16 insertions, 4 deletions
diff --git a/actions/confirmemail.php b/actions/confirmemail.php
index 8052452ae..e69cc6fff 100644
--- a/actions/confirmemail.php
+++ b/actions/confirmemail.php
@@ -47,21 +47,27 @@ class ConfirmemailAction extends Action {
$this->client_error(_t('That email address is already confirmed.'));
return;
}
+
$cur->query('BEGIN');
+
$orig_user = clone($cur);
$cur->email = $confirm_email->email;
- common_debug('cur email = "' . $cur->email . '"', __FILE__);
$result = $cur->update($orig_user);
+
if (!$result) {
- $this->server_error(_t('Error setting email address.'));
+ common_log_db_error($cur, 'UPDATE', __FILE__);
return;
}
+
$result = $confirm_email->delete();
+
if (!$result) {
- $this->server_error(_t('Error deleting code.'));
+ common_log_db_error($confirm_email, 'DELETE', __FILE__);
return;
}
+
$cur->query('COMMIT');
+
common_show_header(_t('Confirm E-mail Address'));
common_element('p', NULL,
_t('The email address "') . $cur->email .
diff --git a/actions/register.php b/actions/register.php
index 3ed892e7f..2bb4f12f0 100644
--- a/actions/register.php
+++ b/actions/register.php
@@ -99,8 +99,10 @@ class RegisterAction extends Action {
$profile->created = DB_DataObject_Cast::dateTime(); # current time
$id = $profile->insert();
+
if (!$id) {
- return FALSE;
+ common_log_db_error($profile, 'INSERT', __FILE__);
+ return FALSE;
}
$user = new User();
$user->id = $id;
@@ -110,11 +112,14 @@ class RegisterAction extends Action {
$user->uri = common_user_uri($user);
$result = $user->insert();
+
if (!$result) {
+ common_log_db_error($user, 'INSERT', __FILE__);
return FALSE;
}
if ($email) {
+
$confirm = new Confirm_email();
$confirm->code = common_good_rand(16);
$confirm->user_id = $user->id;
@@ -122,6 +127,7 @@ class RegisterAction extends Action {
$result = $confirm->insert();
if (!$result) {
+ common_log_db_error($confirm, 'INSERT', __FILE__);
return FALSE;
}
}