141
Hadesteam
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 15:52

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


When i disabled Protector in phpmyadmin I inputs to the admin panel

Please look at this:http://www.kulturystyka.org.pl/panel-admina.gif



142
Hadesteam
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 15:26

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


yes, every xoops version update is completed (green birds). from 2.0 to 2.5.6

http://www.kulturystyka.org.pl/po-aktualizacji.jpg



143
Hadesteam
Re: 2.2.3 How to register.php with captcha?
  • 2014/7/8 14:16

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


Mamba please help me. I have 2.5.7 version but i cant enter to admin panel, edit profile etc.http://www.kulturystyka.org.pl/new/ when i try enter admin panel for update modules: profile, pm, protecor i have a blank page.

Look at this :http://www.kulturystyka.org.pl/nowyserwis-blad.jpg



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

  • Hadesteam

  • Not too shy to talk

  • Posts: 162

  • Since: 2011/9/5 1


Now i try to update to xoops 2.5.7 how do I already have a captcha when registering

I add this into database:

CREATE TABLE xoops_priv_msgs (
msg_id mediumint(8) unsigned NOT NULL auto_increment,
msg_image varchar(100) default NULL,
subject varchar(255) NOT NULL default '',
from_userid mediumint(8) unsigned NOT NULL default '0',
to_userid mediumint(8) unsigned NOT NULL default '0',
msg_time int(10) unsigned NOT NULL default '0',
msg_text text,
read_msg tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (msg_id),
KEY to_userid (to_userid),
KEY touseridreadmsg (to_userid,read_msg),
KEY msgidfromuserid (from_userid, msg_id)
) ENGINE=MyISAM;

"Yoy dont need update, please delete 'upgrade' from server" - i do this.

Now i cant enter to admin panel, edit profile = blank page.



145
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



146
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



147
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



148
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.



149
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.



150
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.




TopTop
« 1 ... 12 13 14 (15) 16 17 »



Login

Who's Online

222 user(s) are online (145 user(s) are browsing Support Forums)


Members: 0


Guests: 222


more...

Donat-O-Meter

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

Latest GitHub Commits