xoops forums

Biolit11

Just popping in
Posted on: 2008/9/13 16:01
Biolit11
Biolit11 (Show more)
Just popping in
Posts: 11
Since: 2003/6/19
#1

2.3 Registering issues

I have one site where the CAPTCHA image does not come up for new
registrations, I am still looking to see where the problem lies there.

I have another one on a different webserver that when trying to register it
gives the following error:

Parse error: syntax error, unexpected T_CASE in
/home/..../...../.../Test/register.php on line 219

I noticed that case statement does not have a break; and adding one in
didnt help. Looking at the previous case statement I could not find
anything wrong with it. Any thoughts?

ghia

Community Support Member
Posted on: 2008/9/13 16:17
ghia
ghia (Show more)
Community Support Member
Posts: 4954
Since: 2008/7/3 1
#2

Re: 2.3 Registering issues

Quote:
Any thoughts?

Maybe if you showed us the relevant PHP code block.

Biolit11

Just popping in
Posted on: 2008/9/14 7:34
Biolit11
Biolit11 (Show more)
Just popping in
Posts: 11
Since: 2003/6/19
#3

Re: 2.3 Registering issues

Well anyone can look at the 2.3 register.php file but here you go, lines 28 - 220

//$xoopsOption['pagetype'] = 'user';

include 'mainfile.php';
$module_handler xoops_gethandler('module');
$profile_module $module_handler->getByDirname('profile');
if (
$profile_module && $profile_module->getVar('isactive')) {
    
header("location: ./modules/profile/register.php" . (empty($_SERVER['QUERY_STRING']) ? "" "?" $_SERVER['QUERY_STRING']) );
    exit();
}

xoops_loadLanguage('user');
xoops_load("userUtility");

$myts =& MyTextSanitizer::getInstance();

$config_handler =& xoops_gethandler('config');
$xoopsConfigUser $config_handler->getConfigsByCat(XOOPS_CONF_USER);

if (empty(
$xoopsConfigUser['allow_register'])) {
    
redirect_header('index.php'6_US_NOREGISTER);
    exit();
}

    
function 
userCheck($uname$email$pass$vpass)
{
    
trigger_error("Function " __FUNCTION__ " is deprecated, use XoopsUserUtility::validate() instead"E_USER_WARNING);
    return 
XoopsUserUtility::validate($uname$email$pass$vpass);
}

$op = isset($_POST['op']) ? $_POST['op'] : ( isset($_GET["op"]) ? $_GET["op"] : 'register' );
$uname = isset($_POST['uname']) ? $myts->stripSlashesGPC($_POST['uname']) : '';
$email = isset($_POST['email']) ? trim($myts->stripSlashesGPC($_POST['email'])) : '';
$url = isset($_POST['url']) ? trim($myts->stripSlashesGPC($_POST['url'])) : '';
$pass = isset($_POST['pass']) ? $myts->stripSlashesGPC($_POST['pass']) : '';
$vpass = isset($_POST['vpass']) ? $myts->stripSlashesGPC($_POST['vpass']) : '';
$timezone_offset = isset($_POST['timezone_offset']) ? intval($_POST['timezone_offset']) : $xoopsConfig['default_TZ'];
$user_viewemail = (isset($_POST['user_viewemail']) && intval($_POST['user_viewemail'])) ? 0;
$user_mailok = (isset($_POST['user_mailok']) && intval($_POST['user_mailok'])) ? 0;
$agree_disc = (isset($_POST['agree_disc']) && intval($_POST['agree_disc'])) ? 0;

switch ( 
$op ) {
case 
'newuser':
    include 
'header.php';
    
$stop '';
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        
$stop .= implode('<br />'$GLOBALS['xoopsSecurity']->getErrors())."<br />";
    }
    if (
$xoopsConfigUser['reg_dispdsclmr'] != && $xoopsConfigUser['reg_disclaimer'] != '') {
        if (empty(
$agree_disc)) {
            
$stop .= _US_UNEEDAGREE.'<br />';
        }
    }
    
$stop .= XoopsUserUtility::validate($uname$email$pass$vpass);
    if (empty(
$stop)) {
        echo 
_US_USERNAME.": ".$myts->htmlSpecialChars($uname)."<br />";
        echo 
_US_EMAIL.": ".$myts->htmlSpecialChars($email)."<br />";
        if (
$url != '') {
            
$url formatURL($url);
            echo 
_US_WEBSITE.': '.$myts->htmlSpecialChars($url).'<br />';
        }
        
$f_timezone = ($timezone_offset 0) ? 'GMT '.$timezone_offset 'GMT +'.$timezone_offset;
        echo 
_US_TIMEZONE.": $f_timezone<br />";
        echo 
"<form action='register.php' method='post'>";
        
xoops_load("XoopsFormCaptcha");
        
$cpatcha = new XoopsFormCaptcha();
        echo 
"<br />".$cpatcha->getCaption().": ".$cpatcha->render();
        echo 
"
        <input type='hidden' name='uname' value='"
.$myts->htmlSpecialChars($uname)."' />
        <input type='hidden' name='email' value='"
.$myts->htmlSpecialChars($email)."' />";
        echo 
"<input type='hidden' name='user_viewemail' value='".$user_viewemail."' />
        <input type='hidden' name='timezone_offset' value='"
.(float)$timezone_offset."' />
        <input type='hidden' name='url' value='"
.$myts->htmlSpecialChars($url)."' />
        <input type='hidden' name='pass' value='"
.$myts->htmlSpecialChars($pass)."' />
        <input type='hidden' name='vpass' value='"
.$myts->htmlSpecialChars($vpass)."' />
        <input type='hidden' name='user_mailok' value='"
.$user_mailok."' />
        <br /><br /><input type='hidden' name='op' value='finish' />"
.$GLOBALS['xoopsSecurity']->getTokenHTML()."<input type='submit' value='"_US_FINISH ."' /></form>";
    } else {
        echo 
"<span style='color:#ff0000;'>$stop</span>";
        include 
'include/registerform.php';
        
$reg_form->display();
    }
    include 
'footer.php';
    break;
    
case 
'finish':
    include 
'header.php';
    
$stop XoopsUserUtility::validate($uname$email$pass$vpass);
    if (!
$GLOBALS['xoopsSecurity']->check()) {
        
$stop .= implode('<br />'$GLOBALS['xoopsSecurity']->getErrors()) . "<br />";
    }
    
xoops_load("captcha");
    
$xoopsCaptcha XoopsCaptcha::getInstance();
    if( !
$xoopsCaptcha->verify() ) {
        
$stop .= $xoopsCaptcha->getMessage()."<br />";
    }
    if ( empty(
$stop) ) {
        
$member_handler =& xoops_gethandler('member');
        
$newuser =& $member_handler->createUser();
        
$newuser->setVar('user_viewemail',$user_viewemailtrue);
        
$newuser->setVar('uname'$unametrue);
        
$newuser->setVar('email'$emailtrue);
        if (
$url != '') {
            
$newuser->setVar('url'formatURL($url), true);
        }
        
$newuser->setVar('user_avatar','blank.gif'true);
        
$actkey substr(md5(uniqid(mt_rand(), 1)), 08);
        
$newuser->setVar('actkey'$actkeytrue);
        
$newuser->setVar('pass'md5($pass), true);
        
$newuser->setVar('timezone_offset'$timezone_offsettrue);
        
$newuser->setVar('user_regdate'time(), true);
        
$newuser->setVar('uorder',$xoopsConfig['com_order'], true);
        
$newuser->setVar('umode',$xoopsConfig['com_mode'], true);
        
$newuser->setVar('user_mailok',$user_mailoktrue);
        if (
$xoopsConfigUser['activation_type'] == 1) {
            
$newuser->setVar('level'1true);
        }
        if (!
$member_handler->insertUser($newuser)) {
            echo 
_US_REGISTERNG;
            include 
'footer.php';
            exit();
        }
        
$newid $newuser->getVar('uid');
        if (!
$member_handler->addUserToGroup(XOOPS_GROUP_USERS$newid)) {
            echo 
_US_REGISTERNG;
            include 
'footer.php';
            exit();
        }
        if (
$xoopsConfigUser['activation_type'] == 1) {
            
XoopsUserUtility::sendWelcome($newuser);
            
redirect_header('index.php'4_US_ACTLOGIN);
            exit();
        }
        
// Sending notification email to user for self activation
        
if ($xoopsConfigUser['activation_type'] == 0) {
            
$xoopsMailer =& xoops_getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('register.tpl');
            
$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(_US_USERKEYFOR$uname));
            if ( !
$xoopsMailer->send() ) {
                echo 
_US_YOURREGMAILNG;
            } else {
                echo 
_US_YOURREGISTERED;
            }
        
// Sending notification email to administrator for activation
        
} elseif ($xoopsConfigUser['activation_type'] == 2) {
            
$xoopsMailer =& xoops_getMailer();
            
$xoopsMailer->useMail();
            
$xoopsMailer->setTemplate('adminactivate.tpl');
            
$xoopsMailer->assign('USERNAME'$uname);
            
$xoopsMailer->assign('USEREMAIL'$email);
            
$xoopsMailer->assign('USERACTLINK'XOOPS_URL.'/register.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($xoopsConfigUser['activation_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_USERKEYFOR$uname));
            if ( !
$xoopsMailer->send() ) {
                echo 
_US_YOURREGMAILNG;
            } else {
                echo 
_US_YOURREGISTERED2;
            }
        }
        if (
$xoopsConfigUser['new_user_notify'] == && !empty($xoopsConfigUser['new_user_notify_group'])) {
            
$xoopsMailer =& xoops_getMailer();
            
$xoopsMailer->useMail();
            
$member_handler =& xoops_gethandler('member');
            
$xoopsMailer->setToGroups($member_handler->getGroup($xoopsConfigUser['new_user_notify_group']));
            
$xoopsMailer->setFromEmail($xoopsConfig['adminmail']);
            
$xoopsMailer->setFromName($xoopsConfig['sitename']);
            
$xoopsMailer->setSubject(sprintf(_US_NEWUSERREGAT,$xoopsConfig['sitename']));
            
$xoopsMailer->setBody(sprintf(_US_HASJUSTREG$uname));
            
$xoopsMailer->send();
        }
    } else {
        echo 
"<span style='color:#ff0000; font-weight:bold;'>$stop</span>";
        include 
'include/registerform.php';
        
$reg_form->display();
    }
    include 
'footer.php';
    break;
    
case 
'actv':
case 
'activate':

Marco

Home away from home
Posted on: 2008/9/14 15:51
Marco
Marco (Show more)
Home away from home
Posts: 1256
Since: 2004/3/15
#4

Re: 2.3 Registering issues

hello,

what are the php/mysql environment of the respective websites where the errors occured?
thx
Do synergy or die.

Biolit11

Just popping in
Posted on: 2008/9/14 16:23
Biolit11
Biolit11 (Show more)
Just popping in
Posts: 11
Since: 2003/6/19
#5

Re: 2.3 Registering issues

On the site where I am having troubles with the captcha image I have setup another install of it and that one works fine. So I at first figured that it might be the theme on the site but changing it back to default had no effect on it. On this site instead of showing the captcha image it has the following

Confirmation CodeClick to refresh the image if it is not clear enough.


And this is the php and MySQL for the server.

XOOPS Version - XOOPS 2.3.0 RC2
PHP Version - 5.2.3
MySQL Version - 5.0.41-community-log
Server API Version - cgi-fcgi
OS Version - Linux

On the site where the php error occurred when going to register it is running a newer version of PHP.

XOOPS Version - XOOPS 2.3.0 RC2
PHP Version - 5.2.6
MySQL Version - 4.1.22-standard
Server API Version - cgi
OS Version - Linux

Marco

Home away from home
Posted on: 2008/9/17 18:25
Marco
Marco (Show more)
Home away from home
Posts: 1256
Since: 2004/3/15
#6

Re: 2.3 Registering issues

can you test with RC3?
and infirm/confirm this?
thx
Do synergy or die.

marook

Friend of XOOPS
Posted on: 2008/9/25 5:11
marook
marook (Show more)
Friend of XOOPS
Posts: 89
Since: 2002/9/9 1
#7

Re: 2.3 Registering issues

Quote:

Biolit11 wrote:
I have one site where the CAPTCHA image does not come up for new
registrations, I am still looking to see where the problem lies there.


I have a site that seems to do that as well: www.hjemme.dk

XOOPS Version: XOOPS 2.3.0
PHP Version: 5.2.6
MySQL Version: 5.0.45-log
Server API Version: apache2handler
OS Version: Darwin
Marook,

Want to go on a Safari with me?
(Yes, it is me in that avatar.. )

marook

Friend of XOOPS
Posted on: 2008/9/25 5:28
marook
marook (Show more)
Friend of XOOPS
Posts: 89
Since: 2002/9/9 1
#8

Re: 2.3 Registering issues

Hmm, in line 45 in
Quote:

/class/captcha/xoopscaptcha.php

it says:
Quote:

$this->path_plugin = XOOPS_ROOT_PATH . "/Frameworks/captcha";


but Frameworks does NOT have that captcha folder! Could that be it?
Marook,

Want to go on a Safari with me?
(Yes, it is me in that avatar.. )

Biolit11

Just popping in
Posted on: 2008/9/26 4:28
Biolit11
Biolit11 (Show more)
Just popping in
Posts: 11
Since: 2003/6/19
#9

Re: 2.3 Registering issues

Sorry for not replying Marco but Im not sure what exactly the reason behind this is. I have in the meantime with the same build that I had the problem done a separate install and that functioned without a problem. And the newer builds do not have that issue.

I am finding tho that for some reason fresh installs have little problem and that being the install in a brand new folder on the server. But if I remove old files from an existing folder that had a XOOPS install I constantly have problems.

And as for the captcha it works fine in a fresh install in a new folder but not from where an old install was.

karasu

Just popping in
Posted on: 2008/9/26 13:05
karasu
karasu (Show more)
Just popping in
Posts: 22
Since: 2006/6/26
#10

Re: 2.3 Registering issues

I have the same problem ofter upgraded to 2.30

this is error massages

Resized Image

system information

System Overview «
XOOPS Version - XOOPS 2.3.0
PHP Version - 4.3.2
MySQL Version - 3.23.58
Server API Version - apache
OS Version - FreeBSD

safe_mode - On
register_globals - On
magic_quotes_gpc - On
allow_url_fopen - On
fsockopen - On
allow_call_time_pass_reference - On
post_max_size - 8M
max_input_time - -1
output_buffering -
max_execution_time - 30
memory_limit -
file_uploads - On
upload_max_filesize - 2M

can someone help me please

thank you for your kindness