Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1752)
+++ branches/2.8.x/CHANGELOG	(revision 1753)
@@ -13,6 +13,12 @@
 
 
 
+15 Sep-2012 Build 1753 Dietmar Woellbrink (Luisehahne)
+! remove summary="" in captcha tables frontend
+! fixed calendar time, now all Calendar in WB shows right user TIMEZONE
+  please check module for saving timestamp minus TIMEZONE
+# recoded sections in admin/pages/, now save all fields
+  there was a problem, if blocks and menus are disabled
 14 Sep-2012 Build 1752 Dietmar Woellbrink (Luisehahne)
 ! forgot to upload CHANGELOG and version.php
 14 Sep-2012 Build 1751 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/include/captcha/captcha.php
===================================================================
--- branches/2.8.x/wb/include/captcha/captcha.php	(revision 1752)
+++ branches/2.8.x/wb/include/captcha/captcha.php	(revision 1753)
@@ -1,28 +1,21 @@
 <?php
+/**
+ *
+ * @category        captcha
+ * @package         include
+ * @subpackage
+ * @author          Ryan Djurovich,WebsiteBaker Project
+ * @copyright       2009-2012, WebsiteBaker 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$
+ *
+ */
 
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, Ryan Djurovich
-
- Website Baker is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- Website Baker is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
 // displays the image or text inside an <iframe>
 if(!function_exists('display_captcha_real')) {
 	function display_captcha_real($kind='image') {
@@ -142,7 +135,7 @@
 		if($action=='all') {
 			switch(CAPTCHA_TYPE) {
 				case 'text': // text-captcha
-					?><table class="captcha_table" summary="captcha control"><tr>
+					?><table class="captcha_table"><tr>
 					<td class="text_captcha">
 						<?php include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php'); ?>
 					</td>
@@ -152,7 +145,7 @@
 					</tr></table><?php
 					break;
 				case 'calc_text': // calculation as text
-					?><table class="captcha_table" summary="captcha control"><tr>
+					?><table class="captcha_table"><tr>
 					<td class="text_captcha">
 						<?php include(WB_PATH.'/include/captcha/captchas/'.CAPTCHA_TYPE.'.php'); ?>
 					</td>
@@ -163,7 +156,7 @@
 					break;
 				case 'calc_image': // calculation with image (old captcha)
 				case 'calc_ttf_image': // calculation with varying background and ttf-font
-				  ?><table class="captcha_table" summary="captcha control"><tr>
+				  ?><table class="captcha_table"><tr>
 					<td class="image_captcha">
 						<?php echo "<iframe class=\"captcha_iframe\" width=\"$captcha_width\" height=\"$captcha_height\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" name=\"captcha_iframe_$sec_id\" src=\"". WB_URL ."/include/captcha/captcha.php?display_captcha_X986E21=1&amp;s=$sec_id"; ?>">
 						<img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t&amp;s=$sec_id"; ?>" alt="Captcha" />
@@ -177,7 +170,7 @@
 				// normal images
 				case 'ttf_image': // captcha with varying background and ttf-font
 				case 'old_image': // old captcha
-					?><table class="captcha_table" summary="captcha control"><tr>
+					?><table class="captcha_table"><tr>
 					<td class="image_captcha">
 						<?php echo "<iframe class=\"captcha_iframe\" width=\"$captcha_width\" height=\"$captcha_height\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" name=\"captcha_iframe_$sec_id\" src=\"". WB_URL ."/include/captcha/captcha.php?display_captcha_X986E21=1&amp;s=$sec_id"; ?>">
 						<img src="<?php echo WB_URL.'/include/captcha/captchas/'.CAPTCHA_TYPE.".php?t=$t&amp;s=$sec_id"; ?>" alt="Captcha" />

Property changes on: branches/2.8.x/wb/include/captcha/captcha.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1 ##
-Id
\ No newline at end of property
+Date Author Id Revision HeadURL
\ No newline at end of property
Index: branches/2.8.x/wb/include/jscalendar/wb-setup.php
===================================================================
--- branches/2.8.x/wb/include/jscalendar/wb-setup.php	(revision 1752)
+++ branches/2.8.x/wb/include/jscalendar/wb-setup.php	(revision 1753)
@@ -38,7 +38,7 @@
 // require_once(WB_PATH.'/include/jscalendar/calendar-system.css');
 ?>
 <!--</style>  -->
-<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar.js"></script>
+<script src="<?php echo WB_URL ?>/include/jscalendar/calendar.js" type="text/javascript"></script>
 <?php // some stuff for jscalendar
 	// language
 	$jscal_lang = defined('LANGUAGE')?strtolower(LANGUAGE):'en';
@@ -47,7 +47,7 @@
 		$jscal_lang = 'en';
 	}
 	// today
-	$jscal_today = gmdate('Y/m/d H:i');
+	$jscal_today = gmdate('Y/m/d H:i', time()+TIMEZONE);
 	// first-day-of-week
 	$jscal_firstday = '1'; // monday
 	if(LANGUAGE=='EN')
@@ -77,7 +77,7 @@
 			$jscal_ifformat = '%Y-%m-%d';
 			break;
 	}
-	if(isset($jscal_use_time) && $jscal_use_time==TRUE) {
+	if(isset($jscal_use_time) && $jscal_use_time==true) {
 		$jscal_format .= ' H:i';
 		$jscal_ifformat .= ' %H:%M';
 	}
@@ -84,5 +84,5 @@
 
 	// load scripts for jscalendar
 ?>
-<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/lang/calendar-<?php echo $jscal_lang ?>.js"></script>
-<script type="text/javascript" src="<?php echo WB_URL ?>/include/jscalendar/calendar-setup.js"></script>
+<script src="<?php echo WB_URL ?>/include/jscalendar/lang/calendar-<?php echo $jscal_lang ?>.js" type="text/javascript"></script>
+<script src="<?php echo WB_URL ?>/include/jscalendar/calendar-setup.js" type="text/javascript"></script>

Property changes on: branches/2.8.x/wb/include/jscalendar/wb-setup.php
___________________________________________________________________
Modified: svn:keywords
## -1 +1 ##
-Id
\ No newline at end of property
+Date Author Id Revision HeadURL
\ No newline at end of property
Index: branches/2.8.x/wb/admin/pages/sections_save.php
===================================================================
--- branches/2.8.x/wb/admin/pages/sections_save.php	(revision 1752)
+++ branches/2.8.x/wb/admin/pages/sections_save.php	(revision 1753)
@@ -1,11 +1,12 @@
 <?php
 /**
  *
- * @category        admin
- * @package         pages
- * @author          WebsiteBaker Project
+ * @category        backend
+ * @package         admin
+ * @subpackage      pages
+ * @author          Ryan Djurovich, WebsiteBaker Project
  * @copyright       2004-2009, Ryan Djurovich
- * @copyright       2009-2011, Website Baker Org. e.V.
+ * @copyright       2009-2012, Website Baker Org. e.V.
  * @link			http://www.websitebaker2.org/
  * @license         http://www.gnu.org/licenses/gpl.html
  * @platform        WebsiteBaker 2.8.x
@@ -19,12 +20,6 @@
 // Include config file
 require('../../config.php');
 
-// Make sure people are allowed to access this page
-if(MANAGE_SECTIONS != 'enabled') {
-	header('Location: '.ADMIN_URL.'/pages/index.php');
-	exit(0);
-}
-
 require_once(WB_PATH."/include/jscalendar/jscalendar-functions.php");
 /**/
 // Create new admin object
@@ -32,9 +27,15 @@
 // suppress to print the header, so no new FTAN will be set
 $admin = new admin('Pages', 'pages_modify',false);
 
+// Make sure people are allowed to access this page
+if(MANAGE_SECTIONS == false) {
+	$admin->send_header('Location: '.ADMIN_URL.'/pages/index.php');
+	exit(0);
+}
+
 // Get page id
 if(!isset($_GET['page_id']) || !is_numeric($_GET['page_id'])) {
-	header("Location: index.php");
+	$admin->send_header("Location: index.php");
 	exit(0);
 } else {
 	$page_id = (int)$_GET['page_id'];
@@ -45,8 +46,6 @@
 	$admin->print_header();
 	$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'],ADMIN_URL.'/pages/sections.php?page_id='.$page_id);
 }
-// After check print the header
-$admin->print_header();
 /*
 if( (!($page_id = $admin->checkIDKEY('page_id', 0, $_SERVER['REQUEST_METHOD']))) )
 {
@@ -54,13 +53,35 @@
 	exit();
 }
 */
+
+// After check print the header
+$admin->print_header();
+
+$sBackLink = ADMIN_URL.'/pages/sections.php?page_id='.$page_id;
+
 // Get perms
-// $database = new database();
-$results = $database->query("SELECT admin_groups,admin_users FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'");
-$results_array = $results->fetchRow();
+// Get page details
+$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'pages` ';
+$sql .= 'WHERE page_id = '.$page_id.'';
+
+if($oPage = $database->query($sql)){
+    $results_array = $oPage->fetchRow();
+} else {
+	$admin->print_error($database->get_error());
+    $aMsg = array();
+    $aMsg[] = $MESSAGE['GENERIC_NOT_UPGRADED'];
+    if($results->numRows() == 0) {
+    	$aMsg[] = $MESSAGE['PAGES_NOT_FOUND'];
+    }
+    if($database->is_error()) {
+    	$aMsg[] = $database->get_error();
+    }
+	$admin->print_error(implode('<br />',$aMsg), $sBackLink );
+}
+
+$old_admin_users  = explode(',', $results_array['admin_users']);
 $old_admin_groups = explode(',', $results_array['admin_groups']);
-$old_admin_users = explode(',', $results_array['admin_users']);
-$in_old_group = FALSE;
+$in_old_group = false;
 foreach($admin->get_groups_id() as $cur_gid){
     if (in_array($cur_gid, $old_admin_groups)) {
         $in_old_group = TRUE;
@@ -67,69 +88,65 @@
     }
 }
 if((!$in_old_group) && !is_numeric(array_search($admin->get_user_id(), $old_admin_users))) {
-	$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
+	$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
 }
 
-// Get page details
-// $database = new database();
-$query = "SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'";
-$results = $database->query($query);
-if($database->is_error()) {
-	$admin->print_header();
-	$admin->print_error($database->get_error());
-}
-if($results->numRows() == 0) {
-	$admin->print_header();
-	$admin->print_error($MESSAGE['PAGES']['NOT_FOUND']);
-}
-$results_array = $results->fetchRow();
-
 // Set module permissions
 $module_permissions = $_SESSION['MODULE_PERMISSIONS'];
+$aMsg = array();
+$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'sections` ';
+$sql .= 'WHERE page_id = '.$page_id.' ';
+$sql .= 'ORDER BY position ASC';
 
-// Loop through sections
-$query_sections = $database->query("SELECT section_id,module,position FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' ORDER BY position ASC");
-if($query_sections->numRows() > 0) {
-	$num_sections = $query_sections->numRows();
-	while($section = $query_sections->fetchRow()) {
-		if(!is_numeric(array_search($section['module'], $module_permissions))) {
-			// Update the section record with properties
-			$section_id = $section['section_id'];
-			$sql = ''; $publ_start = 0; $publ_end = 0;
-			$dst = date("I")?" DST":""; // daylight saving time?
-			if(isset($_POST['block'.$section_id]) && $_POST['block'.$section_id] != '') {
-				$sql = "block = '".$admin->add_slashes($_POST['block'.$section_id])."'";
-			}
-			// update publ_start and publ_end, trying to make use of the strtotime()-features like "next week", "+1 month", ...
-			if(isset($_POST['start_date'.$section_id]) && isset($_POST['end_date'.$section_id])) {
-				if(trim($_POST['start_date'.$section_id]) == '0' || trim($_POST['start_date'.$section_id]) == '') {
-					$publ_start = 0;
-				} else {
-					$publ_start = jscalendar_to_timestamp($_POST['start_date'.$section_id]);
-				}
-				if(trim($_POST['end_date'.$section_id]) == '0' || trim($_POST['end_date'.$section_id]) == '') {
-					$publ_end = 0;
-				} else {
-					$publ_end = jscalendar_to_timestamp($_POST['end_date'.$section_id], $publ_start);
-				}
-				if($sql != '')
-					$sql .= ",";
-				$sql .= " publ_start = '".$admin->add_slashes($publ_start)."'";
-				$sql .= ", publ_end = '".$admin->add_slashes($publ_end)."'";
-			}
-			$query = "UPDATE ".TABLE_PREFIX."sections SET $sql WHERE section_id = '$section_id' LIMIT 1";
-			if($sql != '') {
-				$database->query($query);
-			}
-		}
-	}
+if(!($oSection = $database->query($sql))) {
+    $aMsg = array();
+    $aMsg[] = $MESSAGE['GENERIC_NOT_UPGRADED'];
+    if($database->is_error()) {
+    	$aMsg[] = $database->get_error();
+    }
+	$admin->print_error(implode('<br />',$aMsg), $sBackLink );
 }
-// Check for error or print success message
-if($database->is_error()) {
-	$admin->print_error($database->get_error(), ADMIN_URL.'/pages/sections.php?page_id='.$page_id );
-} else {
-	$admin->print_success($MESSAGE['PAGES']['SECTIONS_PROPERTIES_SAVED'], ADMIN_URL.'/pages/sections.php?page_id='.$page_id );
+
+$aSqlSection = array();
+// Loop through sections and set sql values for update
+while($section = $oSection->fetchRow(MYSQL_ASSOC)) {
+
+    $section_id  = $section['section_id'];
+    $sid = 'wb'.$section_id;
+
+    $dst = date('I') ? ' UTC' : ''; // daylight saving time? date('P')
+
+    $iBlock      = $admin->get_post_escaped('block'.$section_id);
+    $iBlock      = ($iBlock==null) ? $section['block'] : $iBlock;
+
+    $sStartDate  = $admin->get_post_escaped('start_date'.$section_id);;
+    $sStartDate  = ($sStartDate==null)||($sStartDate=='') ? 0 : jscalendar_to_timestamp($sStartDate)-TIMEZONE;
+
+    $sEndDate   = $admin->get_post_escaped('end_date'.$section_id);
+    $sEndDate   = ($sEndDate==null)||($sEndDate=='') ? 0 : jscalendar_to_timestamp($sEndDate)-TIMEZONE;
+
+    $aSqlSection[$sid][]  = 'UPDATE `'.TABLE_PREFIX.'sections` SET ';
+    $aSqlSection[$sid][] .= '`block`= \''.$iBlock.'\', ';
+    $aSqlSection[$sid][] .= '`module` = \''.$section['module'].'\', ';
+    $aSqlSection[$sid][] .= '`publ_start` = \''.$sStartDate.'\',';
+    $aSqlSection[$sid][] .= '`publ_end` = \''.$sEndDate.'\' ';
+    $aSqlSection[$sid][] .= 'WHERE `section_id` = \''.$section_id.'\' ';
 }
 
+foreach( $aSqlSection as $sid ) {
+
+    $sql = implode('',$sid);
+    if(!($oSection = $database->query($sql))) {
+        $aMsg = array();
+        $aMsg[] = $MESSAGE['GENERIC_NOT_UPGRADED'];
+        if($database->is_error()) {
+            $aMsg[] = $database->get_error();
+        }
+    $admin->print_error(implode('<br />',$aMsg), $sBackLink );
+    }
+}
+
+$admin->print_success($MESSAGE['PAGES_SECTIONS_PROPERTIES_SAVED'], $sBackLink );
+
 // Print admin footer
 $admin->print_footer();
Index: branches/2.8.x/wb/admin/pages/sections.php
===================================================================
--- branches/2.8.x/wb/admin/pages/sections.php	(revision 1752)
+++ branches/2.8.x/wb/admin/pages/sections.php	(revision 1753)
@@ -31,7 +31,7 @@
 require_once(WB_PATH.'/framework/functions.php');
 // Create new admin object
 require_once(WB_PATH.'/framework/class.admin.php');
-$admin = new admin('Pages', 'pages_modify', false);
+$admin = new admin('Pages', 'pages_view', false);
 
 $action = 'show';
 // Get page id
@@ -51,6 +51,11 @@
 
 switch ($action):
 	case 'delete' :
+        if($admin->get_permission('pages_delete') == false)
+        {
+			$admin->print_header();
+			$admin->print_error($module.' '.strtolower($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']),$backlink);
+        }
 
 		if( ( !($section_id = intval($admin->checkIDKEY('section_id', 0, $_SERVER['REQUEST_METHOD'])) )) )
 		{
@@ -90,7 +95,11 @@
 
 		break;
 	case 'add' :
-
+        if($admin->get_permission('pages_add') == false)
+        {
+			$admin->print_header();
+			$admin->print_error($module.' '.strtolower($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']),$backlink);
+        }
 		if (!$admin->checkFTAN())
 		{
 			$admin->print_header();
@@ -107,7 +116,10 @@
 	    $sql .= '`page_id` = '.(int)$page_id.', ';
 	    $sql .= '`module` = \''.$module.'\', ';
 	    $sql .= '`position` = '.(int)$position.', ';
-	    $sql .= '`block` = 1';
+	    $sql .= '`block` = \'1\', ';
+        $sql .= '`publ_start` = \'0\',';
+        $sql .= '`publ_end` = \'0\' ';
+
         if($database->query($sql)) {
 			// Get the section id
 			$section_id = $database->get_one("SELECT LAST_INSERT_ID()");
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1752)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1753)
@@ -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', '1752');
+if(!defined('REVISION')) define('REVISION', '1753');
 if(!defined('SP')) define('SP', '');
