Changeset 1616


Ignore:
Timestamp:
Nov 22, 2006, 3:57:41 AM (17 years ago)
Author:
rvelices
Message:
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/action.php

    r1612 r1616  
    8383}
    8484
    85 // TODO - check permissions
     85$query='
     86SELECT id FROM '.CATEGORIES_TABLE.'
     87  INNER JOIN '.IMAGE_CATEGORY_TABLE.'
     88  ON category_id=id
     89  WHERE image_id='.$id.'
     90  AND category_id NOT IN ('.$user['forbidden_categories'].')
     91  LIMIT 1
     92;';
     93if ( mysql_num_rows(pwg_query($query))<1 )
     94{
     95  do_error(401, 'Access denied');
     96}
    8697
    8798include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
     
    99110    break;
    100111  case 'h':
     112    if ( $user['enabled_high']!='true' )
     113    {
     114      do_error(401, 'Access denied h');
     115    }
    101116    $file = get_high_path($element_info);
    102117    break;
     
    122137    $ctype = mime_content_type($file);
    123138  }
     139
     140  $gmt_mtime = gmdate('D, d M Y H:i:s', filemtime($file)).' GMT';
     141  $http_headers[] = 'Last-Modified: '.$gmt_mtime;
     142
     143  // following lines would indicate how the client should handle the cache
     144  /* $max_age=300;
     145  $http_headers[] = 'Expires: '.gmdate('D, d M Y H:i:s', time()+$max_age).' GMT';
     146  // HTTP/1.1 only
     147  $http_headers[] = 'Cache-Control: private, must-revalidate, max-age='.$max_age;*/
     148
     149  if ( isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
     150  {
     151    header("HTTP/1.1 304 Not modified ");
     152    header("Status: 304 Not modified");
     153    foreach ($http_headers as $header)
     154    {
     155      header( $header );
     156    }
     157    exit();
     158  }
    124159}
     160
    125161if (!isset($ctype))
    126162{ // give it a guess
     
    136172  $http_headers[] = 'Content-Transfer-Encoding: binary';
    137173}
    138 $http_headers[] = 'Pragma: public';
    139 $http_headers[] = 'Expires: 0';
    140 $http_headers[] = 'Cache-Control: must-revalidate, post-check=0, pre-check=0';
    141 
     174else
     175{
     176  $http_headers[] = 'Content-Disposition: inline; filename="'
     177            .basename($file).'";';
     178}
    142179
    143180foreach ($http_headers as $header)
     
    145182  header( $header );
    146183}
    147 header("Cache-Control: private",false); //???
    148184
    149185// Looking at the safe_mode configuration for execution time
  • trunk/include/config_default.inc.php

    r1610 r1616  
    533533//$conf['default_admin_layout']='yoga/dark';
    534534
    535 
    536 $conf['disable_plugins']=false;
     535// should we load the active plugins ? true=Yes, false=No
     536$conf['enable_plugins']=true;
    537537?>
  • trunk/include/functions_plugins.inc.php

    r1604 r1616  
    244244{
    245245  global $conf;
    246   if ($conf['disable_plugins'])
    247   {
    248     return;
    249   }
    250 
    251   $plugins = get_db_plugins('active');
    252   foreach( $plugins as $plugin)
    253   {// include main from a function to avoid using same function context
    254     load_plugin($plugin);
    255   }
    256   trigger_action('plugins_loaded');
     246  if ($conf['enable_plugins'])
     247  {
     248    $plugins = get_db_plugins('active');
     249    foreach( $plugins as $plugin)
     250    {// include main from a function to avoid using same function context
     251      load_plugin($plugin);
     252    }
     253    trigger_action('plugins_loaded');
     254  }
    257255}
    258256?>
Note: See TracChangeset for help on using the changeset viewer.