Ignore:
Timestamp:
Mar 3, 2011, 10:30:14 PM (13 years ago)
Author:
plg
Message:

optimization: only calculate upload permissions once in a user session

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/community/include/functions_community.inc.php

    r9500 r9501  
    2626  global $conf, $user;
    2727
     28  if (!isset($conf['community_update']))
     29  {
     30    conf_update_param('community_update', time());
     31  }
     32 
     33  if (isset($_SESSION['community_user_permissions']))
     34  {
     35    if ($_SESSION['community_update'] > $conf['community_update'])
     36    {
     37      return $_SESSION['community_user_permissions'];
     38    }
     39  }
     40
    2841  $return = array(
    2942    'upload_whole_gallery' => false,
     
    185198  }
    186199
    187   return $return;
     200  $_SESSION['community_user_permissions'] = $return;
     201  $_SESSION['community_update'] = time();
     202
     203  return $_SESSION['community_user_permissions'];
    188204}
    189205
Note: See TracChangeset for help on using the changeset viewer.