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 | * Module: XoopsTube |
||||
4 | * |
||||
5 | * You may not change or alter any portion of this comment or credits |
||||
6 | * of supporting developers from this source code or any supporting source code |
||||
7 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||||
8 | * |
||||
9 | * PHP version 5 |
||||
10 | * |
||||
11 | * @category Module |
||||
12 | * @package Xoopstube |
||||
13 | * @author XOOPS Development Team |
||||
14 | * @copyright 2001-2016 XOOPS Project (https://xoops.org) |
||||
15 | * @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||||
16 | * @link https://xoops.org/ |
||||
17 | * @since 1.0.6 |
||||
18 | */ |
||||
19 | |||||
20 | use Xmf\Module\Admin; |
||||
21 | use Xmf\Request; |
||||
22 | use XoopsModules\Xoopstube\{ |
||||
23 | Lists, |
||||
24 | Utility |
||||
25 | }; |
||||
26 | |||||
27 | require_once __DIR__ . '/admin_header.php'; |
||||
28 | |||||
29 | //Utility::prepareFolder(XOOPSTUBE_UPLOAD_PATH); |
||||
30 | //Utility::prepareFolder(XOOPSTUBE_ATTACHED_FILES_PATH); |
||||
31 | //Utility::prepareFolder(XOOPSTUBE_PICTURES_PATH); |
||||
32 | //Utility::prepareFolder(XOOPSTUBE_CSV_PATH); |
||||
33 | //Utility::prepareFolder(XOOPSTUBE_CACHE_PATH); |
||||
34 | //Utility::prepareFolder(XOOPSTUBE_TEXT_PATH); |
||||
35 | |||||
36 | $op = $op = Request::getString('op', Request::getCmd('op', '', 'POST'), 'GET'); //cleanRequestVars($_REQUEST, 'op', ''); |
||||
37 | //$cid = cleanRequestVars( $_REQUEST, 'cid', 0 ); |
||||
38 | |||||
39 | switch (mb_strtolower($op)) { |
||||
40 | case 'save': |
||||
41 | $indexheading = Request::getString('indexheading', '', 'POST'); //$myts->addslashes(xoops_trim($_REQUEST['indexheading'])); |
||||
42 | $indexheader = Request::getText('indexheader', '', 'POST'); //$myts->addslashes(xoops_trim($_REQUEST['indexheader'])); |
||||
43 | $indexfooter = Request::getText('indexfooter', '', 'POST'); //$myts->addslashes(xoops_trim($_REQUEST['indexfooter'])); |
||||
44 | $indeximage = Request::getString('indeximage', '', 'POST'); //$myts->addslashes($_REQUEST['indeximage']); |
||||
45 | |||||
46 | $nohtml = Request::getInt('nohtml', 0, 'POST'); //isset($_REQUEST['nohtml']) ? 1 : 0; |
||||
47 | $nosmiley = Request::getInt('nosmiley', 0, 'POST'); //isset($_REQUEST['nosmiley']) ? 1 : 0; |
||||
48 | $noxcodes = Request::getInt('noxcodes', 0, 'POST'); //isset($_REQUEST['noxcodes']) ? 1 : 0; |
||||
49 | $noimages = Request::getInt('noimages', 0, 'POST'); //isset($_REQUEST['noimages']) ? 1 : 0; |
||||
50 | $nobreak = Request::getInt('nobreak', 0, 'POST'); //isset($_REQUEST['nobreak']) ? 1 : 0; |
||||
51 | |||||
52 | $indexheaderalign = Request::getString('indexheaderalign', '', 'POST'); //$myts->addslashes($_REQUEST['indexheaderalign']); |
||||
53 | $indexfooteralign = Request::getString('indexfooteralign', '', 'POST'); //$myts->addslashes($_REQUEST['indexfooteralign']); |
||||
54 | $lastvideosyn = Request::getInt('lastvideosyn', 0, 'POST'); //$_REQUEST['lastvideosyn']; |
||||
55 | $lastvideostotal = Request::getString('lastvideostotal', '', 'POST'); //$myts->addslashes($_REQUEST['lastvideostotal']); |
||||
56 | $sql = 'UPDATE ' |
||||
57 | . $GLOBALS['xoopsDB']->prefix('xoopstube_indexpage') |
||||
58 | . " SET indexheading='$indexheading', indexheader='$indexheader', indexfooter='$indexfooter', indeximage='$indeximage', indexheaderalign='$indexheaderalign', indexfooteralign='$indexfooteralign', nohtml='$nohtml', nosmiley='$nosmiley', noxcodes='$noxcodes', noimages='$noimages', nobreak='$nobreak', lastvideosyn='$lastvideosyn', lastvideostotal='$lastvideostotal'"; |
||||
59 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
||||
60 | /** @var \XoopsLogger $logger */ |
||||
61 | $logger = \XoopsLogger::getInstance(); |
||||
62 | $logger->handleError(E_USER_WARNING, $sql, __FILE__, __LINE__); |
||||
63 | |||||
64 | return false; |
||||
65 | } |
||||
66 | redirect_header('index.php', 1, _AM_XOOPSTUBE_IPAGE_UPDATED); |
||||
67 | break; |
||||
68 | default: |
||||
69 | $sql = 'SELECT indeximage, indexheading, indexheader, indexfooter, nohtml, nosmiley, noxcodes, noimages, nobreak, indexheaderalign, indexfooteralign, lastvideosyn, lastvideostotal FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_indexpage'); |
||||
70 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
||||
71 | /** @var \XoopsLogger $logger */ |
||||
72 | $logger = \XoopsLogger::getInstance(); |
||||
73 | $logger->handleError(E_USER_WARNING, $sql, __FILE__, __LINE__); |
||||
74 | |||||
75 | return false; |
||||
76 | } |
||||
77 | [$indeximage, $indexheading, $indexheader, $indexfooter, $nohtml, $nosmiley, $noxcodes, $noimages, $nobreak, $indexheaderalign, $indexfooteralign, $lastvideosyn, $lastvideostotal] = $GLOBALS['xoopsDB']->fetchrow($result); |
||||
78 | |||||
79 | xoops_cp_header(); |
||||
80 | //renderAdminMenu( _AM_XOOPSTUBE_INDEXPAGE ); |
||||
81 | $adminObject = Admin::getInstance(); |
||||
82 | $adminObject->displayNavigation(basename(__FILE__)); |
||||
83 | |||||
84 | echo ' |
||||
85 | <fieldset style="border: #e8e8e8 1px solid;"> |
||||
86 | <legend style="display: inline; font-weight: bold; color: #0A3760;">' . _AM_XOOPSTUBE_IPAGE_INFORMATION . '</legend> |
||||
87 | <div style="padding: 8px;"> |
||||
88 | <img src="' . XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icon/indexpage.png" alt="" style="float: left; padding-right: 10px;"> |
||||
89 | ' . _AM_XOOPSTUBE_MINDEX_PAGEINFOTXT . '</div> |
||||
90 | </fieldset><br>'; |
||||
91 | |||||
92 | $sform = new \XoopsThemeForm(_AM_XOOPSTUBE_IPAGE_MODIFY, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true); |
||||
93 | $sform->addElement(new \XoopsFormText(_AM_XOOPSTUBE_IPAGE_CTITLE, 'indexheading', 60, 60, $indexheading), false); |
||||
94 | $graph_array = Lists:: getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $GLOBALS['xoopsModuleConfig']['mainimagedir'], $type = 'images'); |
||||
95 | $indexImageSelect = new \XoopsFormSelect('', 'indeximage', $indeximage); |
||||
96 | $indexImageSelect->addOptionArray($graph_array); |
||||
97 | $indexImageSelect->setExtra("onchange='showImgSelected(\"image\", \"indeximage\", \"" . $GLOBALS['xoopsModuleConfig']['mainimagedir'] . '", "", "' . XOOPS_URL . "\")'"); |
||||
98 | $indeximage_tray = new \XoopsFormElementTray(_AM_XOOPSTUBE_IPAGE_CIMAGE, ' '); |
||||
99 | $indeximage_tray->addElement($indexImageSelect); |
||||
100 | if (!empty($indeximage)) { |
||||
101 | $indeximage_tray->addElement(new \XoopsFormLabel('', '<br><br><img src="' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['mainimagedir'] . '/' . $indeximage . '" name="image" id="image" alt="">')); |
||||
102 | } else { |
||||
103 | $indeximage_tray->addElement(new \XoopsFormLabel('', '<br><br><img src="' . XOOPS_URL . '/uploads/blank.gif" name="image" id="image" alt="">')); |
||||
104 | } |
||||
105 | $sform->addElement($indeximage_tray); |
||||
106 | |||||
107 | // $editor = xtube_getWysiwygForm(_AM_XOOPSTUBE_IPAGE_CHEADING, 'indexheader', $indexheader, 15, 60, ''); |
||||
108 | // $sform->addElement($editor, false); |
||||
109 | |||||
110 | $optionsTrayNote = new \XoopsFormElementTray(_AM_XOOPSTUBE_IPAGE_CHEADING, '<br>'); |
||||
111 | if (class_exists('XoopsFormEditor')) { |
||||
112 | $options['name'] = 'indexheader'; |
||||
113 | $options['value'] = $indexheader; |
||||
114 | $options['rows'] = 5; |
||||
115 | $options['cols'] = '100%'; |
||||
116 | $options['width'] = '100%'; |
||||
117 | $options['height'] = '200px'; |
||||
118 | $editor = new \XoopsFormEditor('', $GLOBALS['xoopsModuleConfig']['form_optionsuser'], $options, $nohtml = false, $onfailure = 'textarea'); |
||||
119 | $optionsTrayNote->addElement($editor); |
||||
120 | } else { |
||||
121 | $editor = new \XoopsFormDhtmlTextArea('', 'indexheader', $item->getVar('indexheader', 'e'), '100%', '100%'); |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() '100%' of type string is incompatible with the type integer expected by parameter $cols of XoopsFormDhtmlTextArea::__construct() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
122 | $optionsTrayNote->addElement($editor); |
||||
123 | } |
||||
124 | |||||
125 | $sform->addElement($optionsTrayNote, false); |
||||
126 | |||||
127 | $headeralign_select = new \XoopsFormSelect(_AM_XOOPSTUBE_IPAGE_CHEADINGA, 'indexheaderalign', $indexheaderalign); |
||||
128 | $headeralign_select->addOptionArray( |
||||
129 | [ |
||||
130 | 'left' => _AM_XOOPSTUBE_IPAGE_CLEFT, |
||||
131 | 'right' => _AM_XOOPSTUBE_IPAGE_CRIGHT, |
||||
132 | 'center' => _AM_XOOPSTUBE_IPAGE_CCENTER, |
||||
133 | ] |
||||
134 | ); |
||||
135 | $sform->addElement($headeralign_select); |
||||
136 | $sform->addElement(new \XoopsFormTextArea(_AM_XOOPSTUBE_IPAGE_CFOOTER, 'indexfooter', $indexfooter, 10, 60)); |
||||
137 | $footeralign_select = new \XoopsFormSelect(_AM_XOOPSTUBE_IPAGE_CFOOTERA, 'indexfooteralign', $indexfooteralign); |
||||
138 | $footeralign_select->addOptionArray( |
||||
139 | [ |
||||
140 | 'left' => _AM_XOOPSTUBE_IPAGE_CLEFT, |
||||
141 | 'right' => _AM_XOOPSTUBE_IPAGE_CRIGHT, |
||||
142 | 'center' => _AM_XOOPSTUBE_IPAGE_CCENTER, |
||||
143 | ] |
||||
144 | ); |
||||
145 | $sform->addElement($footeralign_select); |
||||
146 | |||||
147 | $options_tray = new \XoopsFormElementTray(_AM_XOOPSTUBE_TEXTOPTIONS, '<br>'); |
||||
148 | //html option |
||||
149 | $html_checkbox = new \XoopsFormCheckBox('', 'nohtml', $nohtml); |
||||
150 | $html_checkbox->addOption(1, _AM_XOOPSTUBE_DISABLEHTML); |
||||
151 | $options_tray->addElement($html_checkbox); |
||||
152 | //smiley option |
||||
153 | $smiley_checkbox = new \XoopsFormCheckBox('', 'nosmiley', $nosmiley); |
||||
154 | $smiley_checkbox->addOption(1, _AM_XOOPSTUBE_DISABLESMILEY); |
||||
155 | $options_tray->addElement($smiley_checkbox); |
||||
156 | //xcodes option |
||||
157 | $xcodes_checkbox = new \XoopsFormCheckBox('', 'noxcodes', $noxcodes); |
||||
158 | $xcodes_checkbox->addOption(1, _AM_XOOPSTUBE_DISABLEXCODE); |
||||
159 | $options_tray->addElement($xcodes_checkbox); |
||||
160 | //noimages option |
||||
161 | $noimages_checkbox = new \XoopsFormCheckBox('', 'noimages', $noimages); |
||||
162 | $noimages_checkbox->addOption(1, _AM_XOOPSTUBE_DISABLEIMAGES); |
||||
163 | $options_tray->addElement($noimages_checkbox); |
||||
164 | //breaks option |
||||
165 | $breaks_checkbox = new \XoopsFormCheckBox('', 'nobreak', $nobreak); |
||||
166 | $breaks_checkbox->addOption(1, _AM_XOOPSTUBE_DISABLEBREAK); |
||||
167 | $options_tray->addElement($breaks_checkbox); |
||||
168 | $sform->addElement($options_tray); |
||||
169 | |||||
170 | $sform->addElement(new \XoopsFormRadioYN(_AM_XOOPSTUBE_IPAGE_SHOWLATEST, 'lastvideosyn', $lastvideosyn, ' ' . _YES . '', ' ' . _NO . '')); |
||||
171 | |||||
172 | $lastvideostotalform = new \XoopsFormText(_AM_XOOPSTUBE_IPAGE_LATESTTOTAL, 'lastvideostotal', 2, 2, $lastvideostotal); |
||||
173 | $lastvideostotalform->setDescription('<span style="font-size: small;">' . _AM_XOOPSTUBE_IPAGE_LATESTTOTAL_DSC . '</span>'); |
||||
174 | $sform->addElement($lastvideostotalform, false); |
||||
175 | |||||
176 | $buttonTray = new \XoopsFormElementTray('', ''); |
||||
177 | $hidden = new \XoopsFormHidden('op', 'save'); |
||||
178 | $buttonTray->addElement($hidden); |
||||
179 | $buttonTray->addElement(new \XoopsFormButton('', 'post', _AM_XOOPSTUBE_BSAVE, 'submit')); |
||||
180 | $sform->addElement($buttonTray); |
||||
181 | $sform->display(); |
||||
182 | break; |
||||
183 | } |
||||
184 | require_once __DIR__ . '/admin_footer.php'; |
||||
185 |