1: <?php declare(strict_types=1);
2: /**
3: * Copyright (C) Apis Networks, Inc - All Rights Reserved.
4: *
5: * Unauthorized copying of this file, via any medium, is
6: * strictly prohibited without consent. Any dissemination of
7: * material herein is prohibited.
8: *
9: * For licensing inquiries email <licensing@apisnetworks.com>
10: *
11: * Written by Matt Saladna <matt@apisnetworks.com>, April 2018
12: */
13:
14:
15: /**
16: * Class Reseller_Module
17: *
18: * Hierarchical account management
19: *
20: * Reserved for future use.
21: */
22: class Reseller_Module extends Admin_Module
23: {
24: public $exportedFunctions = [
25: '*' => PRIVILEGE_RESELLER,
26: 'read_map' => PRIVILEGE_NONE,
27: 'activate_license' => PRIVILEGE_NONE,
28: 'renew_license' => PRIVILEGE_NONE,
29: 'create_from_meta' => PRIVILEGE_NONE,
30: ];
31:
32: public function __construct()
33: {
34: parent::__construct();
35: }
36:
37: protected function scopeRestrictor(): string
38: {
39: return 'JOIN resellers ON (reseller_id) WHERE reseller_id = ' .
40: \Opcenter\Reseller::id($this->getAuthContext()->rgroup);
41: }
42: /**
43: * Reseller support enabled for server
44: *
45: * @return bool
46: */
47: public function enabled(): bool
48: {
49: return \Opcenter\Reseller::enabled();
50: }
51:
52: public function collect(?array $params = [], array $query = null, array $sites = []): array
53: {
54: $params['reseller.id'] = $this->getAuthContext()->rgroup;
55:
56: return parent::collect($params, $query, $sites);
57: }
58:
59: public function _cron(Cronus $c)
60: {
61: return;
62: }
63:
64: public function _housekeeping()
65: {
66: return;
67: }
68: }