More fixes
[clearscm.git] / maps / lib / MAPS.pm
index 618fb67..3e0b066 100644 (file)
@@ -403,6 +403,8 @@ sub CheckEmail(;$$) {
   if ($username) {
     if ($username =~ /(.*)\@(.*)/) {
       return lc "$1\@$2";
+    } else {
+      return lc "$username\@";
     } # if
   } elsif ($domain) {
     if ($domain =~ /(.*)\@(.*)/) {
@@ -458,7 +460,9 @@ sub CheckOnList ($$;$) {
                    ? "$email_on_file\@"
                    : $email_on_file;
     if ($sender and $sender =~ /$search_for/i) {
-      $rule   = "Matching rule: ($listtype:$rec->{sequence}) \"$email_on_file\"";
+      my $comment = $rec->{comment} ? " - $rec->{comment}" : '';
+
+      $rule   = "Matching rule: ($listtype:$rec->{sequence}) \"$email_on_file$comment\"";
       $rule  .= " - $rec->{comment}" if $rec->{comment};
       $status = 1;
 
@@ -625,7 +629,7 @@ sub CountLog(%) {
   my $condition  = "userid='$userid'";
      $condition .= " and $additional_condition" if $additional_condition;
 
-  return $db->count_distinct('log', 'sender', $condition);
+  return $db->count('log', $condition);
 } # CountLog
 
 sub Decrypt ($$) {