Ignore:
Timestamp:
Dec 18, 2009, 10:12:41 PM (14 years ago)
Author:
rvelices
Message:

merge -r4512 from branch 2.0 to trunk
web method images.setPrivacyLevel (ws_images_setPrivacyLevel) is POST only

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions.inc.php

    r4511 r4513  
    856856    return new PwgError(401, 'Access denied');
    857857  }
     858  if (!$service->isPost())
     859  {
     860    return new PwgError(405, "This method requires HTTP POST");
     861  }
    858862  $params['image_id'] = array_map( 'intval',$params['image_id'] );
    859863  if ( empty($params['image_id']) )
     
    866870    return new PwgError(WS_ERR_INVALID_PARAM, "Invalid level");
    867871  }
     872
    868873  $query = '
    869874UPDATE '.IMAGES_TABLE.'
     
    951956  {
    952957    unlink($output_filepath);
    953    
     958
    954959    if (is_file($output_filepath))
    955960    {
     
    958963    }
    959964  }
    960  
     965
    961966  $upload_dir = PHPWG_ROOT_PATH.'upload/buffer';
    962967  $pattern = '/'.$original_sum.'-'.$type.'/';
     
    983988
    984989  $i = 0;
    985  
     990
    986991  foreach ($chunks as $chunk)
    987992  {
     
    10151020
    10161021  $upload_dir = dirname($file_path);
    1017  
     1022
    10181023  if (!is_dir($upload_dir)) {
    10191024    umask(0000);
     
    11021107  //
    11031108  $update = array();
    1104  
     1109
    11051110  if ('high' == $params['type'])
    11061111  {
     
    11211126  {
    11221127    $update['id'] = $params['image_id'];
    1123    
     1128
    11241129    include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    11251130    mass_updates(
     
    18401845    exit();
    18411846  }
    1842  
     1847
    18431848  $query = '
    18441849SELECT
     
    18581863    exit();
    18591864  }
    1860  
     1865
    18611866  $to_update_cat_ids = array();
    1862    
     1867
    18631868  // in case of replace mode, we first check the existing associations
    18641869  $query = '
     
    18851890    }
    18861891  }
    1887  
     1892
    18881893  $new_cat_ids = array_diff($cat_ids, $existing_cat_ids);
    18891894  if (count($new_cat_ids) == 0)
     
    18911896    return true;
    18921897  }
    1893    
     1898
    18941899  if ($search_current_ranks)
    18951900  {
     
    19151920        $current_rank_of[$cat_id] = 0;
    19161921      }
    1917      
     1922
    19181923      if ('auto' == $rank_on_category[$cat_id])
    19191924      {
     
    19221927    }
    19231928  }
    1924  
     1929
    19251930  $inserts = array();
    1926  
     1931
    19271932  foreach ($new_cat_ids as $cat_id)
    19281933  {
     
    19361941      );
    19371942  }
    1938  
     1943
    19391944  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    19401945  mass_inserts(
     
    19431948    $inserts
    19441949    );
    1945  
     1950
    19461951  update_category($new_cat_ids);
    19471952}
Note: See TracChangeset for help on using the changeset viewer.