From fe569ab1bf4baa44a808a2d6e81bcddc28d61b62 Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 13 Jan 2011 15:24:18 +0000 Subject: feature 2108 added: user upload removed from core. It will come back as a "new generation" user upload in the Community plugin. git-svn-id: http://piwigo.org/svn/trunk@8651 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin.php | 1 - admin/cat_modify.php | 7 - admin/cat_options.php | 53 +-- admin/configuration.php | 39 --- admin/help.php | 7 - admin/include/functions_upgrade.php | 1 - admin/intro.php | 19 -- admin/site_update.php | 82 +---- admin/themes/default/template/admin.tpl | 3 - admin/themes/default/template/cat_modify.tpl | 8 - admin/themes/default/template/configuration.tpl | 23 -- admin/themes/default/template/intro.tpl | 4 - admin/themes/default/template/upload.tpl | 51 --- admin/upload.php | 205 ----------- include/config_default.inc.php | 28 -- include/constants.php | 2 - include/functions_notification.inc.php | 41 +-- install/config.sql | 3 - install/db/94-database.php | 93 +++++ install/piwigo_structure-mysql.sql | 19 -- install/piwigo_structure-pdo-sqlite.sql | 20 -- install/piwigo_structure-pgsql.sql | 25 -- install/piwigo_structure-sqlite.sql | 21 -- language/ar_SA/admin.lang.php | 11 - language/ar_SA/common.lang.php | 3 - language/ar_SA/help/help_user_upload.html | 16 - language/ca_ES/admin.lang.php | 10 - language/ca_ES/common.lang.php | 3 - language/cs_CZ/admin.lang.php | 11 - language/cs_CZ/common.lang.php | 3 - language/cs_CZ/help/help_user_upload.html | 18 - language/da_DK/admin.lang.php | 11 - language/da_DK/common.lang.php | 3 - language/de_DE/admin.lang.php | 11 - language/de_DE/common.lang.php | 3 - language/de_DE/help/help_user_upload.html | 13 - language/en_UK/admin.lang.php | 11 - language/en_UK/common.lang.php | 3 - language/en_UK/help/help_user_upload.html | 18 - language/es_AR/common.lang.php | 3 - language/es_ES/admin.lang.php | 11 - language/es_ES/common.lang.php | 3 - language/es_ES/help/help_user_upload.html | 16 - language/fa_IR/admin.lang.php | 11 - language/fa_IR/common.lang.php | 3 - language/fr_CA/admin.lang.php | 11 - language/fr_CA/common.lang.php | 3 - language/fr_CA/help/help_user_upload.html | 14 - language/fr_FR/admin.lang.php | 11 - language/fr_FR/common.lang.php | 3 - language/fr_FR/help/help_user_upload.html | 14 - language/he_IL/admin.lang.php | 11 - language/he_IL/common.lang.php | 3 - language/hr_HR/admin.lang.php | 11 - language/hr_HR/common.lang.php | 3 - language/hu_HU/admin.lang.php | 11 - language/hu_HU/common.lang.php | 3 - language/hu_HU/help/help_user_upload.html | 18 - language/it_IT/admin.lang.php | 11 - language/it_IT/common.lang.php | 3 - language/it_IT/help/help_user_upload.html | 14 - language/ja_JP/admin.lang.php | 11 - language/ja_JP/common.lang.php | 3 - language/ja_JP/help/help_user_upload.html | 6 - language/ka_GE/admin.lang.php | 11 - language/ka_GE/common.lang.php | 3 - language/ka_GE/help/help_user_upload.html | 15 - language/lv_LV/admin.lang.php | 11 - language/lv_LV/common.lang.php | 3 - language/lv_LV/help/help_user_upload.html | 12 - language/mk_MK/common.lang.php | 3 - language/nl_NL/admin.lang.php | 11 - language/nl_NL/common.lang.php | 3 - language/nl_NL/help/help_user_upload.html | 13 - language/no_NO/admin.lang.php | 11 - language/no_NO/common.lang.php | 3 - language/no_NO/help/help_user_upload.html | 15 - language/pl_PL/admin.lang.php | 11 - language/pl_PL/common.lang.php | 3 - language/pl_PL/help/help_user_upload.html | 14 - language/pt_BR/admin.lang.php | 11 - language/pt_BR/common.lang.php | 3 - language/pt_BR/help/help_user_upload.html | 15 - language/pt_PT/admin.lang.php | 11 - language/pt_PT/common.lang.php | 3 - language/pt_PT/help/help_user_upload.html | 15 - language/ro_RO/common.lang.php | 3 - language/ru_RU/admin.lang.php | 11 - language/ru_RU/common.lang.php | 3 - language/ru_RU/help/help_user_upload.html | 18 - language/sh_RS/admin.lang.php | 11 - language/sh_RS/common.lang.php | 3 - language/sk_SK/admin.lang.php | 11 - language/sk_SK/common.lang.php | 3 - language/sk_SK/help/help_user_upload.html | 18 - language/sl_SL/common.lang.php | 3 - language/sr_RS/admin.lang.php | 11 - language/sr_RS/common.lang.php | 3 - language/sv_SE/admin.lang.php | 11 - language/sv_SE/common.lang.php | 3 - language/sv_SE/help/help_user_upload.html | 17 - language/tr_TR/admin.lang.php | 11 - language/tr_TR/common.lang.php | 3 - language/vi_VN/admin.lang.php | 11 - language/vi_VN/common.lang.php | 3 - language/zh_CN/admin.lang.php | 11 - language/zh_CN/common.lang.php | 3 - language/zh_CN/help/help_user_upload.html | 12 - upload.php | 431 ------------------------ 109 files changed, 99 insertions(+), 1829 deletions(-) delete mode 100644 admin/themes/default/template/upload.tpl delete mode 100644 admin/upload.php create mode 100644 install/db/94-database.php delete mode 100644 language/ar_SA/help/help_user_upload.html delete mode 100644 language/cs_CZ/help/help_user_upload.html delete mode 100644 language/de_DE/help/help_user_upload.html delete mode 100644 language/en_UK/help/help_user_upload.html delete mode 100644 language/es_ES/help/help_user_upload.html delete mode 100644 language/fr_CA/help/help_user_upload.html delete mode 100644 language/fr_FR/help/help_user_upload.html delete mode 100644 language/hu_HU/help/help_user_upload.html delete mode 100644 language/it_IT/help/help_user_upload.html delete mode 100644 language/ja_JP/help/help_user_upload.html delete mode 100644 language/ka_GE/help/help_user_upload.html delete mode 100644 language/lv_LV/help/help_user_upload.html delete mode 100644 language/nl_NL/help/help_user_upload.html delete mode 100644 language/no_NO/help/help_user_upload.html delete mode 100644 language/pl_PL/help/help_user_upload.html delete mode 100644 language/pt_BR/help/help_user_upload.html delete mode 100644 language/pt_PT/help/help_user_upload.html delete mode 100644 language/ru_RU/help/help_user_upload.html delete mode 100644 language/sk_SK/help/help_user_upload.html delete mode 100644 language/sv_SE/help/help_user_upload.html delete mode 100644 language/zh_CN/help/help_user_upload.html delete mode 100644 upload.php diff --git a/admin.php b/admin.php index 7b79f6fce..f03a34e9d 100644 --- a/admin.php +++ b/admin.php @@ -125,7 +125,6 @@ $template->assign( 'U_MOVE'=> $link_start.'cat_move', 'U_CAT_OPTIONS'=> $link_start.'cat_options', 'U_CAT_UPDATE'=> $link_start.'site_update&site=1', - 'U_WAITING'=> $link_start.'upload', 'U_RATING'=> $link_start.'rating', 'U_CADDIE'=> $link_start.'batch_manager&cat=caddie', 'U_RECENT_SET'=> $link_start.'batch_manager&cat=recent', diff --git a/admin/cat_modify.php b/admin/cat_modify.php index a30fea4ba..4c0504428 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -69,8 +69,6 @@ if (isset($_POST['submit'])) 'id' => $_GET['cat_id'], 'name' => @$_POST['name'], 'commentable' => isset($_POST['commentable'])?$_POST['commentable']:'false', - 'uploadable' => - isset($_POST['uploadable']) ? $_POST['uploadable'] : 'false', 'comment' => $conf['allow_html_descriptions'] ? @$_POST['comment'] : strip_tags(@$_POST['comment']), @@ -245,7 +243,6 @@ $template->assign( 'CAT_STATUS' => $category['status'], 'CAT_VISIBLE' => boolean_to_string($category['visible']), 'CAT_COMMENTABLE' => boolean_to_string($category['commentable']), - 'CAT_UPLOADABLE' => boolean_to_string($category['uploadable']), 'IMG_ORDER_DEFAULT' => empty($category['image_order']) ? 'checked="checked"' : '', @@ -304,10 +301,6 @@ else $category['cat_full_dir'] ) ) ); - if (!url_is_remote($category['cat_full_dir']) ) - { - $template->assign('SHOW_UPLOADABLE', true); - } } // image order management diff --git a/admin/cat_options.php b/admin/cat_options.php index 638757cb0..3d7a4dd75 100644 --- a/admin/cat_options.php +++ b/admin/cat_options.php @@ -47,16 +47,6 @@ if (isset($_POST['falsify']) { switch ($_GET['section']) { - case 'upload' : - { - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET uploadable = \'false\' - WHERE id IN ('.implode(',', $_POST['cat_true']).') -;'; - pwg_query($query); - break; - } case 'comments' : { $query = ' @@ -95,16 +85,6 @@ else if (isset($_POST['trueify']) { switch ($_GET['section']) { - case 'upload' : - { - $query = ' -UPDATE '.CATEGORIES_TABLE.' - SET uploadable = \'true\' - WHERE id IN ('.implode(',', $_POST['cat_false']).') -;'; - pwg_query($query); - break; - } case 'comments' : { $query = ' @@ -162,10 +142,6 @@ $tabsheet = new tabsheet(); $opt_link = $link_start.'cat_options&section='; $tabsheet->add('status', l10n('Public / Private'), $opt_link.'status'); $tabsheet->add('visible', l10n('Lock'), $opt_link.'visible'); -if ($conf['enable_synchronization']) -{ - $tabsheet->add('upload', l10n('Upload'), $opt_link.'upload'); -} $tabsheet->add('comments', l10n('Comments'), $opt_link.'comments'); if ($conf['allow_random_representative']) { @@ -182,8 +158,8 @@ $tabsheet->assign(); // for each section, categories in the multiselect field can be : // -// - true : uploadable for upload section -// - false : un-uploadable for upload section +// - true : commentable for comment section +// - false : un-commentable for comment section // - NA : (not applicable) for virtual categories // // for true and false status, we associates an array of category ids, @@ -193,31 +169,6 @@ $cats_true = array(); $cats_false = array(); switch ($page['section']) { - case 'upload' : - { - $query_true = ' -SELECT id,name,uppercats,global_rank - FROM '.CATEGORIES_TABLE.' - WHERE uploadable = \'true\' - AND dir IS NOT NULL - AND site_id = 1 -;'; - $query_false = ' -SELECT id,name,uppercats,global_rank - FROM '.CATEGORIES_TABLE.' - WHERE uploadable = \'false\' - AND dir IS NOT NULL - AND site_id = 1 -;'; - $template->assign( - array( - 'L_SECTION' => l10n('Select uploadable albums'), - 'L_CAT_OPTIONS_TRUE' => l10n('Authorized'), - 'L_CAT_OPTIONS_FALSE' => l10n('Forbidden'), - ) - ); - break; - } case 'comments' : { $query_true = ' diff --git a/admin/configuration.php b/admin/configuration.php index 0f2e8bd34..154538c0f 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -60,11 +60,6 @@ $history_checkboxes = array( 'history_guest' ); -$upload_checkboxes = array( - 'upload_link_everytime', - 'email_admin_on_picture_uploaded', - ); - $comments_checkboxes = array( 'comments_forall', 'comments_validation', @@ -144,14 +139,6 @@ if (isset($_POST['submit'])) } break; } - case 'upload' : - { - foreach( $upload_checkboxes as $checkbox) - { - $_POST[$checkbox] = empty($_POST[$checkbox])?'false':'true'; - } - break; - } case 'default' : { // Never go here @@ -217,10 +204,6 @@ $tabsheet->add('main', l10n('Main'), $conf_link.'main'); $tabsheet->add('display', l10n('Display'), $conf_link.'display'); $tabsheet->add('history', l10n('History'), $conf_link.'history'); $tabsheet->add('comments', l10n('Comments'), $conf_link.'comments'); -if ($conf['enable_synchronization']) -{ - $tabsheet->add('upload', l10n('Upload'), $conf_link.'upload'); -} $tabsheet->add('default', l10n('Guest Settings'), $conf_link.'default'); // TabSheet selection $tabsheet->select($page['section']); @@ -300,28 +283,6 @@ switch ($page['section']) } break; } - case 'upload' : - { - $template->assign( - 'upload', - array( - 'upload_user_access_options'=> get_user_access_level_html_options(ACCESS_GUEST), - 'upload_user_access_options_selected' => array($conf['upload_user_access']) - ) - ); - //Necessary for merge_block_vars - foreach ($upload_checkboxes as $checkbox) - { - $template->append( - 'upload', - array( - $checkbox => $conf[$checkbox] - ), - true - ); - } - break; - } case 'default' : { $edit_user = build_user($conf['guest_id'], false); diff --git a/admin/help.php b/admin/help.php index e2eafd1e8..f61542fc2 100644 --- a/admin/help.php +++ b/admin/help.php @@ -46,13 +46,6 @@ $tabs[] = array( 'code' => 'groups', 'label' => l10n('Groups'), ); -if ($conf['enable_synchronization']) -{ - $tabs[] = array( - 'code' => 'user_upload', - 'label' => l10n('User Upload'), - ); -} $tabs[] = array( 'code' => 'virtual_links', 'label' => l10n('Virtual Links'), diff --git a/admin/include/functions_upgrade.php b/admin/include/functions_upgrade.php index 50150f64a..dfc2bad41 100644 --- a/admin/include/functions_upgrade.php +++ b/admin/include/functions_upgrade.php @@ -54,7 +54,6 @@ function prepare_conf_upgrade() define('USERS_TABLE', $prefixeTable.'users'); define('USER_INFOS_TABLE', $prefixeTable.'user_infos'); define('USER_FEED_TABLE', $prefixeTable.'user_feed'); - define('WAITING_TABLE', $prefixeTable.'waiting'); define('RATE_TABLE', $prefixeTable.'rate'); define('USER_CACHE_TABLE', $prefixeTable.'user_cache'); define('USER_CACHE_CATEGORIES_TABLE', $prefixeTable.'user_cache_categories'); diff --git a/admin/intro.php b/admin/intro.php index 3908891d9..38d944183 100644 --- a/admin/intro.php +++ b/admin/intro.php @@ -239,25 +239,6 @@ SELECT MIN(date_available) ); } -// waiting elements -$query = ' -SELECT COUNT(*) - FROM '.WAITING_TABLE.' - WHERE validated=\'false\' -;'; -list($nb_waiting) = pwg_db_fetch_row(pwg_query($query)); - -if ($nb_waiting > 0) -{ - $template->assign( - 'waiting', - array( - 'URL' => PHPWG_ROOT_PATH.'admin.php?page=upload', - 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_waiting) - ) - ); -} - // unvalidated comments $query = ' SELECT COUNT(*) diff --git a/admin/site_update.php b/admin/site_update.php index d0577070c..abd239da8 100644 --- a/admin/site_update.php +++ b/admin/site_update.php @@ -240,9 +240,6 @@ SELECT id_uppercat, MAX(rank)+1 AS next_rank 'site_id' => $site_id, 'commentable' => boolean_to_string($conf['newcat_default_commentable']), - 'uploadable' => $site_is_remote - ? 'false' - : boolean_to_string($conf['newcat_default_uploadable']), 'status' => $conf['newcat_default_status'], 'visible' => boolean_to_string($conf['newcat_default_visible']), ); @@ -312,7 +309,7 @@ SELECT id_uppercat, MAX(rank)+1 AS next_rank { $dbfields = array( 'id','dir','name','site_id','id_uppercat','uppercats','commentable', - 'uploadable','visible','status','rank','global_rank' + 'visible','status','rank','global_rank' ); mass_inserts(CATEGORIES_TABLE, $dbfields, $inserts); } @@ -359,7 +356,6 @@ if (isset($_POST['submit']) and $_POST['sync'] == 'files' $cat_ids = array_diff(array_keys($db_categories), $to_delete); $db_elements = array(); - $db_unvalidated = array(); if (count($cat_ids) > 0) { @@ -373,26 +369,6 @@ SELECT id, path "\n" ).')'; $db_elements = simple_hash_from_query($query, 'id', 'path'); - - // searching the unvalidated waiting elements (they must not be taken into - // account) - $query = ' -SELECT file,storage_category_id - FROM '.WAITING_TABLE.' - WHERE storage_category_id IN ( -'.wordwrap(implode(', ', $cat_ids), 80, "\n").') - AND validated = \'false\''; - $result = pwg_query($query); - while ($row = pwg_db_fetch_assoc($result)) - { - array_push( - $db_unvalidated, - array_search( - $row['storage_category_id'], - $db_fulldirs) - .'/'.$row['file'] - ); - } } // next element id available @@ -403,7 +379,7 @@ SELECT file,storage_category_id $inserts = array(); $insert_links = array(); - foreach (array_diff(array_keys($fs), $db_elements, $db_unvalidated) as $path) + foreach (array_diff(array_keys($fs), $db_elements) as $path) { $insert = array(); // storage category must exist @@ -529,60 +505,6 @@ SELECT file,storage_category_id $template->append('footer_elements', '' ); - - // retrieving informations given by uploaders - if (!$simulate and count($cat_ids) > 0) - { - $query = ' -SELECT id,file,storage_category_id,infos - FROM '.WAITING_TABLE.' - WHERE storage_category_id IN ( -'.wordwrap(implode(', ', $cat_ids), 80, "\n").') - AND validated = \'true\''; - $result = pwg_query($query); - - $datas = array(); - $fields = - array( - 'primary' => array('id'), - 'update' => array('date_creation', 'author', 'name', 'comment') - ); - - $waiting_to_delete = array(); - - while ($row = pwg_db_fetch_assoc($result)) - { - $data = array(); - - $query = ' -SELECT id - FROM '.IMAGES_TABLE.' - WHERE storage_category_id = '.$row['storage_category_id'].' - AND file = \''.$row['file'].'\''; - list($data['id']) = pwg_db_fetch_row(pwg_query($query)); - - foreach ($fields['update'] as $field) - { - $data[$field] = addslashes( getAttribute($row['infos'], $field) ); - } - - array_push($datas, $data); - array_push($waiting_to_delete, $row['id']); - } - - if (count($datas) > 0) - { - mass_updates(IMAGES_TABLE, $fields, $datas); - - // delete now useless waiting elements - $query = ' -DELETE - FROM '.WAITING_TABLE.' - WHERE id IN ('.implode(',', $waiting_to_delete).') -;'; - pwg_query($query); - } - } } // +-----------------------------------------------------------------------+ diff --git a/admin/themes/default/template/admin.tpl b/admin/themes/default/template/admin.tpl index 415fbe3ee..43e9d7105 100644 --- a/admin/themes/default/template/admin.tpl +++ b/admin/themes/default/template/admin.tpl @@ -18,9 +18,6 @@ jQuery(document).ready(function(){ldelim}