[FileQuota] We'll get back to this plugin later

This commit is contained in:
Diogo Peralta Cordeiro 2021-08-14 16:17:15 +01:00 committed by Hugo Sales
parent 39006fb6b5
commit a7c8da0534
Signed by untrusted user: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -23,6 +23,7 @@ namespace Plugin\FileQuota;
use App\Core\Cache;
use App\Core\DB\DB;
use App\Core\Event;
use App\Core\Modules\Plugin;
use App\Util\Common;
use App\Util\Exception\ClientException;
@ -45,8 +46,10 @@ class FileQuota extends Plugin
* quotas. Handles per file, per user and per user-month quotas.
* Throws on quota violations
*/
public function onEnforceQuota(int $user_id, int $filesize)
public function onEnforceQuota(int $user_id, int $filesize): bool
{
return Event::stop;
/*
$file_quota = Common::config('attachments', 'file_quota');
if ($filesize > $file_quota) {
// TRANS: Message given if an upload is larger than the configured maximum.
@ -87,6 +90,6 @@ END;
// TRANS: Message given if an upload would exceed user quota.
throw new ClientException(_m('A file this large would exceed your monthly quota of {quota} bytes.', ['quota' => $monthly_quota]));
}
}
}*/
}
}