Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1795)
+++ branches/2.8.x/CHANGELOG	(revision 1796)
@@ -13,6 +13,8 @@
 
 
 
+24 Oct-2012 Build 1796 Dietmar Woellbrink (Luisehahne)
+! supress frontend preferences, if user have no permission for it
 24 Oct-2012 Build 1795 Dietmar Woellbrink (Luisehahne)
 ! change setting of the $_SESSION['SYSTEM_PERMISSIONS']
   from get_user_id to ami_group_member, sp that all Users
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1795)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1796)
@@ -51,5 +51,5 @@
 
 // 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.3');
-if(!defined('REVISION')) define('REVISION', '1795');
+if(!defined('REVISION')) define('REVISION', '1796');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/account/preferences.php
===================================================================
--- branches/2.8.x/wb/account/preferences.php	(revision 1795)
+++ branches/2.8.x/wb/account/preferences.php	(revision 1796)
@@ -27,6 +27,7 @@
 require_once(WB_PATH.'/framework/functions.php');
 
 $wb = new frontend(false);
+$permission = new admin('##skip##');
 
 if(!FRONTEND_LOGIN) {
 	$wb->send_header('Location: '.WB_URL.'/');
@@ -37,6 +38,12 @@
 	$wb->send_header('Location: '.WB_URL.'/account/login.php');
 	exit(0);
 }
+
+if ($permission->get_permission('preferences')==false) {
+	$wb->send_header('Location: '.WB_URL.'/');
+	exit(0);
+}
+
 $page_id = defined('REFERRER_ID') ? REFERRER_ID : isset($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
 
 // Required page details
Index: branches/2.8.x/wb/framework/class.wb.php
===================================================================
--- branches/2.8.x/wb/framework/class.wb.php	(revision 1795)
+++ branches/2.8.x/wb/framework/class.wb.php	(revision 1796)
@@ -45,7 +45,7 @@
  */
 	public function GetLanguagesDetailsInUsed ( ) {
         global $database;
-        $retVal = array();
+        $aRetval = array();
         $sql =
             'SELECT DISTINCT `language`'.
             ', `page_id`,`level`,`parent`,`root_parent`,`page_code`,`link`,`language`'.
@@ -63,10 +63,10 @@
                 while($page = $oRes->fetchRow(MYSQL_ASSOC))
                 {
                     if(!$this->page_is_visible($page)) {continue;}
-                    $retVal[$page['language']] = $page;
+                    $aRetval[$page['language']] = $page;
                 }
             }
-        return $retVal;
+        return $aRetval;
 	}
 
 /**
@@ -76,33 +76,10 @@
  *
  */
 	public function GetLanguagesInUsed ( ) {
-		global $database;
-        $retVal = '';
-        $page = array();
-        $sql =
-            'SELECT DISTINCT `language`'.
-            ', `page_id`,`level`,`parent`,`root_parent`,`page_code`,`link`,`language`'.
-            ', `visibility`,`viewing_groups`,`viewing_users`,`position` '.
-            'FROM `'.TABLE_PREFIX.'pages` '.
-            'WHERE `level`= \'0\' '.
-              'AND `root_parent`=`page_id` '.
-              'AND `visibility`!=\'none\' '.
-              'AND `visibility`!=\'hidden\' '.
-            'GROUP BY `language` '.
-            'ORDER BY `position`';
+        return implode(',', array_keys($this->GetLanguagesDetailsInUsed()));
+  	}
 
-            if($oRes = $database->query($sql))
-            {
-                while($page = $oRes->fetchRow(MYSQL_ASSOC))
-                {
-                    if(!$this->page_is_visible($page)) {continue;}
-                    $retVal .= $page['language'].',';
-                }
-            }
-            return trim($retVal,',');
-	}
 
-
 /* ****************
  * check if one or more group_ids are in both group_lists
  *
Index: branches/2.8.x/wb/framework/class.frontend.php
===================================================================
--- branches/2.8.x/wb/framework/class.frontend.php	(revision 1795)
+++ branches/2.8.x/wb/framework/class.frontend.php	(revision 1796)
@@ -24,6 +24,7 @@
 //require_once(WB_PATH.'/framework/class.wb.php');
 //require_once(WB_PATH.'/framework/SecureForm.php');
 if(!class_exists('wb', false)){ require(WB_PATH.'/framework/class.wb.php'); }
+if(!class_exists('admin', false)){ require(WB_PATH.'/framework/class.admin.php'); }
 
 class frontend extends wb {
 	// defaults
