mambax7 /
pedigree
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 |
||||
| 2 | /* ------------------------------------------------------------------------ |
||||
| 3 | pedigree |
||||
| 4 | Copyright 2004, James Cotton |
||||
| 5 | http://www.dobermannvereniging.nl |
||||
| 6 | ------------------------------------------------------------------------ |
||||
| 7 | ------------------------------------------------------------------------ |
||||
| 8 | This program is free software; you can redistribute it and/or modify |
||||
| 9 | it under the terms of the GNU General Public License as published by |
||||
| 10 | the Free Software Foundation; either version 2 of the License, or |
||||
| 11 | (at your option) any later version. |
||||
| 12 | |||||
| 13 | You may not change or alter any portion of this comment or credits |
||||
| 14 | of supporting developers from this source code or any supporting |
||||
| 15 | source code which is considered copyrighted (c) material of the |
||||
| 16 | original comment or credit authors. |
||||
| 17 | |||||
| 18 | This program is distributed in the hope that it will be useful, |
||||
| 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
| 21 | GNU General Public License for more details. |
||||
| 22 | |||||
| 23 | You should have received a copy of the GNU General Public License |
||||
| 24 | along with this program; if not, write to the Free Software |
||||
| 25 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||||
| 26 | ------------------------------------------------------------------------ |
||||
| 27 | */ |
||||
| 28 | |||||
| 29 | /** |
||||
| 30 | * @package XoopsModules\Pedigree |
||||
| 31 | * @copyright Copyright 2004, James Cotton <https://www.dobermannvereniging.nl> |
||||
| 32 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||||
| 33 | * @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
||||
| 34 | * @author XOOPS Module Dev Team |
||||
| 35 | */ |
||||
| 36 | |||||
| 37 | use XoopsModules\Pedigree\{ |
||||
| 38 | Helper, |
||||
| 39 | Utility |
||||
| 40 | }; |
||||
| 41 | |||||
| 42 | // Include any constants used for internationalizing templates. |
||||
| 43 | $moduleDirName = \basename(\dirname(__DIR__)); |
||||
| 44 | $helper = Helper::getInstance(); |
||||
| 45 | $helper->loadLanguage('main'); |
||||
| 46 | |||||
| 47 | // Include any common code for this module. |
||||
| 48 | require_once $helper->path('include/common.php'); |
||||
| 49 | |||||
| 50 | /** |
||||
| 51 | * @return XoopsTpl |
||||
| 52 | * @todo: move hard coded language strings to language file |
||||
| 53 | * |
||||
| 54 | */ |
||||
| 55 | function menu_block() |
||||
| 56 | { |
||||
| 57 | $moduleDirName = basename(\dirname(__DIR__)); |
||||
|
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||||
| 58 | $helper = Helper::getInstance(); |
||||
| 59 | |||||
| 60 | //colour variables |
||||
| 61 | [$actlink, $even, $odd, $text, $hovlink, $head, $body, $title] = Utility::getColourScheme(); |
||||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||||
| 62 | /* |
||||
| 63 | $actlink = $colors[0]; |
||||
| 64 | $even = $colors[1]; |
||||
| 65 | $odd = $colors[2]; |
||||
| 66 | $text = $colors[3]; |
||||
| 67 | $hovlink = $colors[4]; |
||||
| 68 | $head = $colors[5]; |
||||
| 69 | $body = $colors[6]; |
||||
| 70 | $title = $colors[7]; |
||||
| 71 | */ |
||||
| 72 | /* |
||||
| 73 | //inline-css |
||||
| 74 | echo '<style>'; |
||||
| 75 | //text-colour |
||||
| 76 | echo 'body {margin: 0;padding: 0;background: ' . $body . ';color: ' . $text . ";font-size: 62.5%; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; text-align: left;}"; |
||||
| 77 | //link-colour |
||||
| 78 | echo 'a, h2 a:hover, h3 a:hover { color: ' . $actlink . '; text-decoration: none; }'; |
||||
| 79 | //link hover colour |
||||
| 80 | echo 'a:hover { color: ' . $hovlink . '; text-decoration: underline; }'; |
||||
| 81 | //th |
||||
| 82 | echo 'th {padding: 2px;color: #ffffff;background: ' . $title . ';font-family: Verdana, Arial, Helvetica, sans-serif;vertical-align: middle;}'; |
||||
| 83 | echo 'td#centercolumn th { color: #fff; background: ' . $title . '; vertical-align: middle; }'; |
||||
| 84 | //head |
||||
| 85 | echo '.head {background-color: ' . $head . '; padding: 3px; font-weight: normal;}'; |
||||
| 86 | //even |
||||
| 87 | echo '.even {background-color: ' . $even . '; padding: 3px;}'; |
||||
| 88 | echo 'tr.even td {background-color: ' . $even . '; padding: 3px;}'; |
||||
| 89 | //odd |
||||
| 90 | echo '.odd {background-color: ' . $odd . '; padding: 3px;}'; |
||||
| 91 | echo 'tr.odd td {background-color: ' . $odd . '; padding: 3px;}'; |
||||
| 92 | echo '</style>'; |
||||
| 93 | */ |
||||
| 94 | |||||
| 95 | $counter = 1; |
||||
| 96 | $menuwidth = 4; |
||||
| 97 | $x = $_SERVER['SCRIPT_NAME']; |
||||
| 98 | $lastpos = Utility::myStrRpos($x, '/'); |
||||
| 99 | $len = mb_strlen($x); |
||||
| 100 | $curpage = mb_substr($x, $lastpos, $len); |
||||
|
0 ignored issues
–
show
It seems like
$lastpos can also be of type false; however, parameter $start of mb_substr() does only seem to accept integer, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 101 | |||||
| 102 | if (1 == $helper->getConfig('showwelcome')) { |
||||
| 103 | if ('/welcome.php' === $curpage) { |
||||
| 104 | $title = '<b>Welcome</b>'; |
||||
| 105 | } else { |
||||
| 106 | $title = 'Welcome'; |
||||
| 107 | } |
||||
| 108 | $menuarray[] = ['title' => $title, 'link' => 'welcome.php', 'counter' => $counter]; |
||||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||||
| 109 | ++$counter; |
||||
| 110 | if ($counter == $menuwidth) { |
||||
| 111 | $counter = 1; |
||||
| 112 | } |
||||
| 113 | } |
||||
| 114 | if ('/index.php' === $curpage || '/result.php' === $curpage) { |
||||
| 115 | $title = '<b>View/Search ' . $helper->getConfig('animalTypes') . '</b>'; |
||||
| 116 | } else { |
||||
| 117 | $title = 'View/Search ' . $helper->getConfig('animalTypes'); |
||||
| 118 | } |
||||
| 119 | $menuarray[] = ['title' => $title, 'link' => 'index.php', 'counter' => $counter]; |
||||
| 120 | ++$counter; |
||||
| 121 | if ($counter == $menuwidth) { |
||||
| 122 | $counter = 1; |
||||
| 123 | } |
||||
| 124 | if ('/add_dog.php' === $curpage) { |
||||
| 125 | $title = '<b>Add a ' . $helper->getConfig('animalType') . '</b>'; |
||||
| 126 | } else { |
||||
| 127 | $title = 'Add a ' . $helper->getConfig('animalType'); |
||||
| 128 | } |
||||
| 129 | $menuarray[] = ['title' => $title, 'link' => 'add_dog.php', 'counter' => $counter]; |
||||
| 130 | ++$counter; |
||||
| 131 | if ($counter == $menuwidth) { |
||||
| 132 | $counter = 1; |
||||
| 133 | } |
||||
| 134 | if ('1' == $helper->getConfig('uselitter')) { |
||||
| 135 | if ('/add_litter.php' === $curpage) { |
||||
| 136 | $title = '<b>Add a ' . $helper->getConfig('litter') . '</b>'; |
||||
| 137 | } else { |
||||
| 138 | $title = 'Add a ' . $helper->getConfig('litter'); |
||||
| 139 | } |
||||
| 140 | $menuarray[] = ['title' => $title, 'link' => 'add_litter.php', 'counter' => $counter]; |
||||
| 141 | ++$counter; |
||||
| 142 | if ($counter == $menuwidth) { |
||||
| 143 | $counter = 1; |
||||
| 144 | } |
||||
| 145 | } |
||||
| 146 | if ('1' == $helper->getConfig('ownerbreeder')) { |
||||
| 147 | if ('/breeder.php' === $curpage || '/owner.php' === $curpage) { |
||||
| 148 | $title = '<b>View owners/breeders</b>'; |
||||
| 149 | } else { |
||||
| 150 | $title = 'View owners/breeders'; |
||||
| 151 | } |
||||
| 152 | $menuarray[] = ['title' => $title, 'link' => 'breeder.php', 'counter' => $counter]; |
||||
| 153 | ++$counter; |
||||
| 154 | if ($counter == $menuwidth) { |
||||
| 155 | $counter = 1; |
||||
| 156 | } |
||||
| 157 | if ('/add_breeder.php' === $curpage) { |
||||
| 158 | $title = '<b>Add an owner/breeder</b>'; |
||||
| 159 | } else { |
||||
| 160 | $title = 'Add an owner/breeder'; |
||||
| 161 | } |
||||
| 162 | $menuarray[] = ['title' => $title, 'link' => 'add_breeder.php', 'counter' => $counter]; |
||||
| 163 | ++$counter; |
||||
| 164 | if ($counter == $menuwidth) { |
||||
| 165 | $counter = 1; |
||||
| 166 | } |
||||
| 167 | } |
||||
| 168 | if ('/advanced.php' === $curpage) { |
||||
| 169 | $title = '<b>Advanced info</b>'; |
||||
| 170 | } else { |
||||
| 171 | $title = 'Advanced info'; |
||||
| 172 | } |
||||
| 173 | $menuarray[] = ['title' => $title, 'link' => 'advanced.php', 'counter' => $counter]; |
||||
| 174 | ++$counter; |
||||
| 175 | if ($counter == $menuwidth) { |
||||
| 176 | $counter = 1; |
||||
| 177 | } |
||||
| 178 | if ('1' == $helper->getConfig('proversion')) { |
||||
| 179 | if ('/virtual.php' === $curpage) { |
||||
| 180 | $title = '<b>Virtual mating</b>'; |
||||
| 181 | } else { |
||||
| 182 | $title = 'Virtual Mating'; |
||||
| 183 | } |
||||
| 184 | $menuarray[] = ['title' => $title, 'link' => 'virtual.php', 'counter' => $counter]; |
||||
| 185 | ++$counter; |
||||
| 186 | if ($counter == $menuwidth) { |
||||
| 187 | $counter = 1; |
||||
| 188 | } |
||||
| 189 | } |
||||
| 190 | if ('/latest.php' === $curpage) { |
||||
| 191 | $title = '<b>latest additions</b>'; |
||||
| 192 | } else { |
||||
| 193 | $title = 'latest additions'; |
||||
| 194 | } |
||||
| 195 | $menuarray[] = ['title' => $title, 'link' => 'latest.php', 'counter' => $counter]; |
||||
| 196 | ++$counter; |
||||
| 197 | if ($counter == $menuwidth) { |
||||
| 198 | $counter = 1; |
||||
| 199 | } |
||||
| 200 | if (true === $helper->isUserAdmin()) { |
||||
| 201 | if ('/tools.php' === $curpage) { |
||||
| 202 | $title = '<b>Webmaster tools</b>'; |
||||
| 203 | } else { |
||||
| 204 | $title = 'Webmaster tools'; |
||||
| 205 | } |
||||
| 206 | $menuarray[] = ['title' => $title, 'link' => 'tools.php?op=index', 'counter' => $counter]; |
||||
| 207 | ++$counter; |
||||
| 208 | if ($counter == $menuwidth) { |
||||
| 209 | $counter = 1; |
||||
| 210 | } |
||||
| 211 | $title = 'Logout'; |
||||
| 212 | $menuarray[] = ['title' => $title, 'link' => '../../user.php?op=logout', 'counter' => $counter]; |
||||
| 213 | ++$counter; |
||||
| 214 | if ($counter == $menuwidth) { |
||||
| 215 | $counter = 1; |
||||
|
0 ignored issues
–
show
|
|||||
| 216 | } |
||||
| 217 | } else { |
||||
| 218 | if ('/user.php' === $curpage) { |
||||
| 219 | $title = '<b>User login</b>'; |
||||
| 220 | } else { |
||||
| 221 | $title = 'User login'; |
||||
| 222 | } |
||||
| 223 | $menuarray[] = ['title' => $title, 'link' => '../../user.php', 'counter' => $counter]; |
||||
| 224 | ++$counter; |
||||
| 225 | if ($counter == $menuwidth) { |
||||
| 226 | $counter = 1; |
||||
| 227 | } |
||||
| 228 | } |
||||
| 229 | |||||
| 230 | //create path taken |
||||
| 231 | //showpath(); |
||||
| 232 | $GLOBALS['xoopsTpl']->assign('menuarray', $menuarray); |
||||
| 233 | |||||
| 234 | //return the template contents |
||||
| 235 | return $GLOBALS['xoopsTpl']; |
||||
| 236 | } |
||||
| 237 |