Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1513)
+++ branches/2.8.x/CHANGELOG	(revision 1514)
@@ -12,6 +12,9 @@
 
 =============================== FEATURES FREEZE ================================
 ----------------------------------- Fixes 2.8.2 --------------------------------
+04 Okt-2011 Build 1514 Dietmar Woellbrink (Luisehahne)
+# account/signup.php, check if user is already logged
+# fix non object message in framework/functions.php
 04 Okt-2011 Build 1513 Dietmar Woellbrink (Luisehahne)
 ! outputfilter now check and add missing slash in empty href if relative urls are enabled
 24 Sep-2011 Build 1512 Werner v.d.Decken(DarkViper)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1513)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1514)
@@ -52,4 +52,4 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.2');
-if(!defined('REVISION')) define('REVISION', '1513');
+if(!defined('REVISION')) define('REVISION', '1514');
Index: branches/2.8.x/wb/account/signup.php
===================================================================
--- branches/2.8.x/wb/account/signup.php	(revision 1513)
+++ branches/2.8.x/wb/account/signup.php	(revision 1514)
@@ -1,77 +1,78 @@
-<?php
-/**
- *
- * @category        frontend
- * @package         account
- * @author          WebsiteBaker Project
- * @copyright       2004-2009, Ryan Djurovich
- * @copyright       2009-2011, Website Baker Org. e.V.
- * @link			http://www.websitebaker2.org/
- * @license         http://www.gnu.org/licenses/gpl.html
- * @platform        WebsiteBaker 2.8.x
- * @requirements    PHP 5.2.2 and higher
- * @version         $Id$
- * @filesource		$HeadURL$
- * @lastmodified    $Date$
- *
- */
-
-require_once('../config.php');
-
-if(!is_numeric(FRONTEND_SIGNUP)) {
-	if(INTRO_PAGE) {
-		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
-		exit(0);
-	} else {
-		header('Location: '.WB_URL.'/index.php');
-		exit(0);
-	}
-}
-
-if(ENABLED_ASP && isset($_POST['username']) && ( // form faked? Check the honeypot-fields.
-	(!isset($_POST['submitted_when']) OR !isset($_SESSION['submitted_when'])) OR 
-	($_POST['submitted_when'] != $_SESSION['submitted_when']) OR
-	(!isset($_POST['email-address']) OR $_POST['email-address']) OR
-	(!isset($_POST['name']) OR $_POST['name']) OR
-	(!isset($_POST['full_name']) OR $_POST['full_name'])
-)) {
-	exit(header("Location: ".WB_URL.PAGES_DIRECTORY.""));
-}
-
-// Load the language file
-if(!file_exists(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php')) {
-	exit('Error loading language file '.DEFAULT_LANGUAGE.', please check configuration');
-} else {
-	require_once(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php');
-	$load_language = false;
-}
-
-require_once(WB_PATH.'/framework/class.frontend.php');
-$wb_inst = new wb();
-$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
-
-// Required page details
-// $page_id = 0;
-$page_description = '';
-$page_keywords = '';
-define('PAGE_ID', $page_id);
-define('ROOT_PARENT', 0);
-define('PARENT', 0);
-define('LEVEL', 0);
-define('PAGE_TITLE', $TEXT['SIGNUP']);
-define('MENU_TITLE', $TEXT['SIGNUP']);
-define('MODULE', '');
-define('VISIBILITY', 'public');
-
-// Set the page content include file
-if(isset($_POST['username'])) {
-	define('PAGE_CONTENT', WB_PATH.'/account/signup2.php');
-} else {
-	define('PAGE_CONTENT', WB_PATH.'/account/signup_form.php');
-}
-
-// Set auto authentication to false
-$auto_auth = false;
-
-// Include the index (wrapper) file
-require(WB_PATH.'/index.php');
+<?php
+/**
+ *
+ * @category        frontend
+ * @package         account
+ * @author          WebsiteBaker Project
+ * @copyright       2004-2009, Ryan Djurovich
+ * @copyright       2009-2011, Website Baker Org. e.V.
+ * @link			http://www.websitebaker2.org/
+ * @license         http://www.gnu.org/licenses/gpl.html
+ * @platform        WebsiteBaker 2.8.x
+ * @requirements    PHP 5.2.2 and higher
+ * @version         $Id$
+ * @filesource		$HeadURL$
+ * @lastmodified    $Date$
+ *
+ */
+
+require_once('../config.php');
+
+if(!( intval(FRONTEND_SIGNUP) && (  0 == (isset($_SESSION['USER_ID']) ? intval($_SESSION['USER_ID']) : 0) )))
+{
+	if(INTRO_PAGE) {
+		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index.php');
+		exit(0);
+	} else {
+		header('Location: '.WB_URL.'/index.php');
+		exit(0);
+	}
+}
+
+if(ENABLED_ASP && isset($_POST['username']) && ( // form faked? Check the honeypot-fields.
+	(!isset($_POST['submitted_when']) OR !isset($_SESSION['submitted_when'])) OR 
+	($_POST['submitted_when'] != $_SESSION['submitted_when']) OR
+	(!isset($_POST['email-address']) OR $_POST['email-address']) OR
+	(!isset($_POST['name']) OR $_POST['name']) OR
+	(!isset($_POST['full_name']) OR $_POST['full_name'])
+)) {
+	exit(header("Location: ".WB_URL.PAGES_DIRECTORY.""));
+}
+
+// Load the language file
+if(!file_exists(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php')) {
+	exit('Error loading language file '.DEFAULT_LANGUAGE.', please check configuration');
+} else {
+	require_once(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php');
+	$load_language = false;
+}
+
+require_once(WB_PATH.'/framework/class.frontend.php');
+$wb_inst = new wb();
+$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
+
+// Required page details
+// $page_id = 0;
+$page_description = '';
+$page_keywords = '';
+define('PAGE_ID', $page_id);
+define('ROOT_PARENT', 0);
+define('PARENT', 0);
+define('LEVEL', 0);
+define('PAGE_TITLE', $TEXT['SIGNUP']);
+define('MENU_TITLE', $TEXT['SIGNUP']);
+define('MODULE', '');
+define('VISIBILITY', 'public');
+
+// Set the page content include file
+if(isset($_POST['username'])) {
+	define('PAGE_CONTENT', WB_PATH.'/account/signup2.php');
+} else {
+	define('PAGE_CONTENT', WB_PATH.'/account/signup_form.php');
+}
+
+// Set auto authentication to false
+$auto_auth = false;
+
+// Include the index (wrapper) file
+require(WB_PATH.'/index.php');
Index: branches/2.8.x/wb/framework/functions.php
===================================================================
--- branches/2.8.x/wb/framework/functions.php	(revision 1513)
+++ branches/2.8.x/wb/framework/functions.php	(revision 1514)
@@ -539,18 +539,16 @@
 }
 
 // Function to get all sub pages id's
-function get_subs($parent, $subs)
+function get_subs($parent, array $subs )
 {
 	// Connect to the database
 	global $database;
 	// Get id's
 	$sql = 'SELECT `page_id` FROM `'.TABLE_PREFIX.'pages` WHERE `parent` = '.$parent;
-	$query = $database->query($sql);
-	if($query->numRows() > 0)
-	{
+	if( ($query = $database->query($sql)) ) {
 		while($fetch = $query->fetchRow()) {
 			$subs[] = $fetch['page_id'];
-			// Get subs of this sub
+			// Get subs of this sub recursive
 			$subs = get_subs($fetch['page_id'], $subs);
 		}
 	}
