- Timestamp:
- May 3, 2010, 11:56:22 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/photos_add_direct.php
r6025 r6051 445 445 $setup_errors = array(); 446 446 447 $upload_base_dir = 'upload'; 448 $upload_dir = PHPWG_ROOT_PATH.$upload_base_dir; 449 450 if (!is_dir($upload_dir)) 451 { 452 if (!is_writable(PHPWG_ROOT_PATH)) 453 { 454 array_push( 455 $setup_errors, 456 sprintf( 457 l10n('Create the "%s" directory at the root of your Piwigo installation'), 458 $upload_base_dir 459 ) 460 ); 461 } 462 } 463 else 464 { 465 if (!is_writable($upload_dir)) 466 { 467 @chmod($upload_dir, 0777); 468 469 if (!is_writable($upload_dir)) 470 { 471 array_push( 472 $setup_errors, 473 sprintf( 474 l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'), 475 $upload_base_dir 476 ) 477 ); 478 } 479 } 447 $error_message = ready_for_upload_message(); 448 if (!empty($error_message)) 449 { 450 array_push($setup_errors, $error_message); 480 451 } 481 452 -
trunk/include/ws_functions.inc.php
r6049 r6051 2137 2137 } 2138 2138 2139 $relative_dir = preg_replace('#^'.PHPWG_ROOT_PATH.'#', '', $conf['upload_dir']); 2140 2141 $ret['message'] = null; 2139 $ret['message'] = ready_for_upload_message(); 2142 2140 $ret['ready_for_upload'] = true; 2143 2141 2142 if (!empty($ret['message'])) 2143 { 2144 $ret['ready_for_upload'] = false; 2145 } 2146 2147 return $ret; 2148 } 2149 2150 function ready_for_upload_message() 2151 { 2152 global $conf; 2153 2154 $relative_dir = preg_replace('#^'.PHPWG_ROOT_PATH.'#', '', $conf['upload_dir']); 2155 2144 2156 if (!is_dir($conf['upload_dir'])) 2145 2157 { 2146 2158 if (!is_writable(dirname($conf['upload_dir']))) 2147 2159 { 2148 $ret['message'] =sprintf(2160 return sprintf( 2149 2161 l10n('Create the "%s" directory at the root of your Piwigo installation'), 2150 2162 $relative_dir … … 2160 2172 if (!is_writable($conf['upload_dir'])) 2161 2173 { 2162 $ret['message'] =sprintf(2174 return sprintf( 2163 2175 l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'), 2164 2176 $relative_dir … … 2168 2180 } 2169 2181 2170 if (!empty($ret['message'])) 2171 { 2172 $ret['ready_for_upload'] = false; 2173 } 2174 2175 return $ret; 2182 return null; 2176 2183 } 2177 2184 ?>
Note: See TracChangeset
for help on using the changeset viewer.