From d9914c55d10bba067814dba8e5371afd8f16f9f4 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 4 Oct 2006 06:01:51 +0000 Subject: [PATCH] r1232: We should probably be catching register.php errors --- docs/changes.txt | 1 + register.php | 45 ++++++++++++++++++++++----------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 88f61d0..0ce01b4 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -3,6 +3,7 @@ - Registration email functions do not work because they are not ISSO2/Mail compatible [register.php] - Removed TABLE_PREFIX-related SQL errors in syndicate.php - Use the correct language variable key for exporting the XML encoding in syndicate.php +- API-level errors are not caught in the registration process before insertion because of user_cumulative [register.php] 1.1.0 =============================== diff --git a/register.php b/register.php index 5b3da41..b4b0307 100755 --- a/register.php +++ b/register.php @@ -56,35 +56,34 @@ if ($_POST['do'] == 'insert') { $message->add_error(_('The passwords you entered did not match.')); } - - if (!$message->items) + + if ($bugsys->options['verifyemail']) { - $salt = $funct->rand(15); - - if ($bugsys->options['verifyemail']) + $usergroupid = 3; + } + else + { + if ($bugsys->options['moderatenewusers']) { - $usergroupid = 3; + $usergroupid = 4; } else { - if ($bugsys->options['moderatenewusers']) - { - $usergroupid = 4; - } - else - { - $usergroupid = 2; - } + $usergroupid = 2; } - - $user = new UserAPI($bugsys); - $user->set('email', $bugsys->in['email']); - $user->set('displayname', $bugsys->in['displayname']); - $user->set('password', $bugsys->in['password']); - $user->set('showemail', $bugsys->in['showemail']); - $user->set('showcolors', 1); - $user->set('languageid', $bugsys->in['languageid']); - $user->set('usergroupid', $usergroupid); + } + + $user = new UserAPI($bugsys); + $user->set('email', $bugsys->in['email']); + $user->set('displayname', $bugsys->in['displayname']); + $user->set('password', $bugsys->in['password']); + $user->set('showemail', $bugsys->in['showemail']); + $user->set('showcolors', 1); + $user->set('languageid', $bugsys->in['languageid']); + $user->set('usergroupid', $usergroupid); + + if (!$message->items) + { $user->insert(); $userid = $user->insertid; -- 2.43.5