phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: sitemgr/inc class.Categories_BO.inc.php,1.12,1.1


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/inc class.Categories_BO.inc.php,1.12,1.13 class.Categories_SO.inc.php,1.17,1.18class.Categories_UI.inc.php,1.9,1.10 class.Content_BO.inc.php,1.5,1.6 class.Content_SO.inc.php,1.9,1.10 class.Content_UI.inc.php,1.9,1.10 class.Pages_UI.inc.php,1.6,1.7
Date: Fri, 30 May 2003 23:53:53 -0400

Update of /cvsroot/phpgroupware/sitemgr/inc
In directory subversions:/tmp/cvs-serv1672/inc

Modified Files:
        class.Categories_BO.inc.php class.Categories_SO.inc.php 
        class.Categories_UI.inc.php class.Content_BO.inc.php 
        class.Content_SO.inc.php class.Content_UI.inc.php 
        class.Pages_UI.inc.php 
Log Message:
some debugging and improved ACL
renamed and augmented documentation


Index: class.Categories_BO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Categories_BO.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.Categories_BO.inc.php 30 May 2003 23:17:46 -0000      1.12
--- class.Categories_BO.inc.php 31 May 2003 03:53:51 -0000      1.13
***************
*** 103,107 ****
                                elseif ($check == 'active')
                                {
!                                       break;
                                }
                                if ($recurse)
--- 103,107 ----
                                elseif ($check == 'active')
                                {
!                                       continue;
                                }
                                if ($recurse)
***************
*** 192,195 ****
--- 192,197 ----
                                        if 
($this->so->saveCategoryLang($cat_id, $cat_name, $cat_description, $lang))
                                        {
+                                               //reflect changes
+                                               $this->setcurrentcats();
                                                return true;
                                        }
***************
*** 209,212 ****
--- 211,215 ----
                
                //$force is for bypassing ACL when we called from Sites_UI for 
building up the info for the currentsite
+               //and for getting at archived categories that are not listed in 
current nor readablecats
                function getCategory($cat_id,$lang=False,$force=False)
                {

Index: class.Categories_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Categories_SO.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** class.Categories_SO.inc.php 30 May 2003 04:01:42 -0000      1.17
--- class.Categories_SO.inc.php 31 May 2003 03:53:51 -0000      1.18
***************
*** 18,22 ****
                                $states = $GLOBALS['Common_BO']->visiblestates;
                        }
- 
                        $sql = "SELECT cat_id from 
phpgw_sitemgr_categories_state WHERE cat_id = $cat_id AND state IN (" . 
implode(',',$states) . ")";
  
--- 18,21 ----

Index: class.Categories_UI.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Categories_UI.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.Categories_UI.inc.php 30 May 2003 23:17:46 -0000      1.9
--- class.Categories_UI.inc.php 31 May 2003 03:53:51 -0000      1.10
***************
*** 88,92 ****
                        if ($cat_id)
                        {
!                               $cat = 
$this->cat_bo->getCategory($cat_id,$this->sitelanguages[0]); 
                        }
  
--- 88,93 ----
                        if ($cat_id)
                        {
!                               //we use force here since we might edit an 
archive category
!                               $cat = 
$this->cat_bo->getCategory($cat_id,$this->sitelanguages[0],True);
                        }
  

Index: class.Content_BO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Content_BO.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.Content_BO.inc.php    30 May 2003 23:17:46 -0000      1.5
--- class.Content_BO.inc.php    31 May 2003 03:53:51 -0000      1.6
***************
*** 125,137 ****
                //if (cat_id != $site_id and page_id is 0), site-wide blocks 
and all blocks for the category and all its ancestor categories are retrieved.
                //if page_id is non zero, cat_id should be the page's category. 
Page blocks + category blocks + site blocks are retrieved.
                function 
getvisibleblockdefsforarea($area,$cat_id,$page_id,$isadmin,$isuser)
                {
!                       $cat_ancestorlist = $cat_id ? 
!                               
implode(',',$GLOBALS['Common_BO']->cats->getCategoryancestorids($cat_id,True)) 
: 
                                False;
-                       if ($page_id && 
!in_array($cat_id,$GLOBALS['Common_BO']->acl->readablecats))
-                       {
-                          $page_id = False;
-                       }
                        return 
$this->so->getvisibleblockdefsforarea($area,$cat_ancestorlist,$page_id,$isadmin,$isuser);
                }
--- 125,134 ----
                //if (cat_id != $site_id and page_id is 0), site-wide blocks 
and all blocks for the category and all its ancestor categories are retrieved.
                //if page_id is non zero, cat_id should be the page's category. 
Page blocks + category blocks + site blocks are retrieved.
+               //there is no ACL, since these functions are called in a 
context where getcategory and getpage have been called before and would have 
intercepted a breach
                function 
getvisibleblockdefsforarea($area,$cat_id,$page_id,$isadmin,$isuser)
                {
!                       $cat_ancestorlist = ($cat_id != CURRENT_SITE_ID) ? 
!                               
$GLOBALS['Common_BO']->cats->getCategoryancestorids($cat_id,True) : 
                                False;
                        return 
$this->so->getvisibleblockdefsforarea($area,$cat_ancestorlist,$page_id,$isadmin,$isuser);
                }
***************
*** 139,147 ****
                function getallblocksforarea($area,$cat_id,$page_id,$lang)
                {
!                       $cat_ancestorlist = ($cat_id != CURRENT_SITE_ID) ? 
$GLOBALS['Common_BO']->cats->getCategoryancestorids($cat_id,True) : False;
!                       if ($page_id && 
!in_array($cat_id,$GLOBALS['Common_BO']->acl->readablecats))
!                       {
!                          $page_id = False;
!                       }
                        return 
$this->so->getallblocksforarea($area,$cat_ancestorlist,$page_id,$lang);
                }
--- 136,142 ----
                function getallblocksforarea($area,$cat_id,$page_id,$lang)
                {
!                       $cat_ancestorlist = ($cat_id != CURRENT_SITE_ID) ? 
!                               
$GLOBALS['Common_BO']->cats->getCategoryancestorids($cat_id,True) : 
!                               False;
                        return 
$this->so->getallblocksforarea($area,$cat_ancestorlist,$page_id,$lang);
                }

Index: class.Content_SO.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Content_SO.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.Content_SO.inc.php    30 May 2003 21:30:35 -0000      1.9
--- class.Content_SO.inc.php    31 May 2003 03:53:51 -0000      1.10
***************
*** 206,210 ****
                        if ($cat_list)
                        {
!                               $sql .= " OR (page_id = 0 AND cat_id IN (" . 
$cat_list . "))";
                        }
                        if ($page_id)
--- 206,210 ----
                        if ($cat_list)
                        {
!                               $sql .= " OR (page_id = 0 AND cat_id IN (" . 
implode(',',$cat_list) . "))";
                        }
                        if ($page_id)

Index: class.Content_UI.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Content_UI.inc.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** class.Content_UI.inc.php    30 May 2003 21:30:35 -0000      1.9
--- class.Content_UI.inc.php    31 May 2003 03:53:51 -0000      1.10
***************
*** 87,90 ****
--- 87,95 ----
                        {
                                $page = 
$GLOBALS['Common_BO']->pages->getPage($page_id);
+                               if 
(!$GLOBALS['Common_BO']->acl->can_write_category($page->cat_id))
+                               {
+                                       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Outline_UI.manage'));
+                                       return;
+                               }
                                $page_or_cat_name = $page->name;
                                $cat_id = $page->cat_id;
***************
*** 96,99 ****
--- 101,109 ----
                        {
                                $cat = 
$GLOBALS['Common_BO']->cats->getCategory($cat_id);
+                               if 
(!$GLOBALS['Common_BO']->acl->can_write_category($cat_id))
+                               {
+                                       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Outline_UI.manage'));
+                                       return;
+                               }
                                $page_or_cat_name = $cat->name;
                                $page_id = 0;
***************
*** 402,406 ****
                        while (list(,$cat_id) = @each($cats))
                        {
!                               $cat = 
$GLOBALS['Common_BO']->cats->getCategory($cat_id,$this->sitelanguages[0]);
                                $this->t->set_var(array(
                                        'category' => $cat->name,
--- 412,416 ----
                        while (list(,$cat_id) = @each($cats))
                        {
!                               $cat = 
$GLOBALS['Common_BO']->cats->getCategory($cat_id,$this->sitelanguages[0],True);
                                $this->t->set_var(array(
                                        'category' => $cat->name,

Index: class.Pages_UI.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/inc/class.Pages_UI.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** class.Pages_UI.inc.php      30 May 2003 21:30:35 -0000      1.6
--- class.Pages_UI.inc.php      31 May 2003 03:53:51 -0000      1.7
***************
*** 100,103 ****
--- 100,108 ----
                        {
                                $page = 
$this->pagebo->getPage($page_id,$this->sitelanguages[0]);
+                               if 
(!$GLOBALS['Common_BO']->acl->can_write_category($page->cat_id))
+                               {
+                                       
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=sitemgr.Outline_UI.manage'));
+                                       return;
+                               }
                                $this->t->set_var(array(
                                        'add_edit' => lang('Edit Page'),





reply via email to

[Prev in Thread] Current Thread [Next in Thread]