fixes #1419 add photos in a lounge as a temporary space

* at the end of the upload of after a maximum duration, move the photos from the lounge to their actual categories.
* do not invalidate user cache when photos are added in the lounge, thus avoiding to rebuild cache on every photo uploaded
* the lounge system activates itself only beyond 50k (by default) photo
This commit is contained in:
plegall
2021-06-11 16:35:29 +02:00
parent 4aa7a7b9bf
commit ac0d1a5b47
13 changed files with 307 additions and 7 deletions
+18 -1
View File
@@ -405,8 +405,10 @@ SELECT id, name, permalink, uppercats, global_rank, commentable
}
usort($related_categories, 'global_rank_compare');
if (empty($related_categories))
if (empty($related_categories) and !is_admin())
{
// photo might be in the lounge? or simply orphan. A standard user should not get
// info. An admin should still be able to get info.
return new PwgError(401, 'Access denied');
}
@@ -2094,6 +2096,21 @@ function ws_images_checkUpload($params, $service)
return $ret;
}
/**
* API method
* Empties the lounge, where photos may wait before taking off.
* @since 12
* @param mixed[] $params
*/
function ws_images_emptyLounge($params, $service)
{
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
$ret = array('count' => empty_lounge());
return $ret;
}
/**
* API method
* add md5sum at photos, by block. Returns how md5sum were added and how many are remaining.