Changeset 1617 for trunk/comments.php


Ignore:
Timestamp:
Nov 22, 2006, 5:41:25 AM (17 years ago)
Author:
rvelices
Message:

feature 440: send mail to admin when comment is entered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/comments.php

    r1598 r1617  
    156156// |                         comments management                           |
    157157// +-----------------------------------------------------------------------+
    158 if (is_admin() and !is_adviser() )
    159 {
    160   if (isset($_GET['delete']) and is_numeric($_GET['delete']) )
    161   {// comments deletion
    162     $query = '
     158if (isset($_GET['delete']) and is_numeric($_GET['delete'])
     159      and !is_adviser() )
     160{// comments deletion
     161  check_status(ACCESS_ADMINISTRATOR);
     162  $query = '
    163163DELETE FROM '.COMMENTS_TABLE.'
    164164  WHERE id='.$_GET['delete'].'
    165165;';
    166     pwg_query($query);
    167   }
    168 
    169   if (isset($_GET['validate']) and is_numeric($_GET['validate']) )
    170   {  // comments validation
    171     $query = '
     166  pwg_query($query);
     167}
     168
     169if (isset($_GET['validate']) and is_numeric($_GET['validate'])
     170      and !is_adviser() )
     171{  // comments validation
     172  check_status(ACCESS_ADMINISTRATOR);
     173  $query = '
    172174UPDATE '.COMMENTS_TABLE.'
    173175  SET validated = \'true\'
    174     , validation_date = NOW()
     176  , validation_date = NOW()
    175177  WHERE id='.$_GET['validate'].'
    176178;';
    177     pwg_query($query);
    178   }
    179 }
     179  pwg_query($query);
     180}
     181
    180182// +-----------------------------------------------------------------------+
    181183// |                       page header and options                         |
Note: See TracChangeset for help on using the changeset viewer.