|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
namespace XoopsModules\Adslight; |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
You may not change or alter any portion of this comment or credits |
|
7
|
|
|
of supporting developers from this source code or any supporting source code |
|
8
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
9
|
|
|
|
|
10
|
|
|
This program is distributed in the hope that it will be useful, |
|
11
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Module: Adslight |
|
17
|
|
|
* |
|
18
|
|
|
* @category Module |
|
19
|
|
|
* @author XOOPS Development Team <https://xoops.org> |
|
20
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
|
21
|
|
|
* @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
|
22
|
|
|
*/ |
|
23
|
|
|
|
|
24
|
|
|
use XoopsModules\Adslight\{ |
|
25
|
|
|
Form |
|
26
|
|
|
}; |
|
27
|
|
|
|
|
28
|
|
|
//$permHelper = new \Xmf\Module\Helper\Permission(); |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Class Iplog |
|
32
|
|
|
*/ |
|
33
|
|
|
class Iplog extends \XoopsObject |
|
34
|
|
|
{ |
|
35
|
|
|
public $ip_id; |
|
36
|
|
|
public $lid; |
|
37
|
|
|
public $date_created; |
|
38
|
|
|
public $submitter; |
|
39
|
|
|
public $ipnumber; |
|
40
|
|
|
public $email; |
|
41
|
|
|
public $helper; |
|
42
|
|
|
public $permHelper; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Constructor |
|
46
|
|
|
* |
|
47
|
|
|
* @param null |
|
48
|
|
|
*/ |
|
49
|
|
|
public function __construct() |
|
50
|
|
|
{ |
|
51
|
|
|
parent::__construct(); |
|
52
|
|
|
// /** @var Adslight\Helper $helper */ |
|
53
|
|
|
// $this->helper = Adslight\Helper::getInstance(); |
|
54
|
|
|
$this->permHelper = new \Xmf\Module\Helper\Permission(); |
|
55
|
|
|
|
|
56
|
|
|
$this->initVar('ip_id', \XOBJ_DTYPE_INT); |
|
57
|
|
|
$this->initVar('lid', \XOBJ_DTYPE_INT); |
|
58
|
|
|
$this->initVar('date_created', \XOBJ_DTYPE_INT); |
|
59
|
|
|
$this->initVar('submitter', \XOBJ_DTYPE_TXTBOX); |
|
60
|
|
|
$this->initVar('ipnumber', \XOBJ_DTYPE_TXTBOX); |
|
61
|
|
|
$this->initVar('email', \XOBJ_DTYPE_TXTBOX); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Get form |
|
66
|
|
|
* |
|
67
|
|
|
* @param null |
|
68
|
|
|
* @return Form\IplogForm |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getForm(): Form\IplogForm |
|
71
|
|
|
{ |
|
72
|
|
|
$form = new Form\IplogForm($this); |
|
73
|
|
|
|
|
74
|
|
|
return $form; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* @return array|null |
|
79
|
|
|
*/ |
|
80
|
|
|
public function getGroupsRead(): ?array |
|
81
|
|
|
{ |
|
82
|
|
|
//$permHelper = new \Xmf\Module\Helper\Permission(); |
|
83
|
|
|
return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('ip_id')); |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @return array|null |
|
88
|
|
|
*/ |
|
89
|
|
|
public function getGroupsSubmit(): ?array |
|
90
|
|
|
{ |
|
91
|
|
|
//$permHelper = new \Xmf\Module\Helper\Permission(); |
|
92
|
|
|
return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('ip_id')); |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
|
|
/** |
|
96
|
|
|
* @return array|null |
|
97
|
|
|
*/ |
|
98
|
|
|
public function getGroupsModeration(): ?array |
|
99
|
|
|
{ |
|
100
|
|
|
//$permHelper = new \Xmf\Module\Helper\Permission(); |
|
101
|
|
|
return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('ip_id')); |
|
102
|
|
|
} |
|
103
|
|
|
} |
|
104
|
|
|
|