From 89384aa6b1b8808ec8ceda6b9673236383c94cfe Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 3 May 2010 09:56:22 +0000 Subject: improvement: use the same code to check upload readiness in admin>photos>add screen and in web API. bug fixed: UploadForm partly takes into account the configurable upload directory (must be propagated everywhere in the UploadForm process) git-svn-id: http://piwigo.org/svn/trunk@6051 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/photos_add_direct.php | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'admin/photos_add_direct.php') diff --git a/admin/photos_add_direct.php b/admin/photos_add_direct.php index 31cfd1e4f..6f3991732 100644 --- a/admin/photos_add_direct.php +++ b/admin/photos_add_direct.php @@ -444,39 +444,10 @@ $template->assign( $setup_errors = array(); -$upload_base_dir = 'upload'; -$upload_dir = PHPWG_ROOT_PATH.$upload_base_dir; - -if (!is_dir($upload_dir)) -{ - if (!is_writable(PHPWG_ROOT_PATH)) - { - array_push( - $setup_errors, - sprintf( - l10n('Create the "%s" directory at the root of your Piwigo installation'), - $upload_base_dir - ) - ); - } -} -else +$error_message = ready_for_upload_message(); +if (!empty($error_message)) { - if (!is_writable($upload_dir)) - { - @chmod($upload_dir, 0777); - - if (!is_writable($upload_dir)) - { - array_push( - $setup_errors, - sprintf( - l10n('Give write access (chmod 777) to "%s" directory at the root of your Piwigo installation'), - $upload_base_dir - ) - ); - } - } + array_push($setup_errors, $error_message); } $template->assign( -- cgit v1.2.3