From 2829aedbc0bdead9580c0c95589f46c2ce52ef73 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 25 Jan 2007 04:35:49 +0000 Subject: [PATCH] r1381: Merging r1380 from trunk to branch. --- admin/user.php | 15 +++++++++------ docs/changes.txt | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/admin/user.php b/admin/user.php index 99503c6..b5dc89a 100644 --- a/admin/user.php +++ b/admin/user.php @@ -98,15 +98,18 @@ if ($_POST['do'] == 'insert') // post_insert will set the email options... so we now have to dump them $db->query("DELETE FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->insertid); - $bugsys->input_clean('emailopts', TYPE_INT); - foreach ($bugsys->in['emailopts'] AS $relation => $bitarr) + $bugsys->input_clean('emailopts', TYPE_INT); + if (is_array($bugsys->in['emailopts'])) { - $bitmask = 0; - foreach ($bitarr AS $option => $yes) + foreach ($bugsys->in['emailopts'] AS $relation => $bitarr) { - $bitmask += $option * $yes; + $bitmask = 0; + foreach ($bitarr AS $option => $yes) + { + $bitmask += $option * $yes; + } + $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . $user->insertid . ", $relation, $bitmask)"); } - $db->query("INSERT INTO " . TABLE_PREFIX . "useremail (userid, relation, mask) VALUES (" . $user->insertid . ", $relation, $bitmask)"); } $admin->redirect('user.php?do=edit&userid=' . $user->insertid); diff --git a/docs/changes.txt b/docs/changes.txt index 3052876..ef1f6ce 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -5,6 +5,7 @@ - Fixed a SQL error on admin/user.php when adding a new user from the admin section (bug://report/63) - When adding a new user from the admin section, email options were not saved properly - Added an option to only perform header redirects instead of intermediate-stage redirects (bug://report/65) +- Fixed a foreach() error after adding a new user in the admin section without email options [admin/user.php#102] 1.1.4 =============================== -- 2.22.5