1
Hadesteam
2.2.3 How to register.php with captcha?
  • 2014/7/7 13:39

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


Hi everybody,

My xoops version is 2.2.3 . I have very big problem with many bots registration (200-300 a day).

I need some protection, maybe captcha image ?

if there is a possibility to change the file (register.php) so that it has system Captcha ?

for now I would like to pause the update to the latest version of xoops

Please look at this register.php and help me.

<?php
// $Id: register.php,v 1.1.2.13.2.1 2005/09/18 13:59:36 mithyt2 Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include '../../mainfile.php';
include_once 
'include/functions.php';
$myts =& MyTextSanitizer::getInstance();


if (empty(
$xoopsModuleConfig['allow_register'])) {
    
redirect_header('../../index.php'6_PROFILE_MA_NOREGISTER);
    exit();
}
include 
XOOPS_ROOT_PATH.'/header.php';

$member_handler =& xoops_gethandler('member');
$newuser =& $member_handler->createUser();
$op = !isset($_POST['op']) ? 'register' $_POST['op'];
if (
$op != "register") {
    
$newuser->setVar('uname', isset($_POST['uname']) ? trim($_POST['uname']) : '');
    
$newuser->setVar('loginname', isset($_POST['loginname']) ? trim($_POST['loginname']) : '');
    
$newuser->setVar('email', isset($_POST['email']) ? trim($_POST['email']) : '');

    
//Dynamic fields
    
$profile_handler =& xoops_gethandler('profile');
    
// Get fields
    
$fields =& $profile_handler->loadFields();
    if (
count($fields) > 0) {
        foreach (
array_keys($fields) as $i) {
            
$fieldname $fields[$i]->getVar('field_name');
            if (
$fields[$i]->getVar('field_register') && isset($_POST[$fieldname])) {
                
$newuser->setVar($fieldname$_POST[$fieldname]);
            }
        }
    }

    
$vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : '';
    
$agree_disc = (isset($_POST['agree_disc']) && intval($_POST['agree_disc'])) ? 0;
}
switch ( 
$op ) {
    case 
'newuser':
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        echo 
implode('<br />'$GLOBALS['xoopsSecurity']->getErrors());
        break;
    }
    
$newuser->setVar('pass', isset($_POST['pass']) ? md5(trim($_POST['pass'])) : '');
    
$stop '';
    if (
$xoopsModuleConfig['display_disclaimer'] != && $xoopsModuleConfig['disclaimer'] != '') {
        if (empty(
$agree_disc)) {
            
$stop .= _PROFILE_MA_UNEEDAGREE.'<br />';
        }
    }
    if (!empty(
$xoopsModuleConfig['minpass']) && strlen(trim($_POST['pass'])) < $xoopsModuleConfig['minpass']) {
        
$stop .= sprintf(_PROFILE_MA_PWDTOOSHORT,$xoopsModuleConfig['minpass'])."<br />";
    }
    
$stop .= userCheck($newuser);
    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 />";
        
$profile_handler =& xoops_gethandler('profile');
        
// Get fields
        
$fields =& $profile_handler->loadFields();
        if (
count($fields) > 0) {
            foreach (
array_keys($fields) as $i) {
                
$fieldname $fields[$i]->getVar('field_name');
                if (
$fields[$i]->getVar('field_register') && isset($_POST[$fieldname])) {
                    
$value $newuser->getVar($fieldname);
                    if (
is_array($value)) {
                        
$values = array();
                        
$options $fields[$i]->getVar('field_options');
                        foreach (
$value as $thisvalue) {
                            
$values $options[$thisvalue];
                        }
                        
$value implode(', '$values);
                    }
                    echo 
$fields[$i]->getVar('field_title').": ".$value."<br />";
                }
            }
        }
        
//hidden POST form with variables
        
include_once 'include/forms.php';
        
$finish_form =& getFinishForm($newuser$vpass);
        
$finish_form->display();
    } else {
        echo 
"<div class='errorMsg'>$stop</div><br clear='both'>";
        include_once 
'include/forms.php';
        
$reg_form =& getRegisterForm($newuser);
        
$reg_form->display();
    }
    break;
    
    case 
'finish':
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        echo 
implode('<br />'$GLOBALS['xoopsSecurity']->getErrors());
        break;
    }

    
$stop '';
    if (
$xoopsModuleConfig['display_disclaimer'] != && $xoopsModuleConfig['disclaimer'] != '') {
        if (empty(
$agree_disc)) {
            
$stop .= _PROFILE_MA_UNEEDAGREE.'<br />';
        }
    }
    
$stop userCheck($newuser);
    if ( empty(
$stop) ) {
        
$newuser->setVar('pass'$_POST['pass']);
        
$newuser->setVar('user_avatar','blank.gif');
        
$actkey substr(md5(uniqid(mt_rand(), 1)), 08);
        
$newuser->setVar('actkey'$actkey);
        
$newuser->setVar('user_regdate'time());
        if (
$xoopsModuleConfig['activation_type'] == 1) {
            
$newuser->setVar('level'1);
        }

        
$profile_handler =& xoops_gethandler('profile');
        
// Get fields
        
$fields =& $profile_handler->loadFields();
        if (
count($fields) > 0) {
            foreach (
array_keys($fields) as $i) {
                
$fieldname $fields[$i]->getVar('field_name');
                if (
$fields[$i]->getVar('field_register') && isset($_POST[$fieldname])) {
                    
$newuser->setVar($fieldname$_POST[$fieldname]);
                }
            }
        }
        if (!
$member_handler->insertUser($newuser)) {
            echo 
_PROFILE_MA_REGISTERNG;
            echo 
implode('<br />'$newuser->getErrors());
            break;
        }
        
$newid $newuser->getVar('uid');
        if (!
$member_handler->addUserToGroup(XOOPS_GROUP_USERS$newid)) {
            echo 
_PROFILE_MA_REGISTERNG;
            break;
        }
        if (
$xoopsModuleConfig['activation_type'] == 1) {
            
redirect_header(XOOPS_URL.'/index.php'4_PROFILE_MA_ACTLOGIN);
        }
        if (
$xoopsModuleConfig['activation_type'] == 0) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('register.tpl');
            
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/profile/language/".$xoopsConfig['language']."/mail_template");
            
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
            
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
            
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
            
$xoopsMailer->setToUsers(new XoopsUser($newid));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_PROFILE_MA_USERKEYFOR$newuser->getVar('uname')));
            if ( !
$xoopsMailer->send() ) {
                echo 
_PROFILE_MA_YOURREGMAILNG;
            } else {
                echo 
_PROFILE_MA_YOURREGISTERED;
            }
        } elseif (
$xoopsModuleConfig['activation_type'] == 2) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('adminactivate.tpl');
            
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/profile/language/".$xoopsConfig['language']."/mail_template");
            
$xoopsMailer->assign('USERNAME'$newuser->getVar('uname'));
            
$xoopsMailer->assign('USEREMAIL'$newuser->getVar('email'));
            
$xoopsMailer->assign('USERACTLINK'XOOPS_URL.'/modules/profile/activate.php?op=actv&id='.$newid.'&actkey='.$actkey);
            
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
            
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
            
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsModuleConfig['activation_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_PROFILE_MA_USERKEYFOR$newuser->getVar('uname')));
            if ( !
$xoopsMailer->send() ) {
                echo 
_PROFILE_MA_YOURREGMAILNG;
            } else {
                echo 
_PROFILE_MA_YOURREGISTERED2;
            }
        }
        if (
$xoopsModuleConfig['new_user_notify'] == && !empty($xoopsModuleConfig['new_user_notify_group'])) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsModuleConfig['new_user_notify_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_PROFILE_MA_NEWUSERREGAT,$xoopsConfig['sitename']));
            
$xoopsMailer->setBody(sprintf(_PROFILE_MA_HASJUSTREG$newuser->getVar('uname')));
            
$xoopsMailer->send();
        }
    } else {
        echo 
"<div class='errorMsg'>$stop</div><br clear='both'>";
        include_once 
'include/forms.php';
        
$reg_form =& getRegisterForm($newuser);
        
$reg_form->display();
    }
    break;
    
    case 
'register':
    default:
    include_once 
'include/forms.php';
    
$reg_form =& getRegisterForm($newuser);
    
$reg_form->display();

    break;
}
include 
XOOPS_ROOT_PATH.'/footer.php';
?>


regards from Poland.

2
mandrake
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/7 14:43

  • mandrake

  • Just popping in

  • Posts: 16

  • Since: 2014/5/26


you can use this captcha module (it's a hack,not installation), just upload files in roots, nothing else, very easy to use.

XOOPS2_hack_AntiBotSignup_1.04_unkown

You can find it in module section.

Here:https://xoops.org/modules/repository/viewcat.php?cid=43

I have installed it in my xoops 2.5.6 and it's work's perfectly, if you not need english,just change some line in register.php and class/captcha/hn_captcha.class.php

10 minutes for do that.

3
Hadesteam
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/7 18:05

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


thank you, i uploaded each files, when I click register this message appears: "_US_NOREGISTER"

http://www.kulturystyka.org.pl/register.php

My original file register.php :

<?php
// $Id: register.php,v 1.13.4.1.2.3 2005/04/23 09:55:39 mithyt2 Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

include 'mainfile.php';
$parsed_url parse_url($_SERVER['REQUEST_URI']);
$url "modules/profile/register.php";
header('location: '.$url);
//this file is deprecated
?>


Please help.

4
Hadesteam
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/7 19:10

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


When i click register.php redirects tohttp://www.kulturystyka.org.pl/modules/profile/register.php

My original modules/profile/register.php :

<?php
// $Id: register.php,v 1.1.2.13.2.1 2005/09/18 13:59:36 mithyt2 Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
include '../../mainfile.php';
include_once 
'include/functions.php';
$myts =& MyTextSanitizer::getInstance();


if (empty(
$xoopsModuleConfig['allow_register'])) {
    
redirect_header('../../index.php'6_PROFILE_MA_NOREGISTER);
    exit();
}
include 
XOOPS_ROOT_PATH.'/header.php';

$member_handler =& xoops_gethandler('member');
$newuser =& $member_handler->createUser();
$op = !isset($_POST['op']) ? 'register' $_POST['op'];
if (
$op != "register") {
    
$newuser->setVar('uname', isset($_POST['uname']) ? trim($_POST['uname']) : '');
    
$newuser->setVar('loginname', isset($_POST['loginname']) ? trim($_POST['loginname']) : '');
    
$newuser->setVar('email', isset($_POST['email']) ? trim($_POST['email']) : '');

    
//Dynamic fields
    
$profile_handler =& xoops_gethandler('profile');
    
// Get fields
    
$fields =& $profile_handler->loadFields();
    if (
count($fields) > 0) {
        foreach (
array_keys($fields) as $i) {
            
$fieldname $fields[$i]->getVar('field_name');
            if (
$fields[$i]->getVar('field_register') && isset($_POST[$fieldname])) {
                
$newuser->setVar($fieldname$_POST[$fieldname]);
            }
        }
    }

    
$vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : '';
    
$agree_disc = (isset($_POST['agree_disc']) && intval($_POST['agree_disc'])) ? 0;
}
switch ( 
$op ) {
    case 
'newuser':
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        echo 
implode('<br />'$GLOBALS['xoopsSecurity']->getErrors());
        break;
    }
    
$newuser->setVar('pass', isset($_POST['pass']) ? md5(trim($_POST['pass'])) : '');
    
$stop '';
    if (
$xoopsModuleConfig['display_disclaimer'] != && $xoopsModuleConfig['disclaimer'] != '') {
        if (empty(
$agree_disc)) {
            
$stop .= _PROFILE_MA_UNEEDAGREE.'<br />';
        }
    }
    if (!empty(
$xoopsModuleConfig['minpass']) && strlen(trim($_POST['pass'])) < $xoopsModuleConfig['minpass']) {
        
$stop .= sprintf(_PROFILE_MA_PWDTOOSHORT,$xoopsModuleConfig['minpass'])."<br />";
    }
    
$stop .= userCheck($newuser);
    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 />";
        
$profile_handler =& xoops_gethandler('profile');
        
// Get fields
        
$fields =& $profile_handler->loadFields();
        if (
count($fields) > 0) {
            foreach (
array_keys($fields) as $i) {
                
$fieldname $fields[$i]->getVar('field_name');
                if (
$fields[$i]->getVar('field_register') && isset($_POST[$fieldname])) {
                    
$value $newuser->getVar($fieldname);
                    if (
is_array($value)) {
                        
$values = array();
                        
$options $fields[$i]->getVar('field_options');
                        foreach (
$value as $thisvalue) {
                            
$values $options[$thisvalue];
                        }
                        
$value implode(', '$values);
                    }
                    echo 
$fields[$i]->getVar('field_title').": ".$value."<br />";
                }
            }
        }
        
//hidden POST form with variables
        
include_once 'include/forms.php';
        
$finish_form =& getFinishForm($newuser$vpass);
        
$finish_form->display();
    } else {
        echo 
"<div class='errorMsg'>$stop</div><br clear='both'>";
        include_once 
'include/forms.php';
        
$reg_form =& getRegisterForm($newuser);
        
$reg_form->display();
    }
    break;
    
    case 
'finish':
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        echo 
implode('<br />'$GLOBALS['xoopsSecurity']->getErrors());
        break;
    }

    
$stop '';
    if (
$xoopsModuleConfig['display_disclaimer'] != && $xoopsModuleConfig['disclaimer'] != '') {
        if (empty(
$agree_disc)) {
            
$stop .= _PROFILE_MA_UNEEDAGREE.'<br />';
        }
    }
    
$stop userCheck($newuser);
    if ( empty(
$stop) ) {
        
$newuser->setVar('pass'$_POST['pass']);
        
$newuser->setVar('user_avatar','blank.gif');
        
$actkey substr(md5(uniqid(mt_rand(), 1)), 08);
        
$newuser->setVar('actkey'$actkey);
        
$newuser->setVar('user_regdate'time());
        if (
$xoopsModuleConfig['activation_type'] == 1) {
            
$newuser->setVar('level'1);
        }

        
$profile_handler =& xoops_gethandler('profile');
        
// Get fields
        
$fields =& $profile_handler->loadFields();
        if (
count($fields) > 0) {
            foreach (
array_keys($fields) as $i) {
                
$fieldname $fields[$i]->getVar('field_name');
                if (
$fields[$i]->getVar('field_register') && isset($_POST[$fieldname])) {
                    
$newuser->setVar($fieldname$_POST[$fieldname]);
                }
            }
        }
        if (!
$member_handler->insertUser($newuser)) {
            echo 
_PROFILE_MA_REGISTERNG;
            echo 
implode('<br />'$newuser->getErrors());
            break;
        }
        
$newid $newuser->getVar('uid');
        if (!
$member_handler->addUserToGroup(XOOPS_GROUP_USERS$newid)) {
            echo 
_PROFILE_MA_REGISTERNG;
            break;
        }
        if (
$xoopsModuleConfig['activation_type'] == 1) {
            
redirect_header(XOOPS_URL.'/index.php'4_PROFILE_MA_ACTLOGIN);
        }
        if (
$xoopsModuleConfig['activation_type'] == 0) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('register.tpl');
            
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/profile/language/".$xoopsConfig['language']."/mail_template");
            
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
            
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
            
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
            
$xoopsMailer->setToUsers(new XoopsUser($newid));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_PROFILE_MA_USERKEYFOR$newuser->getVar('uname')));
            if ( !
$xoopsMailer->send() ) {
                echo 
_PROFILE_MA_YOURREGMAILNG;
            } else {
                echo 
_PROFILE_MA_YOURREGISTERED;
            }
        } elseif (
$xoopsModuleConfig['activation_type'] == 2) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('adminactivate.tpl');
            
$xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH."/modules/profile/language/".$xoopsConfig['language']."/mail_template");
            
$xoopsMailer->assign('USERNAME'$newuser->getVar('uname'));
            
$xoopsMailer->assign('USEREMAIL'$newuser->getVar('email'));
            
$xoopsMailer->assign('USERACTLINK'XOOPS_URL.'/modules/profile/activate.php?op=actv&id='.$newid.'&actkey='.$actkey);
            
$xoopsMailer->assign('SITENAME'$xoopsConfig['sitename']);
            
$xoopsMailer->assign('ADMINMAIL'$xoopsConfig['adminmail']);
            
$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsModuleConfig['activation_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_PROFILE_MA_USERKEYFOR$newuser->getVar('uname')));
            if ( !
$xoopsMailer->send() ) {
                echo 
_PROFILE_MA_YOURREGMAILNG;
            } else {
                echo 
_PROFILE_MA_YOURREGISTERED2;
            }
        }
        if (
$xoopsModuleConfig['new_user_notify'] == && !empty($xoopsModuleConfig['new_user_notify_group'])) {
            
$xoopsMailer =& getMailer();
            
$xoopsMailer->useMail();
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsModuleConfig['new_user_notify_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_PROFILE_MA_NEWUSERREGAT,$xoopsConfig['sitename']));
            
$xoopsMailer->setBody(sprintf(_PROFILE_MA_HASJUSTREG$newuser->getVar('uname')));
            
$xoopsMailer->send();
        }
    } else {
        echo 
"<div class='errorMsg'>$stop</div><br clear='both'>";
        include_once 
'include/forms.php';
        
$reg_form =& getRegisterForm($newuser);
        
$reg_form->display();
    }
    break;
    
    case 
'register':
    default:
    include_once 
'include/forms.php';
    
$reg_form =& getRegisterForm($newuser);
    
$reg_form->display();

    break;
}
include 
XOOPS_ROOT_PATH.'/footer.php';
?>


Please help me.

5
Mamba
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 0:07

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Quote:
My xoops version is 2.2.3 . I have very big problem with many bots registration (200-300 a day).

The best way is to update to XOOPS 2.5.7.

XOOPS 2.2.3 is way too old, and not supported anymore. That's why we always recommend to update to newer versions of XOOPS, so the users can take advantage of newer developments, incl. security updates.

Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

6
Hadesteam
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 11:40

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


Mamba: już od dłuższego czasu się nad tym zastanawiałem. Pewnie niektóre moduły nie będą poprawnie działać, ale są chyba jakieś dobre ich zamienniki?

Najbardziej zależy mi na modułach: news, myalbum, zeby nie stracić komentarzy użytkowników etc.

Czyli teraz mam zrobić kopię zapasową i nadpisać wszystkie pliki najnowszej wersji 2.5.7 i uruchomić update ? Powiedz mi tylko gdzie mam umieścić ten katalog upgrade? W głównym katalogu serwisu ?

Pozdrawiam

(google translate):

Mamba: for a long time I thought about it. Sure, some modules will not work properly, but there are probably some good replacements for them?

Most care about the modules: news, MyAlbum, lest they lose user comments etc..

So now I do a backup and overwrite all the files the latest version 2.5.7 and run the update? Tell me where do I put this directory upgrade? In the root directory of the site?

Regards

7
Mamba
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 12:18

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


1) Make sure, you have at least PHP 5.3.7 installed, and that you have the current versions of the modules that you want to update (e.g. News, MyAlbum)

2) Do backup of all the files, as well as the DB

3a) copy files from XOOPS 2.5.7 /htdocs to your XOOPS installation

3b) in case, you have moved or renamed the /xoops_lib and /xoops_data folders, makes sure that the files from these folders in XOOPS 2.5.7 go to the appropriate folders in your installation

4) copy the /upgrade folder to your XOOPS installation

5) go tohttp://yoursite.com/upgrade and run it, this will include updating the System module

6) Update the PM, Profile, and Protector modules

7) Try to update your other modules and see if they work.

Before you make it all, you might also install WampServer on your PC, copy your current Website there, incl. the DB, and test the upgrade over there first.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

8
Hadesteam
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 12:36

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


I made copy a whole page and database and start update on this adress :

http://www.kulturystyka.org.pl/new/

I hope that everything is successful, I'll write when I have problems

Thanks Mamba for all Your advice

9
Hadesteam
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 13:11

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


Please look at this:http://i62.tinypic.com/5pog28.jpg

Errors:http://i57.tinypic.com/eirqck.jpg

When i try to login for admin panel i have blank page... so i cant update pm, profile and protector module

forgot to point out that during the renovation were Polish characters in the database

10
mandrake
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 13:40

  • mandrake

  • Just popping in

  • Posts: 16

  • Since: 2014/5/26


Hi

_us_noregister is in your file user php at line 43

This is the line:

define('_US_NOREGISTER', 'Sorry, we are currently closed for new user registrations');

You simply d'ont allow new user registration, it's in your configuration.

It's strange you don't have this line, in your version.

AntiBot Signup Protection has been doing for old xoops 2.0 version but it work whith 2.5.6,so i think it work for you too, just set correctly your website for accept new user.

Login

Who's Online

172 user(s) are online (105 user(s) are browsing Support Forums)


Members: 0


Guests: 172


more...

Donat-O-Meter

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

Latest GitHub Commits