mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 19:51:42 +09:00
fixed Issue 3632 CAPTCHA 애드온을 회원용과 게시물/댓글 용을 분리
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13188 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
3581db5932
commit
a16874dc8a
47 changed files with 960 additions and 273 deletions
|
|
@ -19,6 +19,7 @@ if(!class_exists('AddonCaptcha'))
|
|||
{
|
||||
|
||||
var $addon_info;
|
||||
var $target_acts = NULL;
|
||||
|
||||
function setInfo(&$addon_info)
|
||||
{
|
||||
|
|
@ -55,19 +56,7 @@ if(!class_exists('AddonCaptcha'))
|
|||
|
||||
$type = Context::get('captchaType');
|
||||
|
||||
$target_acts = array('procBoardInsertDocument', 'procBoardInsertComment', 'procIssuetrackerInsertIssue', 'procIssuetrackerInsertHistory', 'procTextyleInsertComment');
|
||||
if($this->addon_info->apply_find_account == 'apply')
|
||||
{
|
||||
$target_acts[] = 'procMemberFindAccount';
|
||||
}
|
||||
if($this->addon_info->apply_resend_auth_mail == 'apply')
|
||||
{
|
||||
$target_acts[] = 'procMemberResendAuthMail';
|
||||
}
|
||||
if($this->addon_info->apply_signup == 'apply')
|
||||
{
|
||||
$target_acts[] = 'procMemberInsert';
|
||||
}
|
||||
$this->target_acts = array('procBoardInsertDocument', 'procBoardInsertComment', 'procIssuetrackerInsertIssue', 'procIssuetrackerInsertHistory', 'procTextyleInsertComment');
|
||||
|
||||
if(Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON')
|
||||
{
|
||||
|
|
@ -85,13 +74,16 @@ if(!class_exists('AddonCaptcha'))
|
|||
}
|
||||
else
|
||||
{
|
||||
Context::addHtmlHeader('<script> var captchaTargetAct = new Array("' . implode('","', $target_acts) . '"); </script>');
|
||||
Context::addHtmlHeader('<script>
|
||||
if(!captchaTargetAct) {var captchaTargetAct = [];}
|
||||
captchaTargetAct.push("' . implode('","', $this->target_acts) . '");
|
||||
</script>');
|
||||
Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true);
|
||||
}
|
||||
}
|
||||
|
||||
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
|
||||
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts))
|
||||
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
|
||||
{
|
||||
Context::loadLang('./addons/captcha/lang');
|
||||
$ModuleHandler->error = "captcha_denied";
|
||||
|
|
@ -309,6 +301,8 @@ if(!class_exists('AddonCaptcha'))
|
|||
|
||||
function compareCaptcha()
|
||||
{
|
||||
if(!in_array(Context::get('act'), $this->target_acts)) return true;
|
||||
|
||||
if($_SESSION['captcha_authed'])
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue