$user->set('defaultsortas', $bugsys->in['defaultsortas']);
$user->insert();
- $bugsys->input_clean('emailopts', TYPE_INT);
+ // 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)
{
$bitmask = 0;
$admin->table_start(false);
$admin->table_head(_('Email Options'), 6);
- $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->objdata['userid']);
- while ($opt = $db->fetch_array($options))
+ if ($user->objdata['userid'])
{
- foreach ($bugsys->emailoptions['notifications'] AS $name => $notif)
+ $options = $db->query("SELECT * FROM " . TABLE_PREFIX . "useremail WHERE userid = " . $user->objdata['userid']);
+ while ($opt = $db->fetch_array($options))
{
- foreach ($bugsys->emailoptions['relations'] AS $name => $relation)
+ foreach ($bugsys->emailoptions['notifications'] AS $name => $notif)
{
- if ($opt['mask'] & $notif AND $opt['relation'] == $relation)
+ foreach ($bugsys->emailoptions['relations'] AS $name => $relation)
{
- $checked["$relation"]["$notif"] = HTML_CHECKED;
+ if ($opt['mask'] & $notif AND $opt['relation'] == $relation)
+ {
+ $checked["$relation"]["$notif"] = HTML_CHECKED;
+ }
}
}
}
===============================
- Fixed a potential SQL error on search.php because no results were found (bug://report/62)
+- 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
1.1.4
===============================