Changeset 29060


Ignore:
Timestamp:
Jul 20, 2014, 11:32:56 PM (10 years ago)
Author:
rvelices
Message:

bug 3100 display IP address of comment author on admin page and also save the entire ip address in the database, not only the first three ip components

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/comments.php

    r29008 r29060  
    168168    i.path,
    169169    i.representative_ext,
    170     validated
     170    validated,
     171    c.anonymous_id
    171172  FROM '.COMMENTS_TABLE.' AS c
    172173    INNER JOIN '.IMAGES_TABLE.' AS i
     
    205206      'CONTENT' => trigger_change('render_comment_content',$row['content']),
    206207      'IS_PENDING' => ('false' == $row['validated']),
     208      'IP' => $row['anonymous_id'],
    207209      )
    208210    );
  • trunk/admin/themes/default/template/comments.tpl

    r25744 r29060  
    6666  <div class="comment">
    6767    <a class="illustration" href="{$comment.U_PICTURE}"><img src="{$comment.TN_SRC}"></a>
    68     <p class="commentHeader">{if $comment.IS_PENDING}<span class="pendingFlag">{'Waiting'|@translate}</span> - {/if}<strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
     68    <p class="commentHeader">{if $comment.IS_PENDING}<span class="pendingFlag">{'Waiting'|@translate}</span> - {/if}{if !empty($comment.IP)}{$comment.IP} - {/if}<strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
    6969    <blockquote>{$comment.CONTENT}</blockquote>
    7070  </div>
  • trunk/include/functions_comment.inc.php

    r28893 r29060  
    174174      $comm['email'] = $user['email'];
    175175    }
    176     else if ($conf['comments_email_mandatory'])
     176    elseif ($conf['comments_email_mandatory'])
    177177    {
    178178      $infos[] = l10n('Email address is missing. Please specify an email address.');
     
    180180    }
    181181  }
    182   else if (!email_check_format($comm['email']))
     182  elseif (!email_check_format($comm['email']))
    183183  {
    184184    $infos[] = l10n('mail address must be like xxx@yyy.eee (example : jack@altern.org)');
     
    192192    array_pop($ip_components);
    193193  }
    194   $comm['anonymous_id'] = implode('.', $ip_components);
     194  $anonymous_id = implode('.', $ip_components);
    195195
    196196  if ($comment_action!='reject' and $conf['anti-flood_time']>0 and !is_admin())
     
    205205    {
    206206      $query.= '
    207       AND anonymous_id = "'.$comm['anonymous_id'].'"';
     207      AND anonymous_id LIKE "'.$anonymous_id.'.%"';
    208208    }
    209209    $query.= '
     
    232232    \''.$comm['author'].'\',
    233233    '.$comm['author_id'].',
    234     \''.$comm['anonymous_id'].'\',
     234    \''.$comm['ip'].'\',
    235235    \''.$comm['content'].'\',
    236236    NOW(),
Note: See TracChangeset for help on using the changeset viewer.