This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /* |
||
3 | You may not change or alter any portion of this comment or credits |
||
4 | of supporting developers from this source code or any supporting source code |
||
5 | which is considered copyrighted (c) material of the original comment or credit authors. |
||
6 | |||
7 | This program is distributed in the hope that it will be useful, |
||
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
10 | */ |
||
11 | |||
12 | /** |
||
13 | * page module |
||
14 | * |
||
15 | * @copyright XOOPS Project https://xoops.org/ |
||
16 | * @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
||
17 | * @package page |
||
18 | * @since 2.6.0 |
||
19 | * @author DuGris (aka Laurent JEN) |
||
20 | * @author John Mordo (jlm69) |
||
21 | * @version $Id$ |
||
22 | */ |
||
23 | |||
24 | use Xoops\Core\Kernel\Handlers\XoopsGroupPermHandler; |
||
25 | |||
26 | defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
||
27 | |||
28 | /** |
||
29 | * Class AlumniGroupPermHandler |
||
30 | */ |
||
31 | class AlumniGroupPermHandler extends XoopsGroupPermHandler |
||
32 | { |
||
33 | /** |
||
34 | * Check permission |
||
35 | * |
||
36 | * @param string $gperm_name |
||
37 | * @param int $gperm_itemid |
||
38 | * @param array|int $gperm_groupid |
||
39 | * @param int $gperm_modid |
||
40 | * @param bool $trueifadmin |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | public function checkRight($gperm_name, $gperm_itemid, $gperm_groupid, $gperm_modid = 1, $trueifadmin = true) |
||
45 | { |
||
46 | return parent::checkRight($gperm_name, $gperm_itemid, $gperm_groupid, $gperm_modid, $trueifadmin); |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param $cid |
||
51 | * @param array $groups |
||
52 | */ |
||
53 | public function updatePerms($cid, $groups = []) |
||
54 | { |
||
55 | $module_id = Alumni::getInstance()->getModule()->getVar('mid'); |
||
56 | |||
57 | $groups_exists = parent::getGroupIds('alumni_view', $cid, $module_id); |
||
0 ignored issues
–
show
|
|||
58 | $groups_exists = array_values($groups_exists); |
||
59 | $groups_delete = array_diff(array_values($groups_exists), $groups); |
||
60 | $groups_add = array_diff($groups, array_values($groups_exists)); |
||
61 | |||
62 | $groups1_exists = parent::getGroupIds('alumni_submit', $cid, $module_id); |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
getGroupIds() instead of updatePerms() ). Are you sure this is correct? If so, you might want to change this to $this->getGroupIds() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The ![]() |
|||
63 | $groups1_exists = array_values($groups1_exists); |
||
64 | $groups1_delete = array_diff(array_values($groups1_exists), $groups); |
||
65 | $groups1_add = array_diff($groups, array_values($groups1_exists)); |
||
66 | |||
67 | $groups2_exists = parent::getGroupIds('alumni_premium', $cid, $module_id); |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
getGroupIds() instead of updatePerms() ). Are you sure this is correct? If so, you might want to change this to $this->getGroupIds() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The ![]() |
|||
68 | $groups2_exists = array_values($groups2_exists); |
||
69 | $groups2_delete = array_diff(array_values($groups2_exists), $groups); |
||
70 | $groups2_add = array_diff($groups, array_values($groups2_exists)); |
||
71 | |||
72 | // delete alumni_view |
||
73 | View Code Duplication | if (0 != count($groups_delete)) { |
|
74 | $criteria = $criteria = new CriteriaCompo(); |
||
75 | $criteria->add(new Criteria('gperm_itemid', $cid)); |
||
76 | $criteria->add(new Criteria('gperm_modid', $module_id)); |
||
77 | $criteria->add(new Criteria('gperm_name', 'alumni_view', '=')); |
||
78 | $criteria->add(new Criteria('gperm_groupid', '(' . implode(', ', $groups_delete) . ')', 'IN')); |
||
79 | if (parent::deleteAll($criteria)) { |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
deleteAll() instead of updatePerms() ). Are you sure this is correct? If so, you might want to change this to $this->deleteAll() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The ![]() |
|||
80 | } |
||
81 | } |
||
82 | |||
83 | // delete alumni_view |
||
84 | View Code Duplication | if (0 != count($groups1_delete)) { |
|
85 | $criteria = $criteria = new CriteriaCompo(); |
||
86 | $criteria->add(new Criteria('gperm_itemid', $cid)); |
||
87 | $criteria->add(new Criteria('gperm_modid', $module_id)); |
||
88 | $criteria->add(new Criteria('gperm_name', 'alumni_submit', '=')); |
||
89 | $criteria->add(new Criteria('gperm_groupid', '(' . implode(', ', $groups1_delete) . ')', 'IN')); |
||
90 | if (parent::deleteAll($criteria)) { |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
deleteAll() instead of updatePerms() ). Are you sure this is correct? If so, you might want to change this to $this->deleteAll() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The ![]() |
|||
91 | } |
||
92 | } |
||
93 | |||
94 | // delete alumni_view |
||
95 | View Code Duplication | if (0 != count($groups2_delete)) { |
|
96 | $criteria = $criteria = new CriteriaCompo(); |
||
97 | $criteria->add(new Criteria('gperm_itemid', $cid)); |
||
98 | $criteria->add(new Criteria('gperm_modid', $module_id)); |
||
99 | $criteria->add(new Criteria('gperm_name', 'alumni_premium', '=')); |
||
100 | $criteria->add(new Criteria('gperm_groupid', '(' . implode(', ', $groups2_delete) . ')', 'IN')); |
||
101 | if (parent::deleteAll($criteria)) { |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
deleteAll() instead of updatePerms() ). Are you sure this is correct? If so, you might want to change this to $this->deleteAll() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The ![]() |
|||
102 | } |
||
103 | } |
||
104 | |||
105 | // Add alumni_view |
||
106 | if (0 != count($groups_add)) { |
||
107 | foreach ($groups_add as $group_id) { |
||
108 | parent::addRight('alumni_view', $cid, $group_id, $module_id); |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
addRight() instead of updatePerms() ). Are you sure this is correct? If so, you might want to change this to $this->addRight() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The ![]() |
|||
109 | } |
||
110 | } |
||
111 | |||
112 | // Add alumni_submit |
||
113 | if (0 != count($groups1_add)) { |
||
114 | foreach ($groups1_add as $group_id) { |
||
115 | parent::addRight('alumni_submit', $cid, $group_id, $module_id); |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
addRight() instead of updatePerms() ). Are you sure this is correct? If so, you might want to change this to $this->addRight() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The ![]() |
|||
116 | } |
||
117 | } |
||
118 | |||
119 | // Add alumni_submit |
||
120 | if (0 != count($groups2_add)) { |
||
121 | foreach ($groups2_add as $group_id) { |
||
122 | parent::addRight('alumni_premium', $cid, $group_id, $module_id); |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
addRight() instead of updatePerms() ). Are you sure this is correct? If so, you might want to change this to $this->addRight() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The ![]() |
|||
123 | } |
||
124 | } |
||
125 | } |
||
126 | } |
||
127 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.