@@ -89,10 +89,10 @@ |
||
89 | 89 | if ($xoopsConfig['debug_mode'] == 1 || $xoopsConfig['debug_mode'] == 2) { |
90 | 90 | if (!empty($this->_errors)) { |
91 | 91 | foreach ($this->_errors as $errstr) { |
92 | - $ret .= $errstr . '<br>'; |
|
92 | + $ret .= $errstr.'<br>'; |
|
93 | 93 | } |
94 | 94 | } else { |
95 | - $ret .= _NONE . '<br>'; |
|
95 | + $ret .= _NONE.'<br>'; |
|
96 | 96 | } |
97 | 97 | $ret .= sprintf(_AUTH_MSG_AUTH_METHOD, $this->auth_method); |
98 | 98 | } else { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return false; |
93 | 93 | } |
94 | 94 | } else { |
95 | - $this->setErrors(ldap_errno($this->_ds), ldap_err2str(ldap_errno($this->_ds)) . '(' . $userUPN . ')'); |
|
95 | + $this->setErrors(ldap_errno($this->_ds), ldap_err2str(ldap_errno($this->_ds)).'('.$userUPN.')'); |
|
96 | 96 | } |
97 | 97 | } else { |
98 | 98 | $this->setErrors(0, _AUTH_LDAP_SERVER_NOT_FOUND); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function getUPN($uname) |
116 | 116 | { |
117 | - $userDN = $uname . '@' . $this->ldap_domain_name; |
|
117 | + $userDN = $uname.'@'.$this->ldap_domain_name; |
|
118 | 118 | |
119 | 119 | return $userDN; |
120 | 120 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | if (!class_exists('XoopsAuthProvisionning')) { |
34 | - trigger_error('Required class XoopsAuthProvisionning was not found at line ' . __FILE__ . ' at line ' . __LINE__, E_USER_WARNING); |
|
34 | + trigger_error('Required class XoopsAuthProvisionning was not found at line '.__FILE__.' at line '.__LINE__, E_USER_WARNING); |
|
35 | 35 | |
36 | 36 | return false; |
37 | 37 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | // We load the Xoops User database |
238 | 238 | return $this->loadXoopsUser($userDN, $uname, $pwd); |
239 | 239 | } else { |
240 | - $this->setErrors(ldap_errno($this->_ds), ldap_err2str(ldap_errno($this->_ds)) . '(' . $userDN . ')'); |
|
240 | + $this->setErrors(ldap_errno($this->_ds), ldap_err2str(ldap_errno($this->_ds)).'('.$userDN.')'); |
|
241 | 241 | } |
242 | 242 | } else { |
243 | 243 | $this->setErrors(0, _AUTH_LDAP_SERVER_NOT_FOUND); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | if (!$this->ldap_loginname_asdn) { |
260 | 260 | // Bind with the manager |
261 | 261 | if (!ldap_bind($this->_ds, $this->ldap_manager_dn, stripslashes($this->ldap_manager_pass))) { |
262 | - $this->setErrors(ldap_errno($this->_ds), ldap_err2str(ldap_errno($this->_ds)) . '(' . $this->ldap_manager_dn . ')'); |
|
262 | + $this->setErrors(ldap_errno($this->_ds), ldap_err2str(ldap_errno($this->_ds)).'('.$this->ldap_manager_dn.')'); |
|
263 | 263 | |
264 | 264 | return false; |
265 | 265 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $this->setErrors(0, sprintf(_AUTH_LDAP_USER_NOT_FOUND, $uname, $filter, $this->ldap_base_dn)); |
273 | 273 | } |
274 | 274 | } else { |
275 | - $userDN = $this->ldap_loginldap_attr . '=' . $uname . ',' . $this->ldap_base_dn; |
|
275 | + $userDN = $this->ldap_loginldap_attr.'='.$uname.','.$this->ldap_base_dn; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | return $userDN; |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | if ($this->ldap_filter_person != '') { |
291 | 291 | $filter = str_replace('@@loginname@@', $uname, $this->ldap_filter_person); |
292 | 292 | } else { |
293 | - $filter = $this->ldap_loginldap_attr . '=' . $uname; |
|
293 | + $filter = $this->ldap_loginldap_attr.'='.$uname; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | return $filter; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | if ($entries['count'] > 0) { |
313 | 313 | $xoopsUser = $provisHandler->sync($entries[0], $uname, $pwd); |
314 | 314 | } else { |
315 | - $this->setErrors(0, sprintf('loadXoopsUser - ' . _AUTH_LDAP_CANT_READ_ENTRY, $userdn)); |
|
315 | + $this->setErrors(0, sprintf('loadXoopsUser - '._AUTH_LDAP_CANT_READ_ENTRY, $userdn)); |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | return $xoopsUser; |
@@ -61,12 +61,12 @@ |
||
61 | 61 | $xoops_auth_method = 'xoops'; |
62 | 62 | } |
63 | 63 | |
64 | - $ret = include_once $GLOBALS['xoops']->path('class/auth/auth_' . $xoops_auth_method . '.php'); |
|
64 | + $ret = include_once $GLOBALS['xoops']->path('class/auth/auth_'.$xoops_auth_method.'.php'); |
|
65 | 65 | if ($ret == false) { |
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
69 | - $class = 'XoopsAuth' . ucfirst($xoops_auth_method); |
|
69 | + $class = 'XoopsAuth'.ucfirst($xoops_auth_method); |
|
70 | 70 | if (!class_exists($class)) { |
71 | 71 | $GLOBALS['xoopsLogger']->triggerError($class, _XO_ER_CLASSNOTFOUND, __FILE__, __LINE__, E_USER_ERROR); |
72 | 72 |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | return $newuser; |
153 | 153 | } else { |
154 | - redirect_header(XOOPS_URL . '/user.php', 5, $newuser->getHtmlErrors()); |
|
154 | + redirect_header(XOOPS_URL.'/user.php', 5, $newuser->getHtmlErrors()); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | return $ret; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | if ($member_handler->insertUser($xoopsUser)) { |
183 | 183 | return $xoopsUser; |
184 | 184 | } else { |
185 | - redirect_header(XOOPS_URL . '/user.php', 5, $xoopsUser->getHtmlErrors()); |
|
185 | + redirect_header(XOOPS_URL.'/user.php', 5, $xoopsUser->getHtmlErrors()); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | return $ret; |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | /* @var $this->_memberHandler XoopsMemberHandler */ |
59 | 59 | $this->_memberHandler = xoops_getHandler('member'); |
60 | 60 | $this->_statusText = array( |
61 | - XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">' . _CM_PENDING . '</span>', |
|
62 | - XOOPS_COMMENT_ACTIVE => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">' . _CM_ACTIVE . '</span>', |
|
63 | - XOOPS_COMMENT_HIDDEN => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">' . _CM_HIDDEN . '</span>'); |
|
61 | + XOOPS_COMMENT_PENDING => '<span style="text-decoration: none; font-weight: bold; color: #00ff00;">'._CM_PENDING.'</span>', |
|
62 | + XOOPS_COMMENT_ACTIVE => '<span style="text-decoration: none; font-weight: bold; color: #ff0000;">'._CM_ACTIVE.'</span>', |
|
63 | + XOOPS_COMMENT_HIDDEN => '<span style="text-decoration: none; font-weight: bold; color: #0000ff;">'._CM_HIDDEN.'</span>'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | if (isset($this->_comments)) { |
92 | 92 | unset($this->_comments); |
93 | 93 | } |
94 | - $this->_comments =& $comments_arr; |
|
94 | + $this->_comments = & $comments_arr; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $count = count($this->_comments); |
105 | 105 | for ($i = 0; $i < $count; ++$i) { |
106 | 106 | if (false !== $this->_useIcons) { |
107 | - $title = $this->_getTitleIcon($this->_comments[$i]->getVar('com_icon')) . ' ' . $this->_comments[$i]->getVar('com_title'); |
|
107 | + $title = $this->_getTitleIcon($this->_comments[$i]->getVar('com_icon')).' '.$this->_comments[$i]->getVar('com_title'); |
|
108 | 108 | } else { |
109 | 109 | $title = $this->_comments[$i]->getVar('com_title'); |
110 | 110 | } |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | $com_email = $this->_comments[$i]->getVar('com_email'); |
115 | 115 | $text = $this->_comments[$i]->getVar('com_text'); |
116 | 116 | $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0; margin-right: 2px;">'; |
117 | - $text .= _CM_STATUS . ': ' . $this->_statusText[$this->_comments[$i]->getVar('com_status')] . '<br>'; |
|
118 | - $text .= 'IP: <span style="font-weight: bold;">' . $this->_comments[$i]->getVar('com_ip') . '</span>'; |
|
117 | + $text .= _CM_STATUS.': '.$this->_statusText[$this->_comments[$i]->getVar('com_status')].'<br>'; |
|
118 | + $text .= 'IP: <span style="font-weight: bold;">'.$this->_comments[$i]->getVar('com_ip').'</span>'; |
|
119 | 119 | if (!empty($com_email)) { |
120 | - $text .= '<br>' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>'; |
|
120 | + $text .= '<br>'._CM_EMAIL.' :<span style="font-weight: bold;"><a href="mailto:'.$com_email.'" title="'.$com_email.'">'.$com_email.'</a></span>'; |
|
121 | 121 | } |
122 | 122 | $text .= '</div>'; |
123 | 123 | } else { |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | include_once $GLOBALS['xoops']->path('class/tree.php'); |
155 | 155 | // construct comment tree |
156 | 156 | $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); |
157 | - $tree =& $xot->getTree(); |
|
157 | + $tree = & $xot->getTree(); |
|
158 | 158 | |
159 | 159 | if (false !== $this->_useIcons) { |
160 | - $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('com_icon')) . ' ' . $tree[$comment_id]['obj']->getVar('com_title'); |
|
160 | + $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('com_icon')).' '.$tree[$comment_id]['obj']->getVar('com_title'); |
|
161 | 161 | } else { |
162 | 162 | $title = $tree[$comment_id]['obj']->getVar('com_title'); |
163 | 163 | } |
@@ -174,10 +174,10 @@ discard block |
||
174 | 174 | $com_email = $tree[$comment_id]['obj']->getVar('com_email'); |
175 | 175 | $text = $tree[$comment_id]['obj']->getVar('com_text'); |
176 | 176 | $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0; margin-right: 2px;">'; |
177 | - $text .= _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br>'; |
|
178 | - $text .= 'IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span>'; |
|
177 | + $text .= _CM_STATUS.': '.$this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')].'<br>'; |
|
178 | + $text .= 'IP: <span style="font-weight: bold;">'.$tree[$comment_id]['obj']->getVar('com_ip').'</span>'; |
|
179 | 179 | if (!empty($com_email)) { |
180 | - $text .= '<br>' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>'; |
|
180 | + $text .= '<br>'._CM_EMAIL.' :<span style="font-weight: bold;"><a href="mailto:'.$com_email.'" title="'.$com_email.'">'.$com_email.'</a></span>'; |
|
181 | 181 | } |
182 | 182 | $text .= '</div>'; |
183 | 183 | } else { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | $replies = array(); |
199 | 199 | $this->_renderThreadReplies($tree, $comment_id, $replies, ' ', $admin_view); |
200 | - $show_replies = (count($replies) > 0);// ? true : false; |
|
200 | + $show_replies = (count($replies) > 0); // ? true : false; |
|
201 | 201 | // Start edit by voltan |
202 | 202 | $this->_tpl->append('comments', array( |
203 | 203 | 'pid' => $tree[$comment_id]['obj']->getVar('com_pid'), |
@@ -231,11 +231,11 @@ discard block |
||
231 | 231 | $admin_view = (bool)$admin_view; |
232 | 232 | if ($depth > 0) { |
233 | 233 | if (false !== $this->_useIcons) { |
234 | - $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')) . ' ' . $thread[$key]['obj']->getVar('com_title'); |
|
234 | + $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')).' '.$thread[$key]['obj']->getVar('com_title'); |
|
235 | 235 | } else { |
236 | 236 | $title = $thread[$key]['obj']->getVar('com_title'); |
237 | 237 | } |
238 | - $title = (false !== $admin_view) ? $title . ' ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] : $title; |
|
238 | + $title = (false !== $admin_view) ? $title.' '.$this->_statusText[$thread[$key]['obj']->getVar('com_status')] : $title; |
|
239 | 239 | // Start edit by voltan |
240 | 240 | $replies[] = array( |
241 | 241 | 'id' => $key, |
@@ -278,9 +278,9 @@ discard block |
||
278 | 278 | { |
279 | 279 | include_once $GLOBALS['xoops']->path('class/tree.php'); |
280 | 280 | $xot = new XoopsObjectTree($this->_comments, 'com_id', 'com_pid', 'com_rootid'); |
281 | - $tree =& $xot->getTree(); |
|
281 | + $tree = & $xot->getTree(); |
|
282 | 282 | if (false !== $this->_useIcons) { |
283 | - $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('com_icon')) . ' ' . $tree[$comment_id]['obj']->getVar('com_title'); |
|
283 | + $title = $this->_getTitleIcon($tree[$comment_id]['obj']->getVar('com_icon')).' '.$tree[$comment_id]['obj']->getVar('com_title'); |
|
284 | 284 | } else { |
285 | 285 | $title = $tree[$comment_id]['obj']->getVar('com_title'); |
286 | 286 | } |
@@ -289,10 +289,10 @@ discard block |
||
289 | 289 | $com_email = $tree[$comment_id]['obj']->getVar('com_email'); |
290 | 290 | $text = $tree[$comment_id]['obj']->getVar('com_text'); |
291 | 291 | $text .= '<div style="text-align:right; margin-top: 2px; margin-bottom: 0; margin-right: 2px;">'; |
292 | - $text .= _CM_STATUS . ': ' . $this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')] . '<br>'; |
|
293 | - $text .= 'IP: <span style="font-weight: bold;">' . $tree[$comment_id]['obj']->getVar('com_ip') . '</span>'; |
|
292 | + $text .= _CM_STATUS.': '.$this->_statusText[$tree[$comment_id]['obj']->getVar('com_status')].'<br>'; |
|
293 | + $text .= 'IP: <span style="font-weight: bold;">'.$tree[$comment_id]['obj']->getVar('com_ip').'</span>'; |
|
294 | 294 | if (!empty($com_email)) { |
295 | - $text .= '<br>' . _CM_EMAIL . ' :<span style="font-weight: bold;"><a href="mailto:' . $com_email . '" title="' . $com_email . '">' . $com_email . '</a></span>'; |
|
295 | + $text .= '<br>'._CM_EMAIL.' :<span style="font-weight: bold;"><a href="mailto:'.$com_email.'" title="'.$com_email.'">'.$com_email.'</a></span>'; |
|
296 | 296 | } |
297 | 297 | $text .= '</div>'; |
298 | 298 | } else { |
@@ -342,12 +342,12 @@ discard block |
||
342 | 342 | { |
343 | 343 | if ($depth > 0) { |
344 | 344 | if (false !== $this->_useIcons) { |
345 | - $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')) . ' ' . $thread[$key]['obj']->getVar('com_title'); |
|
345 | + $title = $this->_getTitleIcon($thread[$key]['obj']->getVar('com_icon')).' '.$thread[$key]['obj']->getVar('com_title'); |
|
346 | 346 | } else { |
347 | 347 | $title = $thread[$key]['obj']->getVar('com_title'); |
348 | 348 | } |
349 | 349 | $admin_view = (bool)$admin_view; |
350 | - $text = (false !== $admin_view) ? $thread[$key]['obj']->getVar('com_text') . '<div style="text-align:right; margin-top: 2px; margin-right: 2px;">' . _CM_STATUS . ': ' . $this->_statusText[$thread[$key]['obj']->getVar('com_status')] . '<br>IP: <span style="font-weight: bold;">' . $thread[$key]['obj']->getVar('com_ip') . '</span><br>' . _CM_EMAIL . ' :<span style="font-weight: bold;">' . $thread[$key]['obj']->getVar('com_email') . '</span></div>' : $thread[$key]['obj']->getVar('com_text'); |
|
350 | + $text = (false !== $admin_view) ? $thread[$key]['obj']->getVar('com_text').'<div style="text-align:right; margin-top: 2px; margin-right: 2px;">'._CM_STATUS.': '.$this->_statusText[$thread[$key]['obj']->getVar('com_status')].'<br>IP: <span style="font-weight: bold;">'.$thread[$key]['obj']->getVar('com_ip').'</span><br>'._CM_EMAIL.' :<span style="font-weight: bold;">'.$thread[$key]['obj']->getVar('com_email').'</span></div>' : $thread[$key]['obj']->getVar('com_text'); |
|
351 | 351 | // Start edit by voltan |
352 | 352 | $replies[] = array( |
353 | 353 | 'id' => $key, |
@@ -396,12 +396,12 @@ discard block |
||
396 | 396 | if ($poster['id'] > 0) { |
397 | 397 | $com_poster = $this->_memberHandler->getUser($poster_id); |
398 | 398 | if (is_object($com_poster)) { |
399 | - $poster['uname'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $poster['id'] . '">' . $com_poster->getVar('uname') . '</a>'; |
|
399 | + $poster['uname'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$poster['id'].'">'.$com_poster->getVar('uname').'</a>'; |
|
400 | 400 | } |
401 | 401 | } elseif ($poster['id'] == 0 && $poster_user != '') { |
402 | 402 | $poster['id'] = 0; // to cope with deleted user accounts |
403 | 403 | if (!empty($poster_website)) { |
404 | - $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>'; |
|
404 | + $poster['uname'] = '<a href="'.$poster_website.'">'.$poster_user.'</a>'; |
|
405 | 405 | } else { |
406 | 406 | $poster['uname'] = $poster_user; |
407 | 407 | } |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | /* @var $com_poster XoopsUser */ |
432 | 432 | $com_poster = $this->_memberHandler->getUser($poster['id']); |
433 | 433 | if (is_object($com_poster)) { |
434 | - $poster['uname'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $poster['id'] . '">' . $com_poster->getVar('uname') . '</a>'; |
|
434 | + $poster['uname'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$poster['id'].'">'.$com_poster->getVar('uname').'</a>'; |
|
435 | 435 | $poster_rank = $com_poster->rank(); |
436 | 436 | $poster['rank_image'] = ($poster_rank['image'] != '') ? $poster_rank['image'] : 'blank.gif'; |
437 | 437 | $poster['rank_title'] = $poster_rank['title']; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | } |
444 | 444 | } elseif ($poster['id'] == 0 && $poster_user != '') { |
445 | 445 | if (!empty($poster_website)) { |
446 | - $poster['uname'] = '<a href="' . $poster_website . '">' . $poster_user . '</a>'; |
|
446 | + $poster['uname'] = '<a href="'.$poster_website.'">'.$poster_user.'</a>'; |
|
447 | 447 | } else { |
448 | 448 | $poster['uname'] = $poster_user; |
449 | 449 | } |
@@ -481,16 +481,16 @@ discard block |
||
481 | 481 | $icon_image = htmlspecialchars(trim($icon_image)); |
482 | 482 | if ($icon_image != '') { |
483 | 483 | if (false !== $this->_doIconCheck) { |
484 | - if (!file_exists($GLOBALS['xoops']->path('images/subject/' . $icon_image))) { |
|
485 | - return '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; |
|
484 | + if (!file_exists($GLOBALS['xoops']->path('images/subject/'.$icon_image))) { |
|
485 | + return '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />'; |
|
486 | 486 | } else { |
487 | - return '<img src="' . XOOPS_URL . '/images/subject/' . $icon_image . '" alt="" />'; |
|
487 | + return '<img src="'.XOOPS_URL.'/images/subject/'.$icon_image.'" alt="" />'; |
|
488 | 488 | } |
489 | 489 | } else { |
490 | - return '<img src="' . XOOPS_URL . '/images/subject/' . $icon_image . '" alt="" />'; |
|
490 | + return '<img src="'.XOOPS_URL.'/images/subject/'.$icon_image.'" alt="" />'; |
|
491 | 491 | } |
492 | 492 | } |
493 | 493 | |
494 | - return '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />'; |
|
494 | + return '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />'; |
|
495 | 495 | } |
496 | 496 | } |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | { |
45 | 45 | xoops_loadLanguage('captcha'); |
46 | 46 | // Load static configurations |
47 | - $this->path_basic = XOOPS_ROOT_PATH . '/class/captcha'; |
|
48 | - $this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/captcha'; |
|
47 | + $this->path_basic = XOOPS_ROOT_PATH.'/class/captcha'; |
|
48 | + $this->path_plugin = XOOPS_ROOT_PATH.'/Frameworks/captcha'; |
|
49 | 49 | $this->config = $this->loadConfig(); |
50 | 50 | $this->name = $this->config['name']; |
51 | 51 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | { |
77 | 77 | $basic_config = array(); |
78 | 78 | $plugin_config = array(); |
79 | - $filename = empty($filename) ? 'config.php' : 'config.' . $filename . '.php'; |
|
80 | - if (file_exists($file = $this->path_basic . '/' . $filename)) { |
|
79 | + $filename = empty($filename) ? 'config.php' : 'config.'.$filename.'.php'; |
|
80 | + if (file_exists($file = $this->path_basic.'/'.$filename)) { |
|
81 | 81 | $basic_config = include $file; |
82 | 82 | } |
83 | - if (file_exists($file = $this->path_plugin . '/' . $filename)) { |
|
83 | + if (file_exists($file = $this->path_plugin.'/'.$filename)) { |
|
84 | 84 | $plugin_config = include $file; |
85 | 85 | } |
86 | 86 | |
@@ -129,22 +129,22 @@ discard block |
||
129 | 129 | public function loadHandler($name = null) |
130 | 130 | { |
131 | 131 | $name = !empty($name) ? $name : (empty($this->config['mode']) ? 'text' : $this->config['mode']); |
132 | - $class = 'XoopsCaptcha' . ucfirst($name); |
|
132 | + $class = 'XoopsCaptcha'.ucfirst($name); |
|
133 | 133 | if (!empty($this->handler) && get_class($this->handler) == $class) { |
134 | 134 | return $this->handler; |
135 | 135 | } |
136 | 136 | $this->handler = null; |
137 | - if (file_exists($file = $this->path_basic . '/' . $name . '.php')) { |
|
137 | + if (file_exists($file = $this->path_basic.'/'.$name.'.php')) { |
|
138 | 138 | require_once $file; |
139 | 139 | } else { |
140 | - if (file_exists($file = $this->path_plugin . '/' . $name . '.php')) { |
|
140 | + if (file_exists($file = $this->path_plugin.'/'.$name.'.php')) { |
|
141 | 141 | require_once $file; |
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
145 | 145 | if (!class_exists($class)) { |
146 | 146 | $class = 'XoopsCaptchaText'; |
147 | - require_once $this->path_basic . '/text.php'; |
|
147 | + require_once $this->path_basic.'/text.php'; |
|
148 | 148 | } |
149 | 149 | $handler = new $class($this); |
150 | 150 | if ($handler->isActive()) { |
@@ -267,10 +267,10 @@ discard block |
||
267 | 267 | $this->handler->destroyGarbage(); |
268 | 268 | } |
269 | 269 | if ($clearSession) { |
270 | - $_SESSION[$this->name . '_name'] = null; |
|
271 | - $_SESSION[$this->name . '_skipmember'] = null; |
|
272 | - $_SESSION[$this->name . '_code'] = null; |
|
273 | - $_SESSION[$this->name . '_maxattempts'] = null; |
|
270 | + $_SESSION[$this->name.'_name'] = null; |
|
271 | + $_SESSION[$this->name.'_skipmember'] = null; |
|
272 | + $_SESSION[$this->name.'_code'] = null; |
|
273 | + $_SESSION[$this->name.'_maxattempts'] = null; |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | return true; |
@@ -283,17 +283,17 @@ discard block |
||
283 | 283 | */ |
284 | 284 | public function render() |
285 | 285 | { |
286 | - $_SESSION[$this->name . '_name'] = $this->name; |
|
287 | - $_SESSION[$this->name . '_skipmember'] = $this->config['skipmember']; |
|
286 | + $_SESSION[$this->name.'_name'] = $this->name; |
|
287 | + $_SESSION[$this->name.'_skipmember'] = $this->config['skipmember']; |
|
288 | 288 | $form = ''; |
289 | 289 | if (!$this->active || empty($this->config['name'])) { |
290 | 290 | return $form; |
291 | 291 | } |
292 | 292 | |
293 | 293 | $maxAttempts = $this->config['maxattempts']; |
294 | - $_SESSION[$this->name . '_maxattempts'] = $maxAttempts; |
|
295 | - $attempt = isset($_SESSION[$this->name . '_attempt']) ? $_SESSION[$this->name . '_attempt'] : 0; |
|
296 | - $_SESSION[$this->name . '_attempt'] = $attempt; |
|
294 | + $_SESSION[$this->name.'_maxattempts'] = $maxAttempts; |
|
295 | + $attempt = isset($_SESSION[$this->name.'_attempt']) ? $_SESSION[$this->name.'_attempt'] : 0; |
|
296 | + $_SESSION[$this->name.'_attempt'] = $attempt; |
|
297 | 297 | |
298 | 298 | // Failure on too many attempts |
299 | 299 | if (!empty($maxAttempts) && $attempt > $maxAttempts) { |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | { |
331 | 331 | $code = ($code === null) ? $this->handler->getCode() : $code; |
332 | 332 | if (!empty($code)) { |
333 | - $_SESSION[$this->name . '_code'] = $code; |
|
333 | + $_SESSION[$this->name.'_code'] = $code; |
|
334 | 334 | |
335 | 335 | return true; |
336 | 336 | } |
@@ -24,9 +24,9 @@ |
||
24 | 24 | * the actual XOOPS config then we should do this. (Who said this? You are right!) |
25 | 25 | */ |
26 | 26 | return $config = array( |
27 | - 'disabled' => false, // Disable CAPTCHA |
|
28 | - 'mode' => 'text', // default mode, you can choose 'text', 'image', 'recaptcha'(requires api key), 'recaptcha2'(requires api key) |
|
29 | - 'name' => 'xoopscaptcha', // captcha name |
|
30 | - 'skipmember' => true, // Skip CAPTCHA check for members |
|
31 | - 'maxattempts' => 10, // Maximum attempts for each session |
|
27 | + 'disabled' => false, // Disable CAPTCHA |
|
28 | + 'mode' => 'text', // default mode, you can choose 'text', 'image', 'recaptcha'(requires api key), 'recaptcha2'(requires api key) |
|
29 | + 'name' => 'xoopscaptcha', // captcha name |
|
30 | + 'skipmember' => true, // Skip CAPTCHA check for members |
|
31 | + 'maxattempts' => 10, // Maximum attempts for each session |
|
32 | 32 | ); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $form = '<script src="https://www.google.com/recaptcha/api.js"></script>'; |
51 | 51 | $form .= '<div class="form-group"><div class="g-recaptcha" data-sitekey="' |
52 | - . $this->config['website_key'] . '"></div></div>'; |
|
52 | + . $this->config['website_key'].'"></div></div>'; |
|
53 | 53 | return $form; |
54 | 54 | } |
55 | 55 | |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | { |
65 | 65 | $isValid = false; |
66 | 66 | $recaptchaResponse = Request::getString('g-recaptcha-response', ''); |
67 | - $recaptchaVerifyURL = 'https://www.google.com/recaptcha/api/siteverify?secret=' . $this->config['secret_key'] |
|
68 | - . '&response=' . $recaptchaResponse . '&remoteip=' . IPAddress::fromRequest()->asReadable(); |
|
67 | + $recaptchaVerifyURL = 'https://www.google.com/recaptcha/api/siteverify?secret='.$this->config['secret_key'] |
|
68 | + . '&response='.$recaptchaResponse.'&remoteip='.IPAddress::fromRequest()->asReadable(); |
|
69 | 69 | $usedCurl = false; |
70 | - if (function_exists('curl_init') && false !== ($curlHandle = curl_init())) { |
|
70 | + if (function_exists('curl_init') && false !== ($curlHandle = curl_init())) { |
|
71 | 71 | curl_setopt($curlHandle, CURLOPT_URL, $recaptchaVerifyURL); |
72 | 72 | curl_setopt($curlHandle, CURLOPT_FAILONERROR, true); |
73 | 73 | curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1); |