summaryrefslogtreecommitdiff
path: root/view.php
diff options
context:
space:
mode:
authorbitweaver.org <bitweaver@users.sourceforge.net>2006-02-23 15:12:56 +0000
committerbitweaver.org <bitweaver@users.sourceforge.net>2006-02-23 15:12:56 +0000
commit36d74c85ba75a07ace1d2e5bce8cb8e747dda471 (patch)
tree6209ed5d7e3f0eb32a9d521e9a388d8c24744dbf /view.php
parent415d238e6931dbfbec9ecebbcd7e6584e9bb12c1 (diff)
downloadpigeonholes-36d74c85ba75a07ace1d2e5bce8cb8e747dda471.tar.gz
pigeonholes-36d74c85ba75a07ace1d2e5bce8cb8e747dda471.tar.bz2
pigeonholes-36d74c85ba75a07ace1d2e5bce8cb8e747dda471.zip
redirect user to list page if we don't have a valid root_structure_id
Diffstat (limited to 'view.php')
-rw-r--r--view.php41
1 files changed, 6 insertions, 35 deletions
diff --git a/view.php b/view.php
index c07375f..e4ad517 100644
--- a/view.php
+++ b/view.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_pigeonholes/view.php,v 1.10 2006/02/08 21:51:14 squareing Exp $
+ * $Header: /cvsroot/bitweaver/_bit_pigeonholes/view.php,v 1.11 2006/02/23 15:12:56 bitweaver Exp $
*
* Copyright ( c ) 2004 bitweaver.org
* Copyright ( c ) 2003 tikwiki.org
@@ -8,7 +8,7 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: view.php,v 1.10 2006/02/08 21:51:14 squareing Exp $
+ * $Id: view.php,v 1.11 2006/02/23 15:12:56 bitweaver Exp $
* @package pigeonholes
* @subpackage functions
*/
@@ -27,6 +27,10 @@ $gBitSmarty->assign_by_ref( 'memberFeedback', $memberFeedback = array() );
// set up structure related stuff
global $gStructure;
+if( !@BitBase::verifyId( $gContent->mInfo['root_structure_id'] ) ) {
+ header( "Location:".PIGEONHOLES_PKG_URL."list.php" );
+}
+
$gStructure = new LibertyStructure( $gContent->mInfo['root_structure_id'] );
$gStructure->load();
@@ -47,39 +51,6 @@ if( empty( $gStructure ) || !$gStructure->isValid() ) {
$gBitSmarty->assign_by_ref( 'gStructure', $gStructure );
$gBitSmarty->assign( 'structureInfo', $gStructure->mInfo );
-/*
-$subtree = $gStructure->getSubTree( $gStructure->mStructureId );
-// get individual node preferences
-foreach( $subtree as $k => $node ) {
- $subtree[$k]['preferences'] = $gContent->loadPreferences( $node['content_id'] );
- if( !empty( $subtree[$k]['preferences']['permission'] ) ) {
- $subtree[$k]['permissions'][] = $subtree[$k]['preferences']['permission'];
- }
- if( !empty( $subtree[$k]['preferences']['group_id'] ) ) {
- $subtree[$k]['groups'][] = $subtree[$k]['preferences']['group_id'];
- }
-}
-
-// this is a bit of a crazy setup to pass permissions on to child nodes, but i'm not sure how else to do this.
-for( $i = 0; $i <= count( $subtree ); $i++ ) {
- foreach( $subtree as $key => $node ) {
- if( $node['level'] == $i ) {
- foreach( $subtree as $k => $n ) {
- if( $n['level'] == $i-1 ) {
- if( !empty( $n['preferences']['permission'] ) ) {
- $subtree[$key]['permissions'][] = $n['preferences']['permission'];
- }
- if( !empty( $n['preferences']['group_id'] ) ) {
- $subtree[$key]['groups'][] = $n['preferences']['group_id'];
- }
- }
- }
- }
- }
-}
-$gBitSmarty->assign( 'subtree', $subtree );
-*/
-
$gBitSmarty->assign( 'subtree', $gStructure->getSubTree( $gStructure->mStructureId ) );
$listHash = array(
'root_structure_id' => $gContent->mInfo['root_structure_id'],