XoopsModules25x /
suico
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.
| 1 | <?php declare(strict_types=1); |
||||
| 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 | * @copyright XOOPS https://xoops.org |
||||
| 14 | * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||||
| 15 | * @author XOOPS https://xoops.org |
||||
| 16 | */ |
||||
| 17 | |||||
| 18 | use Xmf\Request; |
||||
|
0 ignored issues
–
show
|
|||||
| 19 | use XoopsModules\Suico\{ |
||||
| 20 | FriendrequestHandler |
||||
| 21 | }; |
||||
| 22 | |||||
| 23 | /** |
||||
| 24 | * CSS & JS |
||||
| 25 | */ |
||||
| 26 | $xoTheme->addStylesheet( |
||||
| 27 | XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/css/suico.css' |
||||
| 28 | ); |
||||
| 29 | $xoTheme->addStylesheet( |
||||
| 30 | XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/css/suicob4.css' |
||||
| 31 | ); |
||||
| 32 | $xoTheme->addStylesheet( |
||||
| 33 | XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/css/pagination.css' |
||||
| 34 | ); |
||||
| 35 | $xoTheme->addStylesheet( |
||||
| 36 | XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/css/magnific-popup.css' |
||||
| 37 | ); |
||||
| 38 | $xoTheme->addScript(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/js/jquery.magnific-popup.js'); |
||||
| 39 | $xoTheme->addScript(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/js/suico.js'); |
||||
| 40 | //$xoTheme->addScript(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/js/crud.js'); |
||||
| 41 | //if (mb_stripos($_SERVER['REQUEST_URI'], 'memberslist.php')) { |
||||
| 42 | // if ('datatables' == $xoopsModuleConfig['memberslisttemplate']) { |
||||
| 43 | $xoTheme->addStylesheet(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/css/jquery.dataTables.css'); |
||||
| 44 | $xoTheme->addStylesheet(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/css/responsive.dataTables.min.css'); |
||||
| 45 | $xoTheme->addScript(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/js/jquery.dataTables.js'); |
||||
| 46 | $xoTheme->addScript(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/js/dataTables.responsive.min.js'); |
||||
| 47 | //} |
||||
| 48 | //} |
||||
| 49 | //permissions |
||||
| 50 | $xoopsTpl->assign('allow_notes', $controller->checkPrivilegeBySection('notes')); |
||||
| 51 | $xoopsTpl->assign('allow_friends', $controller->checkPrivilegeBySection('friends')); |
||||
| 52 | $xoopsTpl->assign('allow_groups', $controller->checkPrivilegeBySection('groups')); |
||||
| 53 | $xoopsTpl->assign('allow_pictures', $controller->checkPrivilegeBySection('pictures')); |
||||
| 54 | $xoopsTpl->assign('allow_videos', $controller->checkPrivilegeBySection('videos')); |
||||
| 55 | $xoopsTpl->assign('allow_audios', $controller->checkPrivilegeBySection('audio')); |
||||
| 56 | $xoopsTpl->assign('allow_profile_contact', $controller->checkPrivilege('profile_contact') ? 1 : 0); |
||||
| 57 | $xoopsTpl->assign('allow_profile_general', $controller->checkPrivilege('profile_general') ? 1 : 0); |
||||
| 58 | $xoopsTpl->assign('allow_profile_stats', $controller->checkPrivilege('profile_stats') ? 1 : 0); |
||||
| 59 | //Owner data |
||||
| 60 | $xoopsTpl->assign('uid_owner', $controller->uidOwner); |
||||
| 61 | $xoopsTpl->assign('owner_uname', $controller->nameOwner); |
||||
| 62 | $xoopsTpl->assign('isOwner', $controller->isOwner); |
||||
| 63 | $xoopsTpl->assign('isAnonym', $controller->isAnonym); |
||||
| 64 | $xoopsTpl->assign('isUser', $controller->isUser); |
||||
| 65 | $xoopsTpl->assign('isFriend', $controller->isFriend); |
||||
| 66 | //Is Webmaster/Administrator |
||||
| 67 | if ($xoopsUser && $xoopsUser->isAdmin(1)) { |
||||
| 68 | $xoopsTpl->assign('isWebmaster', '1'); |
||||
| 69 | } else { |
||||
| 70 | $xoopsTpl->assign('isWebmaster', '0'); |
||||
| 71 | } |
||||
| 72 | /** |
||||
| 73 | * Fetching numbers of groups friends videos pictures etc... |
||||
| 74 | */ |
||||
| 75 | $xoopsTpl->assign('countGroups', $nbSections['countGroups']); |
||||
| 76 | $xoopsTpl->assign('countPhotos', $nbSections['countPhotos']); |
||||
| 77 | $xoopsTpl->assign('countVideos', $nbSections['countVideos']); |
||||
| 78 | $xoopsTpl->assign('countNotes', $nbSections['countNotes']); |
||||
| 79 | $xoopsTpl->assign('countFriends', $nbSections['countFriends']); |
||||
| 80 | $xoopsTpl->assign('countAudio', $nbSections['countAudios']); |
||||
| 81 | //navbar |
||||
| 82 | $xoopsTpl->assign('module_name', $xoopsModule->getVar('name')); |
||||
| 83 | $xoopsTpl->assign('lang_home', _MD_SUICO_HOME); |
||||
| 84 | $xoopsTpl->assign('lang_photos', _MD_SUICO_PHOTOS); |
||||
| 85 | $xoopsTpl->assign('lang_friends', _MD_SUICO_FRIENDS); |
||||
| 86 | $xoopsTpl->assign('lang_audio', _MD_SUICO_AUDIOS); |
||||
| 87 | $xoopsTpl->assign('lang_videos', _MD_SUICO_VIDEOS); |
||||
| 88 | $xoopsTpl->assign('lang_notebook', _MD_SUICO_NOTEBOOK); |
||||
| 89 | $xoopsTpl->assign('lang_profile', _MD_SUICO_PROFILE); |
||||
| 90 | $xoopsTpl->assign('lang_groups', _MD_SUICO_GROUPS); |
||||
| 91 | $xoopsTpl->assign('lang_configs', _MD_SUICO_CONFIGS_TITLE); |
||||
| 92 | //xoopsToken |
||||
| 93 | $xoopsTpl->assign('token', $GLOBALS['xoopsSecurity']->getTokenHTML()); |
||||
| 94 | //page atributes |
||||
| 95 | $xoopsTpl->assign( |
||||
| 96 | 'xoops_pagetitle', |
||||
| 97 | sprintf(_MD_SUICO_PAGETITLE, $xoopsModule->getVar('name'), $controller->nameOwner) |
||||
| 98 | ); |
||||
| 99 | //Navbar User Info |
||||
| 100 | $avatar = $controller->owner->getVar('user_avatar'); |
||||
| 101 | $memberHandler = xoops_getHandler('member'); |
||||
| 102 | $thisUser = $memberHandler->getUser($controller->uidOwner); |
||||
|
0 ignored issues
–
show
The method
getUser() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsAvatarHandler or XoopsPersistableObjectHandler.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 103 | $myts = \MyTextSanitizer::getInstance(); |
||||
| 104 | $xoopsTpl->assign('user_uname', $thisUser->getVar('uname')); |
||||
| 105 | $xoopsTpl->assign('user_realname', $thisUser->getVar('name')); |
||||
| 106 | $xoopsTpl->assign('lang_uname', _US_NICKNAME); |
||||
| 107 | $xoopsTpl->assign('lang_website', _US_WEBSITE); |
||||
| 108 | $userwebsite = ('' != $thisUser->getVar('url', 'E')) ? '<a href="' . $thisUser->getVar('url', 'E') . '" target="_blank">' . $thisUser->getVar('url') . '</a>' : ''; |
||||
| 109 | $xoopsTpl->assign('user_websiteurl', $userwebsite); |
||||
| 110 | $xoopsTpl->assign('lang_email', _US_EMAIL); |
||||
| 111 | $xoopsTpl->assign('lang_privmsg', _US_PM); |
||||
| 112 | $xoopsTpl->assign('user_viewemail', $thisUser->getVar('user_viewemail', 'E')); |
||||
| 113 | if (1 == $thisUser->getVar('user_viewemail')) { |
||||
| 114 | $xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E')); |
||||
| 115 | } else { |
||||
| 116 | $xoopsTpl->assign('user_email', ' '); |
||||
| 117 | } |
||||
| 118 | $xoopsTpl->assign('lang_location', _US_LOCATION); |
||||
| 119 | $xoopsTpl->assign('user_location', $thisUser->getVar('user_from')); |
||||
| 120 | $xoopsTpl->assign('lang_occupation', _US_OCCUPATION); |
||||
| 121 | $xoopsTpl->assign('user_occupation', $thisUser->getVar('user_occ')); |
||||
| 122 | $xoopsTpl->assign('avatar_url', $avatar); |
||||
| 123 | $xoopsTpl->assign('lang_selectavatar', _MD_SUICO_SELECTAVATAR); |
||||
| 124 | $xoopsTpl->assign('lang_noavatar', _MD_SUICO_NOAVATARYET); |
||||
| 125 | $xoopsTpl->assign('user_onlinestatus', $thisUser->isOnline()); |
||||
| 126 | $xoopsTpl->assign('lang_onlinestatus', _MD_SUICO_ONLINESTATUS); |
||||
| 127 | /** |
||||
| 128 | * Filter for new friend request |
||||
| 129 | */ |
||||
| 130 | if ($xoopsUser) { |
||||
| 131 | $friendrequest = 0; |
||||
| 132 | if (1 === $controller->isOwner) { |
||||
| 133 | $criteria_uidrequest = new Criteria('friendrequestto_uid', $controller->uidOwner); |
||||
| 134 | $newFriendrequest = $controller->friendrequestFactory->getObjects($criteria_uidrequest); |
||||
| 135 | if ($newFriendrequest) { |
||||
| 136 | $countFriendrequests = count($newFriendrequest); |
||||
| 137 | $friendrequesterHandler = xoops_getHandler('member'); |
||||
| 138 | $friendrequester = $friendrequesterHandler->getUser($newFriendrequest[0]->getVar('requester_uid')); |
||||
| 139 | $friendrequester_uid = $friendrequester->getVar('uid'); |
||||
| 140 | $friendrequester_uname = $friendrequester->getVar('uname'); |
||||
| 141 | $friendrequester_avatar = $friendrequester->getVar('user_avatar'); |
||||
| 142 | $friendrequest_id = $newFriendrequest[0]->getVar('friendreq_id'); |
||||
| 143 | $friendrequest = 1; |
||||
| 144 | } |
||||
| 145 | } |
||||
| 146 | $criteria_friends = new Criteria('friend1_uid', $controller->uidOwner); |
||||
| 147 | $criteriaIsfriend = new CriteriaCompo(new Criteria('friend2_uid', $xoopsUser->getVar('uid'))); |
||||
| 148 | $criteriaIsfriend->add($criteria_friends); |
||||
| 149 | $controller->isFriend = $controller->friendshipsFactory->getCount($criteriaIsfriend); |
||||
| 150 | $xoopsTpl->assign('isFriend', $controller->isFriend); |
||||
| 151 | $friendrequestFactory = new FriendrequestHandler($xoopsDB); |
||||
| 152 | $criteria_selfrequest = new Criteria('friendrequester_uid', $xoopsUser->getVar('uid')); |
||||
| 153 | $criteria_isselfrequest = new CriteriaCompo(new Criteria('friendrequestto_uid', $controller->uidOwner)); |
||||
| 154 | $criteria_isselfrequest->add($criteria_selfrequest); |
||||
| 155 | $controller->isSelfRequest = $friendrequestFactory->getCount($criteria_isselfrequest); |
||||
| 156 | $xoopsTpl->assign('selffriendrequest', $controller->isSelfRequest); |
||||
| 157 | if ($controller->isSelfRequest > 0) { |
||||
| 158 | $xoopsTpl->assign('self_uid', $xoopsUser->getVar('uid')); |
||||
| 159 | } |
||||
| 160 | $xoopsTpl->assign('lang_myfriend', _MD_SUICO_MYFRIEND); |
||||
| 161 | $xoopsTpl->assign('lang_friendrequestsent', _MD_SUICO_FRIENDREQUEST_SENT); |
||||
| 162 | $xoopsTpl->assign('lang_friendshipstatus', _MD_SUICO_FRIENDSHIP_STATUS); |
||||
| 163 | $criteria_otherrequest = new Criteria('friendrequester_uid', $controller->uidOwner); |
||||
| 164 | $criteria_isotherrequest = new CriteriaCompo(new Criteria('friendrequestto_uid', $xoopsUser->getVar('uid'))); |
||||
| 165 | $criteria_isotherrequest->add($criteria_otherrequest); |
||||
| 166 | $controller->isOtherRequest = $friendrequestFactory->getCount($criteria_isotherrequest); |
||||
| 167 | $xoopsTpl->assign('otherfriendrequest', $controller->isOtherRequest); |
||||
| 168 | if ($controller->isOtherRequest > 0) { |
||||
| 169 | $xoopsTpl->assign('other_uid', $controller->uidOwner); |
||||
| 170 | } |
||||
| 171 | } |
||||
| 172 | $evaluation = $controller->friendshipsFactory->getMoyennes($controller->uidOwner); |
||||
| 173 | //evaluations |
||||
| 174 | $xoopsTpl->assign('lang_fans', _MD_SUICO_FANS); |
||||
| 175 | $xoopsTpl->assign('countFans', $evaluation['sumfan']); |
||||
| 176 | $xoopsTpl->assign('lang_funny', _MD_SUICO_FUNNY); |
||||
| 177 | $xoopsTpl->assign('funny', $evaluation['mediatrust']); |
||||
| 178 | $xoopsTpl->assign('funny_rest', 48 - $evaluation['mediatrust']); |
||||
| 179 | $xoopsTpl->assign('lang_friendly', _MD_SUICO_FRIENDLY); |
||||
| 180 | $xoopsTpl->assign('friendly', $evaluation['mediahot']); |
||||
| 181 | $xoopsTpl->assign('friendly_rest', 48 - $evaluation['mediahot']); |
||||
| 182 | $xoopsTpl->assign('lang_cool', _MD_SUICO_COOL); |
||||
| 183 | $xoopsTpl->assign('cool', $evaluation['mediacool']); |
||||
| 184 | $xoopsTpl->assign('cool_rest', 48 - $evaluation['mediacool']); |
||||
| 185 | $xoopsTpl->assign('allow_fanssevaluation', $helper->getConfig('allow_fanssevaluation')); |
||||
| 186 | $xoopsTpl->assign('lang_askusertobefriend', _MD_SUICO_ASKBEFRIEND); |
||||
| 187 | $xoopsTpl->assign('lang_addfriend', _MD_SUICO_ADDFRIEND); |
||||
| 188 | $xoopsTpl->assign('lang_friendrequestpending', _MD_SUICO_FRIENDREQUEST_PENDING); |
||||
| 189 | $xoopsTpl->assign('lang_cancelfriendrequest', _MD_SUICO_FRIENDREQUEST_CANCEL); |
||||
| 190 | $xoopsTpl->assign('lang_myfriend', _MD_SUICO_MYFRIEND); |
||||
| 191 | $xoopsTpl->assign('lang_friendrequestsent', _MD_SUICO_FRIENDREQUEST_SENT); |
||||
| 192 | $xoopsTpl->assign('lang_acceptfriend', _MD_SUICO_FRIEND_ACCEPT); |
||||
| 193 | $xoopsTpl->assign('lang_rejectfriend', _MD_SUICO_FRIEND_REJECT); |
||||
| 194 | // Member Suspension |
||||
| 195 | $xoopsTpl->assign('allow_usersuspension', $xoopsModuleConfig['allow_usersuspension']); |
||||
| 196 | $xoopsTpl->assign('lang_suspensionadmin', _MD_SUICO_SUSPENSIONADMIN); |
||||
| 197 | if (0 === $controller->isSuspended) { |
||||
| 198 | $xoopsTpl->assign('isSuspended', 0); |
||||
| 199 | $xoopsTpl->assign('lang_suspend', _MD_SUICO_SUSPENDUSER); |
||||
| 200 | $xoopsTpl->assign('lang_timeinseconds', _MD_SUICO_SUSPENDTIME); |
||||
| 201 | } else { |
||||
| 202 | $xoopsTpl->assign('lang_unsuspend', _MD_SUICO_UNSUSPEND); |
||||
| 203 | $xoopsTpl->assign('isSuspended', 1); |
||||
| 204 | $xoopsTpl->assign('lang_suspended', _MD_SUICO_USER_SUSPENDED); |
||||
| 205 | } |
||||
| 206 | $xoopsTpl->assign('groupsperpage', $xoopsModuleConfig['groupsperpage']); |
||||
| 207 | //Memberslist and Search Members |
||||
| 208 | $xoopsTpl->assign('displayrealname', $xoopsModuleConfig['displayrealname']); |
||||
| 209 | $xoopsTpl->assign('displayemail', $xoopsModuleConfig['displayemail']); |
||||
| 210 | $xoopsTpl->assign('displaypm', $xoopsModuleConfig['displaypm']); |
||||
| 211 | $xoopsTpl->assign('displayurl', $xoopsModuleConfig['displayurl']); |
||||
| 212 | $xoopsTpl->assign('displayavatar', $xoopsModuleConfig['displayavatar']); |
||||
| 213 | $xoopsTpl->assign('displayregdate', $xoopsModuleConfig['displayregdate']); |
||||
| 214 | $xoopsTpl->assign('displayfrom', $xoopsModuleConfig['displayfrom']); |
||||
| 215 | $xoopsTpl->assign('displayposts', $xoopsModuleConfig['displayposts']); |
||||
| 216 | $xoopsTpl->assign('displaylastlogin', $xoopsModuleConfig['displaylastlogin']); |
||||
| 217 | $xoopsTpl->assign('displayoccupation', $xoopsModuleConfig['displayoccupation']); |
||||
| 218 | $xoopsTpl->assign('displayinterest', $xoopsModuleConfig['displayinterest']); |
||||
| 219 | $xoopsTpl->assign('displaylatestmember', $xoopsModuleConfig['displaylatestmember']); |
||||
| 220 | $xoopsTpl->assign('displaywelcomemessage', $xoopsModuleConfig['displaywelcomemessage']); |
||||
| 221 | $xoopsTpl->assign('displaybreadcrumb', $xoopsModuleConfig['displaybreadcrumb']); |
||||
| 222 | $xoopsTpl->assign('displaytotalmember', $xoopsModuleConfig['displaytotalmember']); |
||||
| 223 | $xoopsTpl->assign('displaysignature', $xoopsModuleConfig['displaysignature']); |
||||
| 224 | $xoopsTpl->assign('displayrank', $xoopsModuleConfig['displayrank']); |
||||
| 225 | $xoopsTpl->assign('displaygroups', $xoopsModuleConfig['displaygroups']); |
||||
| 226 | $xoopsTpl->assign('displayonlinestatus', $xoopsModuleConfig['displayonlinestatus']); |
||||
| 227 | $xoopsTpl->assign('displayextrainfo', $xoopsModuleConfig['displayextrainfo']); |
||||
| 228 | $xoopsTpl->assign('membersperpage', $xoopsModuleConfig['membersperpage']); |
||||
| 229 | $xoopsTpl->assign('memberslisttemplate', $xoopsModuleConfig['memberslisttemplate']); |
||||
| 230 |
Let?s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let?s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: