Changeset 4513 for trunk/include/ws_functions.inc.php
- Timestamp:
- Dec 18, 2009, 10:12:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r4511 r4513 856 856 return new PwgError(401, 'Access denied'); 857 857 } 858 if (!$service->isPost()) 859 { 860 return new PwgError(405, "This method requires HTTP POST"); 861 } 858 862 $params['image_id'] = array_map( 'intval',$params['image_id'] ); 859 863 if ( empty($params['image_id']) ) … … 866 870 return new PwgError(WS_ERR_INVALID_PARAM, "Invalid level"); 867 871 } 872 868 873 $query = ' 869 874 UPDATE '.IMAGES_TABLE.' … … 951 956 { 952 957 unlink($output_filepath); 953 958 954 959 if (is_file($output_filepath)) 955 960 { … … 958 963 } 959 964 } 960 965 961 966 $upload_dir = PHPWG_ROOT_PATH.'upload/buffer'; 962 967 $pattern = '/'.$original_sum.'-'.$type.'/'; … … 983 988 984 989 $i = 0; 985 990 986 991 foreach ($chunks as $chunk) 987 992 { … … 1015 1020 1016 1021 $upload_dir = dirname($file_path); 1017 1022 1018 1023 if (!is_dir($upload_dir)) { 1019 1024 umask(0000); … … 1102 1107 // 1103 1108 $update = array(); 1104 1109 1105 1110 if ('high' == $params['type']) 1106 1111 { … … 1121 1126 { 1122 1127 $update['id'] = $params['image_id']; 1123 1128 1124 1129 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 1125 1130 mass_updates( … … 1840 1845 exit(); 1841 1846 } 1842 1847 1843 1848 $query = ' 1844 1849 SELECT … … 1858 1863 exit(); 1859 1864 } 1860 1865 1861 1866 $to_update_cat_ids = array(); 1862 1867 1863 1868 // in case of replace mode, we first check the existing associations 1864 1869 $query = ' … … 1885 1890 } 1886 1891 } 1887 1892 1888 1893 $new_cat_ids = array_diff($cat_ids, $existing_cat_ids); 1889 1894 if (count($new_cat_ids) == 0) … … 1891 1896 return true; 1892 1897 } 1893 1898 1894 1899 if ($search_current_ranks) 1895 1900 { … … 1915 1920 $current_rank_of[$cat_id] = 0; 1916 1921 } 1917 1922 1918 1923 if ('auto' == $rank_on_category[$cat_id]) 1919 1924 { … … 1922 1927 } 1923 1928 } 1924 1929 1925 1930 $inserts = array(); 1926 1931 1927 1932 foreach ($new_cat_ids as $cat_id) 1928 1933 { … … 1936 1941 ); 1937 1942 } 1938 1943 1939 1944 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 1940 1945 mass_inserts( … … 1943 1948 $inserts 1944 1949 ); 1945 1950 1946 1951 update_category($new_cat_ids); 1947 1952 }
Note: See TracChangeset
for help on using the changeset viewer.