1: <?php
2: /**
3: * This code is licensed under AGPLv3 license or Afterlogic Software License
4: * if commercial version of the product was purchased.
5: * For full statements of the licenses see LICENSE-AFTERLOGIC and LICENSE-AGPL3 files.
6: */
7:
8: namespace Aurora\Modules\LogsViewerWebclient;
9:
10: /**
11: * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0
12: * @license https://afterlogic.com/products/common-licensing Afterlogic Software License
13: * @copyright Copyright (c) 2023, Afterlogic Corp.
14: *
15: * @package Modules
16: */
17: class Module extends \Aurora\System\Module\AbstractWebclientModule
18: {
19: public function GetSettings()
20: {
21: \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::TenantAdmin);
22:
23: return array(
24: 'ViewLastLogSize' => $this->getConfig('ViewLastLogSize', 1024000)
25: );
26: }
27:
28: public function GetUsersWithSeparateLog()
29: {
30: \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::TenantAdmin);
31: return \Aurora\Modules\Core\Module::Decorator()->GetUsersWithSeparateLog();
32: }
33:
34: public function TurnOffSeparateLogs()
35: {
36: \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::TenantAdmin);
37: return \Aurora\Modules\Core\Module::Decorator()->TurnOffSeparateLogs();
38: }
39:
40: public function ClearSeparateLogs()
41: {
42: \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::TenantAdmin);
43: return \Aurora\Modules\Core\Module::Decorator()->ClearSeparateLogs();
44: }
45:
46: public function GetLogFilesData()
47: {
48: \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::TenantAdmin);
49: return \Aurora\Modules\Core\Module::Decorator()->GetLogFilesData();
50: }
51:
52: public function GetLogFile($EventsLog = false, $PublicId = '')
53: {
54: \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::TenantAdmin);
55: return \Aurora\Modules\Core\Module::Decorator()->GetLogFile($EventsLog, $PublicId);
56: }
57:
58: public function GetLog($EventsLog)
59: {
60: $PartSize = $this->getConfig('ViewLastLogSize', 1024000);
61: \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::TenantAdmin);
62: return \Aurora\Modules\Core\Module::Decorator()->GetLog($EventsLog, $PartSize);
63: }
64:
65: public function ClearLog($EventsLog)
66: {
67: \Aurora\System\Api::checkUserRoleIsAtLeast(\Aurora\System\Enums\UserRole::TenantAdmin);
68: return \Aurora\Modules\Core\Module::Decorator()->ClearLog($EventsLog);
69: }
70: }
71: