Changeset 9447


Ignore:
Timestamp:
Mar 1, 2011, 12:02:26 PM (9 years ago)
Author:
plg
Message:

admins have no community permissions but full rights, no need to check for moderation, ths SQL query was crashing Piwigo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/add_photos.php

    r9372 r9447  
    108108  // events/parties/happyNewYear2011
    109109  $moderate = true;
    110  
    111   $query = '
     110  if (is_admin())
     111  {
     112    $moderate = false;
     113  }
     114  else
     115  { 
     116    $query = '
    112117SELECT
    113118    cp.category_id,
     
    118123    AND cp.moderated = \'false\'
    119124;';
    120   $result = pwg_query($query);
    121   while ($row = pwg_db_fetch_assoc($result))
    122   {
    123     if (empty($row['category_id']))
    124     {
    125       $moderate = false;
    126     }
    127     elseif (preg_match('/^'.$row['uppercats'].'(,|$)/', $category_infos['uppercats']))
    128     {
    129       $moderate = false;
    130     }
    131   }
    132 
     125    $result = pwg_query($query);
     126    while ($row = pwg_db_fetch_assoc($result))
     127    {
     128      if (empty($row['category_id']))
     129      {
     130        $moderate = false;
     131      }
     132      elseif (preg_match('/^'.$row['uppercats'].'(,|$)/', $category_infos['uppercats']))
     133      {
     134        $moderate = false;
     135      }
     136    }
     137  }
     138 
    133139  if ($moderate)
    134140  {
Note: See TracChangeset for help on using the changeset viewer.