Commit a735df3a authored by terry%mozilla.org's avatar terry%mozilla.org

Was crashing when logging profile activity.

parent 98292643
...@@ -659,8 +659,8 @@ if ($action eq 'update') { ...@@ -659,8 +659,8 @@ if ($action eq 'update') {
my $emailnotificationold = trim($::FORM{emailnotificationold} || ''); my $emailnotificationold = trim($::FORM{emailnotificationold} || '');
my $disabledtext = trim($::FORM{disabledtext} || ''); my $disabledtext = trim($::FORM{disabledtext} || '');
my $disabledtextold = trim($::FORM{disabledtextold} || ''); my $disabledtextold = trim($::FORM{disabledtextold} || '');
my $groupsetold = trim($::FORM{groupsetold} || ''); my $groupsetold = trim($::FORM{groupsetold} || '0');
my $blessgroupsetold = trim($::FORM{blessgroupsetold} || ''); my $blessgroupsetold = trim($::FORM{blessgroupsetold} || '0');
my $groupset = "0"; my $groupset = "0";
foreach (keys %::FORM) { foreach (keys %::FORM) {
...@@ -681,6 +681,9 @@ if ($action eq 'update') { ...@@ -681,6 +681,9 @@ if ($action eq 'update') {
# them, be sure to test for WHERE='$product' or WHERE='$productold' # them, be sure to test for WHERE='$product' or WHERE='$productold'
if ($groupset ne $groupsetold) { if ($groupset ne $groupsetold) {
SendSQL("SELECT groupset FROM profiles WHERE login_name=" .
SqlQuote($userold));
$groupsetold = FetchOneColumn();
SendSQL("UPDATE profiles SendSQL("UPDATE profiles
SET groupset = SET groupset =
groupset - (groupset & $opblessgroupset) + $groupset groupset - (groupset & $opblessgroupset) + $groupset
...@@ -696,7 +699,7 @@ if ($action eq 'update') { ...@@ -696,7 +699,7 @@ if ($action eq 'update') {
($u, $groupset) = (FetchSQLData()); ($u, $groupset) = (FetchSQLData());
if ($groupset ne $groupsetold) { if ($groupset ne $groupsetold) {
SendSQL("INSERT INTO profiles_activity " . SendSQL("INSERT INTO profiles_activity " .
"(userid,who,profiles_when,fieldid,oldvalue,newvalue)" . "(userid,who,profiles_when,fieldid,oldvalue,newvalue) " .
"VALUES " . "VALUES " .
"($u, $::userid, now(), $fieldid, " . "($u, $::userid, now(), $fieldid, " .
" $groupsetold, $groupset)"); " $groupsetold, $groupset)");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment