Fixes #272 missing md5sum

* dashboard: add warning if missing checksums
* add a "compute all missing md5sum" option in batch manager (inspired by delete orphans)
* progress bar when computing md5sums
This commit is contained in:
Teatek
2019-01-22 10:26:52 +01:00
committed by Pierrick Le Gall
parent 29f938acba
commit b05241f508
10 changed files with 206 additions and 4 deletions
+22
View File
@@ -53,6 +53,28 @@ $tabsheet->assign();
// | actions |
// +-----------------------------------------------------------------------+
//check if images have no md5sum in database
$query = '
SELECT COUNT(*)
FROM '.CATEGORIES_TABLE.'
WHERE dir IS NOT NULL
;';
list($counter) = pwg_db_fetch_row(pwg_query($query));
if ($counter > 0)
{
$query = '
SELECT COUNT(*)
FROM '.IMAGES_TABLE.'
WHERE storage_category_id IS NOT NULL
AND md5sum IS NULL
;';
list($counter) = pwg_db_fetch_row(pwg_query($query));
if ($counter > 0)
{
$page['warnings'][] = '<a href="admin.php?page=batch_manager&amp;filter=prefilter-no_sync_md5sum">'.l10n('Some checksums are missing.').'<i class="icon-right"></i></a>';
}
}
// Check for upgrade : code inspired from punbb
if (isset($_GET['action']) and 'check_upgrade' == $_GET['action'])
{