User Registration Error

Discussion regarding Joomla! 1.5 security issues.
Joomla! Vulnerable Extensions: http://feeds.joomla.org/JoomlaSecurityV ... Extensions

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security Checklist
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
User avatar
Kiran cheema
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 153
Joined: Fri Nov 23, 2007 11:18 am

User Registration Error

Post by Kiran cheema » Mon Nov 26, 2007 11:51 am

Hi I am getting the following error when people try and register through the Register me :

Catchable fatal error: Object of class stdClass could not be converted to string in C:\xampp\htdocs\Joomla\libraries\joomla\document\html\renderer\message.php on line 70

I have had a look at the file and I cant understand why i'ts causing this.
I have set the authentication to automatic ( i.e. no account activation required)
The registration works that is if they go back to the home page and try and loging they can but it keeps displaying the above on initial registration?
The error is linked to this statement - line 70 is the bit in red?
if (count($msgs)) {
  $contents .= "\n".JText::_( $type )."";
  $contents .= "\n";
  $contents .= "\n\t";
  foreach ($msgs as $msg)
{
  $contents .="\n\t\t".$msg."";
}
  $contents .= "\n\t";
  $contents .= "\n";

taloch
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Nov 07, 2005 9:49 pm

Re: User Registration Error

Post by taloch » Mon Nov 26, 2007 6:46 pm

Hi,

I get exactly the same error message, but mostly a blank registration form comes up.

I get the correct message after I press the go button on the address bar in the browser.

"Welcome!
Welcome to the Registered User content of our site"

How do you write "press the go button on the address bar" in the code? Cause that will cure it!!

http://localhost/joomla153/index.php?option=com_user
is in the address bar when I press the go button on the address bar.

I also tried the   in my template index.php.
It didn't work, just got that error message.

Where in the index.php should that go? Anywhere special? I am using a RT Firenzie template BTW.


Regards, taloch
Last edited by taloch on Mon Nov 26, 2007 7:12 pm, edited 1 time in total.

taloch
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Nov 07, 2005 9:49 pm

Re: User Registration Error

Post by taloch » Wed Nov 28, 2007 9:09 pm

I have installed the Community Builder extension, and I am using the Community Builder Login Module.

It works perfectly with none of the above problems.

So this is a good work around for this error in j! 1.5

Regards, taloch

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: User Registration Error

Post by ianmac » Fri Nov 30, 2007 4:42 pm

Kiran cheema wrote: Hi I am getting the following error when people try and register through the Register me :

Catchable fatal error: Object of class stdClass could not be converted to string in C:\xampp\htdocs\Joomla\libraries\joomla\document\html\renderer\message.php on line 70

I have had a look at the file and I cant understand why i'ts causing this.
I have set the authentication to automatic ( i.e. no account activation required)
The registration works that is if they go back to the home page and try and loging they can but it keeps displaying the above on initial registration?
The error is linked to this statement - line 70 is the bit in red?
if (count($msgs)) {
  $contents .= "\n".JText::_( $type )."";
  $contents .= "\n";
  $contents .= "\n\t";
  foreach ($msgs as $msg)
{
  $contents .="\n\t\t".$msg."";
}
  $contents .= "\n\t";
  $contents .= "\n";
Can you add a line after line 52:
print_r( $msg['message'] );

And let us know what error you get?  I can't duplicate this here, and I suspect that something is getting an JException object instead of a string for a message.

Ian

User avatar
Kiran cheema
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 153
Joined: Fri Nov 23, 2007 11:18 am

Re: User Registration Error

Post by Kiran cheema » Fri Nov 30, 2007 4:57 pm

sure I'll give it a go..
I'm pretty new to PHP but I've done some digging and I think that it may have something to do with the
components/com_user/Controller.php File

I have been trying to follow the process through and I think that it may be the function Register_save that is causing the problem.

I was looking through the file and there is a bit at the end of this function this function uses $message instead of $msg as the others do.
If I change everything but "JError::raiseNotice('', $message);" to $msg then it displays a blank registration page, instead of the error.

// Everything went fine, set relevant message depending upon user activation state and display message
if ( $useractivation == 1 ) {
// Page Title
$document->setTitle( JText::_( 'REG_COMPLETE_ACTIVATE_TITLE' ) );
// Breadcrumb
$pathway->addItem( JText::_( 'REG_COMPLETE_ACTIVATE_TITLE' ));

$message->title = JText::_( 'REG_COMPLETE_ACTIVATE_TITLE' );
$message->text = JText::_( 'REG_COMPLETE_ACTIVATE' );
} else {
// Page Title
$document->setTitle( JText::_( 'REG_COMPLETE_TITLE' ) );
// Breadcrumb
$pathway->addItem( JText::_( 'REG_COMPLETE_TITLE' ));

$message->title = JText::_( 'REG_COMPLETE_TITLE' );
$message->text = JText::_( 'REG_COMPLETE' );
}
//TODO :: this needs to be replace by raiseMessage
JError::raiseNotice('', $message);

$this->register();
}

However I have downloaded the latest nightly build and have also noticed that there is a newer version of this file so was planning to swap it out and see if it makes a difference.

User avatar
Kiran cheema
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 153
Joined: Fri Nov 23, 2007 11:18 am

Re: User Registration Error

Post by Kiran cheema » Tue Dec 04, 2007 9:54 am

Hi
Just to say I did as ian said in his post and it started displaying a 403 error, I have since swapped out the components/Com_user/controller.php file with the one from the nightly build and this has fixed the error, registration is now followed by a "you many now log on" message

I am planning addin community builder as well (as suggested by taloch), but it feels good to have got it working!

taloch
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Nov 07, 2005 9:49 pm

Re: User Registration Error

Post by taloch » Tue Dec 04, 2007 2:42 pm

Thanks for the fix, it is working fine here now.

;D

gnottage
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Dec 13, 2007 4:18 pm

Re: User Registration Error

Post by gnottage » Thu Dec 13, 2007 4:25 pm

The existing fix only works for registration not requiring activation. Also it displays a registration form when the user has just registered (which could be confusing). I'm not sure how to get some changes into SVN for this, but the following are what I have done since previous fixed version) to allow for working registration with activation and not having the form displayed again:

components/Com_user/controller.php

function activate()
{
...

// Lets activate this user
jimport('joomla.user.helper');
if (JUserHelper::activateUser($activation))
{
$message  = JText::_( 'REG_ACTIVATE_COMPLETE' );
}
else
{
$message  = JText::_( 'REG_ACTIVATE_NOT_FOUND' );
}

//TODO :: this needs to be replace by raiseMessage
JError::raiseNotice('', $message);

// If the registration form should be displayed then uncomment this
// $this->register();

}

I would also advise commenting out the registration form in the function called register_save.


Locked

Return to “Security in Joomla! 1.5”