[LOW:FIXED 6484:1.0.11] Bug found in com_registration 1.0.10

Locked
User avatar
ircmaxell
Joomla! Ace
Joomla! Ace
Posts: 1926
Joined: Thu Nov 10, 2005 3:10 am
Location: New Jersey, USA
Contact:

[LOW:FIXED 6484:1.0.11] Bug found in com_registration 1.0.10

Post by ircmaxell » Thu Jul 13, 2006 8:32 am

In function activate($option), I believe there is an error...  If the UPDATE fails, it just tells the user that activation was completed.  There should be another error message to say that activation failed...

Code: Select all

	$query = "SELECT id"
	. "\n FROM #__users"
	. "\n WHERE activation = '$activation'"
	. "\n AND block = 1"
	;
	$database->setQuery( $query );
	$result = $database->loadResult();

	if ($result) {
		$query = "UPDATE #__users"
		. "\n SET block = 0, activation = ''"
		. "\n WHERE activation = '$activation'"
		. "\n AND block = 1"
		;
		$database->setQuery( $query );
		if (!$database->query()) {
			echo "SQL error" . $database->stderr(true);
		}
		echo _REG_ACTIVATE_COMPLETE;
	} else {
		echo _REG_ACTIVATE_NOT_FOUND;
	}
}
Last edited by Robin on Mon Dec 04, 2006 1:20 pm, edited 1 time in total.
Anthony Ferrara - Core Team - Development Coordinator - Bug Squad - JSST

http://moovum.com/ - The Bird is in the air! Get Mollom Anti-Spam on your Joomla! website with Moovur...
http://www.joomlaperformance.com For All Your Joomla Performance Needs

User avatar
RobS
Joomla! Ace
Joomla! Ace
Posts: 1367
Joined: Mon Dec 05, 2005 10:17 am
Location: New Orleans, LA, USA
Contact:

Re: Possible bug found in com_registration 1.0.10

Post by RobS » Thu Jul 13, 2006 8:57 am

ircmaxell wrote: In function activate($option), I believe there is an error...  If the UPDATE fails, it just tells the user that activation was completed.  There should be another error message to say that activation failed...

Code: Select all

	$query = "SELECT id"
	. "\n FROM #__users"
	. "\n WHERE activation = '$activation'"
	. "\n AND block = 1"
	;
	$database->setQuery( $query );
	$result = $database->loadResult();

	if ($result) {
		$query = "UPDATE #__users"
		. "\n SET block = 0, activation = ''"
		. "\n WHERE activation = '$activation'"
		. "\n AND block = 1"
		;
		$database->setQuery( $query );
		if (!$database->query()) {
			echo "SQL error" . $database->stderr(true);
		}
		echo _REG_ACTIVATE_COMPLETE;
	} else {
		echo _REG_ACTIVATE_NOT_FOUND;
	}
}
Looking at the code I think he may be right as database->stderr() does not appear to end script execution.  Perhaps it should be:

Code: Select all

	$query = "SELECT id"
	. "\n FROM #__users"
	. "\n WHERE activation = '$activation'"
	. "\n AND block = 1"
	;
	$database->setQuery( $query );
	$result = $database->loadResult();

	if ($result) {
		$query = "UPDATE #__users"
		. "\n SET block = 0, activation = ''"
		. "\n WHERE activation = '$activation'"
		. "\n AND block = 1"
		;
		$database->setQuery( $query );
		if (!$database->query()) {
			echo "SQL error" . $database->stderr(true);
		} else {
  			echo _REG_ACTIVATE_COMPLETE;
		}
	} else {
		echo _REG_ACTIVATE_NOT_FOUND;
	}
}
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions

User avatar
Robin
Joomla! Master
Joomla! Master
Posts: 15753
Joined: Thu Aug 18, 2005 10:41 am

Re: Possible bug found in com_registration 1.0.10

Post by Robin » Wed Oct 18, 2006 7:33 pm

Q&T Note; Status > Under review. Code of 1.0.11 and latest SVN still looks the same.

User avatar
RobS
Joomla! Ace
Joomla! Ace
Posts: 1367
Joined: Mon Dec 05, 2005 10:17 am
Location: New Orleans, LA, USA
Contact:

Re: [LOW:TRACKER 6484:1.0.11] Bug found in com_registration 1.0.10

Post by RobS » Thu Oct 19, 2006 6:08 pm

Q&T Note; Status> Added to tracker.  Artifact 6484.  http://forge.joomla.org/sf/go/artf6484?nav=1
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions

User avatar
Robin
Joomla! Master
Joomla! Master
Posts: 15753
Joined: Thu Aug 18, 2005 10:41 am

Re: [LOW:TRACKER 6484:1.0.11] Bug found in com_registration 1.0.10

Post by Robin » Mon Dec 04, 2006 1:20 pm

Fixed for next release.


Locked

Return to “Q&T 1.0.x Resolved - Archived”