31
cutley
Re: Frameworks Captcha
  • 2007/7/19 13:22

  • cutley

  • Just popping in

  • Posts: 38

  • Since: 2005/11/27


ooooo how did I not find that, my google skills are obviously not as good as they used to be. I'll give it a go later but it looks correct to me.

TANKS!
- - - - -
xoops FTW

32
GlaDiaC
Re: Frameworks Captcha
  • 2007/9/3 12:25

  • GlaDiaC

  • Just popping in

  • Posts: 16

  • Since: 2003/9/21


This is a Captcha HOWTO for XOOPS 2.2. Maybe you have different versions so I've added the approximatly line and a piece of the code.

REGISTER

File: modules/profiles/include/forms.php
Line: 331

le="color: #000000"><?php if ($xoopsModuleConfig['display_disclaimer'] != 0 && $xoopsModuleConfig['disclaimer'] != '') { $disc_tray = new XoopsFormElementTray(_PROFILE_MA_DISCLAIMER, '<br />'); $disc_text = new XoopsFormLabel("", "<div style="padding: 5px;">".$GLOBALS["myts"]->displayTarea($xoopsModuleConfig['disclaimer'],1)."</div>"); // Should we define a div.xoopsStatement class in style.css? $disc_tray->addElement($disc_text); $agree_chk = new XoopsFormCheckBox('', 'agree_disc'); $agree_chk->addOption(1, _PROFILE_MA_IAGREE); $disc_tray->addElement($agree_chk); $reg_form->addElement($disc_tray); } $reg_form->addElement(new XoopsFormHidden("op", "newuser")); [color=CC0000] // Captcha Hack $reg_form->addElement(new XoopsFormCaptcha()); // Captcha Hack[/color] $reg_form->addElement(new XoopsFormButton("", "submit", _PROFILE_MA_SUBMIT, "submit")); return $reg_form; }



File: modules/profiles/register.php
Line: 81

le="color: #000000"><?php if ( strcmp(trim($_POST['pass']), trim($_POST['vpass'])) ) { $stop .= _PROFILE_MA_PASSNOTSAME."<br />"; }elseif (!empty($xoopsModuleConfig['minpass']) && strlen(trim($_POST['pass'])) < $xoopsModuleConfig['minpass']) { $stop .= sprintf(_PROFILE_MA_PWDTOOSHORT,$xoopsModuleConfig['minpass'])."<br />"; } $stop .= userCheck($newuser); [color=CC0000] // Captcha Hack if (@include_once XOOPS_ROOT_PATH."/Frameworks/captcha/captcha.php") { $xoopsCaptcha = XoopsCaptcha::instance(); if (! $xoopsCaptcha->verify() ) { $stop .= $xoopsCaptcha->getMessage()."<br />"; } } // Captcha Hack[/color] if (empty($stop)) { echo _PROFILE_MA_USERNAME.": ".$newuser->getVar('loginname')."<br />"; echo _PROFILE_MA_EMAIL.": ".$newuser->getVar('email')."<br />"; echo _PROFILE_MA_DISPLAYNAME.": ".$newuser->getVar('uname')."<br />";




COMMENTS

File: include/comment_form.php
Line: 121

le="color: #000000"><?php if ('system' != $xoopsModule->getVar('dirname')) { $comment_config = $xoopsModule->getInfo('comments'); if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) { $myts =& MyTextSanitizer::getInstance(); foreach ($comment_config['extraParams'] as $extra_param) { // This routine is included from forms accessed via both GET and POST if (isset($_REQUEST[$extra_param])) { $hidden_value = htmlspecialchars($_REQUEST[$extra_param]); } else { $hidden_value = ''; } $cform->addElement(new XoopsFormHidden($extra_param, $hidden_value)); } } } [color=CC0000]// Captcha Hack $cform->addElement(new XoopsFormCaptcha()); // Captcha Hack[/color] $button_tray->addElement(new XoopsFormButton('', 'com_dopreview', _PREVIEW, 'submit')); $button_tray->addElement(new XoopsFormButton('', 'com_dopost', _CM_POSTCOMMENT, 'submit')); $cform->addElement($button_tray); $cform->display();



File: include/comment_post.php
Line: 141

le="color: #000000"><?php } else { xoops_cp_header(); themecenterposts($com_title, $p_comment); include XOOPS_ROOT_PATH.'/include/comment_form.php'; xoops_cp_footer(); } break; case "post": [color=CC0000] // Captcha Hack if(@include_once XOOPS_ROOT_PATH . "/Frameworks/captcha/captcha.php") { $xoopsCaptcha = XoopsCaptcha::instance(); if(! $xoopsCaptcha->verify(true) ) { redirect_header($redirect_page.'='.$com_itemid.'&com_id='.$com_id.'&com_mode='.$com_mode.'&com_order='.$com_order, 2, $xoopsCaptcha->getMessage()); } } // Captcha Hack[/color] $doimage = 1; $comment_handler =& xoops_gethandler('comment'); $add_userpost = false; $call_approvefunc = false; $call_updatefunc = false; // RMV-NOTIFY - this can be set to 'comment' or 'comment_submit' $notify_event = false;



SUBMIT NEWS

File: modules/news/include/storyform.inc.php
Line: 185

le="color: #000000"><?php if (is_object($xoopsUser)) { $notify_checkbox = new XoopsFormCheckBox('', 'notifypub', $notifypub); $notify_checkbox->addOption(1, _NW_NOTIFYPUBLISH); $option_tray->addElement($notify_checkbox); if ($xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { $nohtml_checkbox = new XoopsFormCheckBox('', 'nohtml', $nohtml); $nohtml_checkbox->addOption(1, _DISABLEHTML); $option_tray->addElement($nohtml_checkbox); } } $smiley_checkbox = new XoopsFormCheckBox('', 'nosmiley', $nosmiley); $smiley_checkbox->addOption(1, _DISABLESMILEY); $option_tray->addElement($smiley_checkbox); $sform->addElement($option_tray); [color=CC0000]// Captcha Hack $sform->addElement(new XoopsFormCaptcha()); // Captcha Hack[/color] //TODO: Approve checkbox + "Move to top" if editing + Edit indicator //Submit buttons $button_tray = new XoopsFormElementTray('' ,''); $preview_btn = new XoopsFormButton('', 'preview', _PREVIEW, 'submit'); $preview_btn->setExtra('accesskey="p"'); $button_tray->addElement($preview_btn); $submit_btn = new XoopsFormButton('', 'post', _NW_POST, 'submit'); $submit_btn->setExtra('accesskey="s"'); $button_tray->addElement($submit_btn); $sform->addElement($button_tray);


File: modules/news/include/submit.php
Line: 300

le="color: #000000"><?php //Display post edit form $returnside=intval($_POST['returnside']); include_once XOOPS_ROOT_PATH.'/modules/news/include/storyform.inc.php'; break; case 'post': [color=CC0000]// Captcha Hack if(@include_once XOOPS_ROOT_PATH . "/Frameworks/captcha/captcha.php") { $xoopsCaptcha = XoopsCaptcha::instance(); if(! $xoopsCaptcha->verify(true) ) { redirect_header(XOOPS_URL.'/modules/news/submit.php', 2, $xoopsCaptcha->getMessage()); } } // Captcha Hack[/color] $nohtml_db = isset($_POST['nohtml']) ? $_POST['nohtml'] : 1; if (is_object($xoopsUser) ) { $uid = $xoopsUser->getVar('uid'); if ($approveprivilege) { $nohtml_db = empty($_POST['nohtml']) ? 0 : 1; } if (isset($_POST['author']) && ($approveprivilege || $xoopsUser->isAdmin($xoopsModule->mid())) ) { $uid=intval($_POST['author']); } } else { $uid = 0; }

33
timgno
Re: Frameworks Captcha
  • 2008/6/6 10:58

  • timgno

  • Module Developer

  • Posts: 1504

  • Since: 2007/6/21


Sorry for my english!

I tried this hack with the version 2.0.18.1 of XOOPS but does not work. You may make changes for this?

Thank's

Who's Online

153 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 153


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits