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 | * @copyright {@link http://xoops.org/ XOOPS Project} |
||
14 | * @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
||
15 | * @package |
||
16 | * @since |
||
17 | * @author XOOPS Development Team, |
||
18 | * @author GIJ=CHECKMATE (PEAK Corp. http://www.peak.ne.jp/) |
||
19 | */ |
||
20 | |||
21 | require_once __DIR__ . '/../../mainfile.php'; |
||
22 | require_once XOOPS_ROOT_PATH . '/class/template.php'; |
||
23 | |||
24 | error_reporting(0); |
||
25 | $xoopsLogger->activated = false; |
||
26 | |||
27 | // for "Duplicatable" |
||
28 | $moduleDirName = basename(__DIR__); |
||
29 | if (!preg_match('/^(\D+)(\d*)$/', $moduleDirName, $regs)) { |
||
30 | echo('invalid dirname: ' . htmlspecialchars($moduleDirName)); |
||
31 | } |
||
32 | $mydirnumber = $regs[2] === '' ? '' : (int)$regs[2]; |
||
33 | |||
34 | $conn = $GLOBALS['xoopsDB']->conn; |
||
35 | |||
36 | // setting physical & virtual paths |
||
37 | $mod_path = XOOPS_ROOT_PATH . "/modules/$moduleDirName"; |
||
38 | $mod_url = XOOPS_URL . "/modules/$moduleDirName"; |
||
39 | |||
40 | // ���饹������ɤ߹��� |
||
41 | if (!class_exists('APCal_xoops')) { |
||
42 | require_once "$mod_path/class/APCal.php"; |
||
43 | require_once "$mod_path/class/APCal_xoops.php"; |
||
44 | } |
||
45 | |||
46 | // creating an instance of APCal |
||
47 | $cal = new APCal_xoops('', $xoopsConfig['language'], true); |
||
48 | |||
49 | // setting properties of APCal |
||
50 | $cal->conn = $conn; |
||
51 | include "$mod_path/include/read_configs.php"; |
||
52 | $cal->base_url = $mod_url; |
||
53 | $cal->base_path = $mod_path; |
||
54 | $cal->images_url = "$mod_url/assets/images/$skin_folder"; |
||
55 | $cal->images_path = "$mod_path/assets/images/$skin_folder"; |
||
56 | |||
57 | // Include our module's language file |
||
58 | if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/language/' . $xoopsConfig['language'] . '/main.php')) { |
||
59 | require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/language/' . $xoopsConfig['language'] . '/main.php'; |
||
60 | require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/language/' . $xoopsConfig['language'] . '/modinfo.php'; |
||
61 | } else { |
||
62 | require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/language/english/main.php'; |
||
63 | require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/language/english/modinfo.php'; |
||
64 | } |
||
65 | |||
66 | $myts = MyTextSanitizer::getInstance(); |
||
67 | |||
68 | if ($_GET['op'] == 'exportxls') { |
||
69 | header("Content-type: application/vnd-ms-excel; charset=' . _CHARSET"); |
||
70 | // Defines the name of the export file "codelution-export.xls" |
||
71 | header("Content-Disposition: attachment; filename=download.xls"); |
||
72 | } else { |
||
73 | header('Content-Type:text/html; charset=' . _CHARSET); |
||
74 | } |
||
75 | $tpl = new XoopsTpl(); |
||
76 | $tpl->xoops_setTemplateDir(XOOPS_ROOT_PATH . '/themes'); |
||
77 | $tpl->xoops_setCaching(2); |
||
78 | $tpl->xoops_setCacheTime(0); |
||
79 | |||
80 | $tpl->assign('for_print', true); |
||
81 | |||
82 | $tpl->assign('charset', _CHARSET); |
||
83 | $tpl->assign('sitename', $xoopsConfig['sitename']); |
||
84 | $tpl->assign('site_url', XOOPS_URL); |
||
85 | |||
86 | $tpl->assign('lang_comesfrom', sprintf(_MB_APCAL_COMESFROM, $xoopsConfig['sitename'])); |
||
87 | |||
88 | // �ڡ���ɽ����Ϣ�ν���ʬ�� |
||
89 | if (!empty($_GET['event_id'])) { |
||
90 | $tpl->assign('contents', $cal->get_schedule_view_html(true)); |
||
91 | } else { |
||
92 | switch ($_GET['smode']) { |
||
93 | case 'ro_list': |
||
94 | $tpl->assign('for_event_list', false); |
||
95 | if (!empty($_REQUEST['eventid'])) { |
||
96 | $eventid = \Xmf\Request::getInt('eventid'); |
||
97 | $summary = \Xmf\Request::getString('summary', ''); |
||
98 | $date = \Xmf\Request::getString('date'); |
||
99 | $location = \Xmf\Request::getString('location', ''); |
||
100 | $classname = ''; |
||
101 | |||
102 | $query = 'SELECT ' |
||
103 | . $GLOBALS['xoopsDB']->prefix('users') |
||
104 | . '.uname, ' |
||
105 | . $GLOBALS['xoopsDB']->prefix('apcal_ro_members') |
||
106 | . '.* FROM ' |
||
107 | . $GLOBALS['xoopsDB']->prefix('users') |
||
108 | . ' RIGHT JOIN ' |
||
109 | . $GLOBALS['xoopsDB']->prefix('apcal_ro_members') |
||
110 | . ' ON ' |
||
111 | . $GLOBALS['xoopsDB']->prefix('users') |
||
112 | . '.uid = ' |
||
113 | . $GLOBALS['xoopsDB']->prefix('apcal_ro_members') |
||
114 | . '.rom_submitter WHERE (((' |
||
115 | . $GLOBALS['xoopsDB']->prefix('apcal_ro_members') |
||
116 | . ".rom_eventid)=$eventid)) ORDER BY " |
||
117 | . $GLOBALS['xoopsDB']->prefix('apcal_ro_members') |
||
118 | . '.rom_date_created'; |
||
119 | |||
120 | $res = $GLOBALS['xoopsDB']->query($query); |
||
121 | $num_rows = $GLOBALS['xoopsDB']->getRowsNum($res); |
||
122 | |||
123 | if ($num_rows == 0) { |
||
124 | $ret = _APCAL_RO_NOMEMBERS; |
||
125 | } else { |
||
126 | $ret .= "<table><tr><td colspan='5'>$summary</td></tr><tr><td colspan='5'>$date</td></tr><tr><td colspan='5'>$location</td></tr></table>"; |
||
127 | $ret .= " |
||
128 | <table class='ro_table-'> |
||
129 | <tr> |
||
130 | <th width='100px' class='listeheader'> </th> |
||
131 | <th width='100px' class='listeheader'>" . _APCAL_RO_UNAME . "</th> |
||
132 | <th width='100px' class='listeheader'>" . _APCAL_RO_FIRSTNAME . "</th> |
||
133 | <th width='100px' class='listeheader'>" . _APCAL_RO_LASTNAME . "</th> |
||
134 | <th class='listeheader'>" . _APCAL_RO_EMAIL . '</th>'; |
||
135 | if ($cal->ro_extrainfo1 !== '') { |
||
136 | $ret .= "<th class='listeheader'>" . $cal->ro_extrainfo1 . '</th>'; |
||
137 | } |
||
138 | if ($cal->ro_extrainfo2 !== '') { |
||
139 | $ret .= "<th class='listeheader'>" . $cal->ro_extrainfo2 . '</th>'; |
||
140 | } |
||
141 | if ($cal->ro_extrainfo3 !== '') { |
||
142 | $ret .= "<th class='listeheader'>" . $cal->ro_extrainfo3 . '</th>'; |
||
143 | } |
||
144 | if ($cal->ro_extrainfo4 !== '') { |
||
145 | $ret .= "<th class='listeheader'>" . $cal->ro_extrainfo4 . '</th>'; |
||
146 | } |
||
147 | if ($cal->ro_extrainfo5 !== '') { |
||
148 | $ret .= "<th class='listeheader'>" . $cal->ro_extrainfo5 . '</th>'; |
||
149 | } |
||
150 | $ret .= "<th class='listeheader'>" . _APCAL_RO_STATUS . "</th>"; |
||
151 | $ret .= '</tr>'; |
||
152 | $counter = 0; |
||
153 | $line = 0; |
||
154 | while ($member = $GLOBALS['xoopsDB']->fetchObject($res)) { |
||
155 | $rom_id = $member->rom_id; |
||
156 | $uname = $member->uname; |
||
157 | $firstname = $member->rom_firstname; |
||
158 | $lastname = $member->rom_lastname; |
||
159 | $email = $member->rom_email; |
||
160 | $extrainfo1 = $member->rom_extrainfo1; |
||
161 | $extrainfo2 = $member->rom_extrainfo2; |
||
162 | $extrainfo3 = $member->rom_extrainfo3; |
||
163 | $extrainfo4 = $member->rom_extrainfo4; |
||
164 | $extrainfo5 = $member->rom_extrainfo5; |
||
165 | $status = (int)$member->rom_status; |
||
166 | View Code Duplication | if ($line == 0) { |
|
0 ignored issues
–
show
|
|||
167 | $classname = 'odd'; |
||
168 | $line = 1; |
||
169 | } else { |
||
170 | $classname = 'even'; |
||
171 | $line = 0; |
||
172 | } |
||
173 | $counter++; |
||
174 | $ret .= "<tr> |
||
175 | <td class='$classname'>$counter</td> |
||
176 | <td class='$classname'>$uname</td> |
||
177 | <td class='$classname'>$firstname</td> |
||
178 | <td class='$classname'>$lastname</td> |
||
179 | <td class='$classname'>$email</td>"; |
||
180 | if ($cal->ro_extrainfo1 !== '') { |
||
181 | $ret .= "<td class='$classname'>$extrainfo1</td>"; |
||
182 | } |
||
183 | if ($cal->ro_extrainfo2 !== '') { |
||
184 | $ret .= "<td class='$classname'>$extrainfo2</td>"; |
||
185 | } |
||
186 | if ($cal->ro_extrainfo3 !== '') { |
||
187 | $ret .= "<td class='$classname'>$extrainfo3</td>"; |
||
188 | } |
||
189 | if ($cal->ro_extrainfo4 !== '') { |
||
190 | $ret .= "<td class='$classname'>$extrainfo4</td>"; |
||
191 | } |
||
192 | if ($cal->ro_extrainfo5 !== '') { |
||
193 | $ret .= "<td class='$classname'>$extrainfo5</td>"; |
||
194 | } |
||
195 | $ret .= "<td class='$classname' style='text-align:center'>"; |
||
196 | $unique_id = uniqid(mt_rand()); |
||
197 | $ret .= "<div style='display:inline;'>"; |
||
198 | if ($status == 1) { |
||
199 | $ret .= _APCAL_RO_STATUS_PENDING; |
||
200 | } else if ($status == 2) { |
||
201 | $ret .= _APCAL_RO_STATUS_LIST; |
||
202 | } else { |
||
203 | $ret .= _APCAL_RO_STATUS_OK; |
||
204 | } |
||
205 | $ret .= "</div>"; |
||
206 | $ret .= '</td></tr>'; |
||
207 | } |
||
208 | $ret .= "</table>\n<br>"; |
||
209 | } |
||
210 | } |
||
211 | |||
212 | $tpl->assign('contents', $ret); |
||
213 | break; |
||
214 | case 'Yearly': |
||
215 | $tpl->assign('for_event_list', false); |
||
216 | $tpl->assign('contents', $cal->get_yearly('', '', true)); |
||
217 | break; |
||
218 | case 'Weekly': |
||
219 | $tpl->assign('for_event_list', false); |
||
220 | $tpl->assign('contents', $cal->get_weekly('', '', true)); |
||
221 | break; |
||
222 | case 'Daily': |
||
223 | $tpl->assign('for_event_list', false); |
||
224 | $tpl->assign('contents', $cal->get_daily('', '', true)); |
||
225 | break; |
||
226 | case 'List': |
||
227 | $tpl->assign('for_event_list', true); |
||
228 | $cal->assign_event_list($tpl); |
||
229 | break; |
||
230 | case 'Monthly': |
||
231 | default: |
||
232 | $tpl->assign('for_event_list', false); |
||
233 | $tpl->assign('contents', $cal->get_monthly('', '', true)); |
||
234 | break; |
||
235 | } |
||
236 | } |
||
237 | |||
238 | echo '<link rel="stylesheet" type="text/css" href="' . XOOPS_URL . '/modules/apcal/assets/css/apcal.css" />'; |
||
239 | $tpl->display('db:apcal_print.tpl'); |
||
240 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.