phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpwebhosting index.php,1.30.2.5,1.30.2.6


From: Jason Wies <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpwebhosting index.php,1.30.2.5,1.30.2.6
Date: Sun, 23 Jun 2002 23:51:45 -0400

Update of /cvsroot/phpgroupware/phpwebhosting
In directory subversions:/tmp/cvs-serv17242/phpwebhosting

Modified Files:
      Tag: Version-0_9_14-branch
        index.php 
Log Message:
Savannah Patch #370 (modified) - Fix and extend ACL - Thanks gisu

Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpwebhosting/index.php,v
retrieving revision 1.30.2.5
retrieving revision 1.30.2.6
diff -C2 -r1.30.2.5 -r1.30.2.6
*** index.php   18 Jun 2002 05:16:08 -0000      1.30.2.5
--- index.php   24 Jun 2002 03:51:43 -0000      1.30.2.6
***************
*** 180,199 ****
  
  ###
! # Get their memberships to be used throughout the script
  ###
  
! $memberships = $GLOBALS['phpgw']->accounts->membership 
($GLOBALS['userinfo']['username']);
  
! if (!is_array ($memberships))
  {
!       $memberships = array ();
  }
  
! while (list ($num, $group_array) = each ($memberships))
  {
!       $membership_id = $GLOBALS['phpgw']->accounts->name2id 
($group_array['account_name']);
  
!       $group_applications = CreateObject('phpgwapi.applications', 
$membership_id);
!       $membership_applications[$group_array['account_name']] = 
$group_applications->read_account_specific ();
  }
  
--- 180,212 ----
  
  ###
! # Get their readable groups to be used throughout the script
  ###
  
! $groups = array ();
  
! $groups = $GLOBALS['phpgw']->accounts->get_list ('groups');
! 
! $readable_groups = array ();
! 
! while (list ($num, $account) = each ($groups))
  {
!       if ($GLOBALS['phpgw']->vfs->acl_check (array (
!                       'owner_id' => $account['account_id'],
!                       'operation' => PHPGW_ACL_READ
!               ))
!       )
!       {
!               $readable_groups[$account['account_lid']] = Array('account_id' 
=> $account['account_id'], 'account_name' => $account['account_lid']);
!       }
  }
  
! $groups_applications = array ();
! 
! while (list ($num, $group_array) = each ($readable_groups))
  {
!       $group_id = $GLOBALS['phpgw']->accounts->name2id 
($group_array['account_name']);
  
!       $applications = CreateObject('phpgwapi.applications', $group_id);
!       $groups_applications[$group_array['account_name']] = 
$applications->read_account_specific ();
  }
  
***************
*** 279,282 ****
--- 292,309 ----
  
  ###
+ # Check available permissions for $path, so we can disable unusable 
operations in user interface
+ ###
+ 
+ if ($GLOBALS['phpgw']->vfs->acl_check (array (
+         'string'        => $path,
+         'relatives' => array (RELATIVE_NONE),
+         'operation' => PHPGW_ACL_ADD
+         ))
+ )
+ {
+       $can_add = True;
+ }
+ 
+ ###
  # Default is to sort by name
  ###
***************
*** 326,331 ****
  //    $numoffiles = count($ls_array);
  
!       reset ($memberships);
!       while (list ($num, $group_array) = each ($memberships))
        {
                ###
--- 353,358 ----
  //    $numoffiles = count($ls_array);
  
!       reset ($readable_groups);
!       while (list ($num, $group_array) = each ($readable_groups))
        {
                ###
***************
*** 333,337 ****
                ###
  
!               if 
(!$membership_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled'])
                {
                        continue;
--- 360,364 ----
                ###
  
!               if 
(!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled'])
                {
                        continue;
***************
*** 1045,1049 ****
                        html_form_input ('submit', 'copy', lang('Copy to:'));
                        html_help_link ('copy_to');
- 
                        html_form_input ('submit', 'move', lang('Move to:'));
                        html_help_link ('move_to');
--- 1072,1075 ----
***************
*** 1076,1084 ****
  
                ###
!               # Then we get the directories in their membership's home 
directories
                ###
  
!               reset ($memberships);
!               while (list ($num, $group_array) = each ($memberships))
                {
                        ###
--- 1102,1110 ----
  
                ###
!               # Then we get the directories in their readable groups' home 
directories
                ###
  
!               reset ($readable_groups);
!               while (list ($num, $group_array) = each ($readable_groups))
                {
                        ###
***************
*** 1086,1090 ****
                        ###
  
!                       if 
(!$membership_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled'])
                        {
                                continue;
--- 1112,1116 ----
                        ###
  
!                       if 
(!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled'])
                        {
                                continue;
***************
*** 1149,1155 ****
                        html_nbsp (3);
  
!                       html_form_input ('text', 'createdir', NULL, 255, 15);
!                       html_form_input ('submit', 'newdir', lang('Create 
Folder'));
!                       html_help_link ('create_folder');
                }
  
--- 1175,1184 ----
                        html_nbsp (3);
  
!                       if ($can_add)
!                       {
!                               html_form_input ('text', 'createdir', NULL, 
255, 15);
!                               html_form_input ('submit', 'newdir', 
lang('Create Folder'));
!                               html_help_link ('create_folder');
!                       }
                }
  
***************
*** 1158,1162 ****
                html_help_link ('update');
  
!               if ($path != '/' && $path != $GLOBALS['fakebase'])
                {
                        html_nbsp (3);
--- 1187,1191 ----
                html_help_link ('update');
  
!               if ($path != '/' && $path != $GLOBALS['fakebase'] && $can_add)
                {
                        html_nbsp (3);
***************
*** 1211,1215 ****
                ###
  
!               if ($path != '/' && $path != $GLOBALS['fakebase'])
                {
                        html_break (2);
--- 1240,1244 ----
                ###
  
!               if ($path != '/' && $path != $GLOBALS['fakebase'] && $can_add)
                {
                        html_break (2);




reply via email to

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