Adjust error display in core file cleanup function

This commit is contained in:
Kijin Sung 2022-12-29 01:01:17 +09:00
parent ab757d0b8a
commit 84546b936c
2 changed files with 10 additions and 2 deletions

View file

@ -3,6 +3,8 @@
namespace Rhymix\Modules\Admin\Controllers\Maintenance;
use Context;
use Rhymix\Framework\Exceptions\InvalidRequest;
use Rhymix\Framework\Exceptions\TargetNotFound;
use Rhymix\Framework\Security;
use Rhymix\Framework\Storage;
use Rhymix\Modules\Admin\Controllers\Base;
@ -41,6 +43,7 @@ class Cleanup extends Base
// If there were errors, set information in session.
else
{
$this->setError(-1);
$this->setMessage('msg_cleanup_manually');
$_SESSION['admin_cleanup_errors'] = $result;
}
@ -158,7 +161,7 @@ class Cleanup extends Base
}
else
{
return [$name => 'INVALID'];
throw new InvalidRequest;
}
}
else
@ -166,6 +169,11 @@ class Cleanup extends Base
$list = $this->checkFiles();
}
if (!count($list))
{
throw new TargetNotFound('msg_cleanup_list_empty');
}
// Delete each file or directory.
$result = [];
foreach ($list as $name => $reason)

View file

@ -54,7 +54,7 @@
<!--@endforeach-->
<!--@if(!$cleanup_list)-->
<tr>
<td class="nowr" colspan="4">{$lang->msg_cleanup_list_empty}</td>
<td class="nowr" colspan="4" style="text-align:center;padding:30px 0">{$lang->msg_cleanup_list_empty}</td>
</tr>
<!--@endif-->
</tbody>