Changeset 1648


Ignore:
Timestamp:
11/13/09 17:16:13 (14 years ago)
Author:
amuller
Message:

Ticket #597 - melhoria no modulo gerenciador de arquivos

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • sandbox/filemanager/inc/class.uifilemanager.inc.php

    r1627 r1648  
    6868                var $copy_to_x; 
    6969                var $edit_x; 
    70                 var $edit_comments_x; 
    7170                var $edit_file; 
    7271                var $edit_preview_x; 
     
    134133                                'file'  => array('file' => ''), 
    135134                                'sortby'        => array('sortby' => ''), 
    136                                 //                              'fileman'       => array('fileman' => ''), 
    137135                                'messages'      => array('messages'     => ''), 
    138                                 //                              'help_name'     => array('help_name' => ''), 
    139                                 //                              'renamefiles'   => array('renamefiles' => ''), 
    140136                                'comment_files' => array('comment_files' => ''), 
    141137                                'show_upload_boxes'     => array('show_upload_boxes' => '') 
     
    230226                        } 
    231227 
    232 //                      die($this->bo->homedir); 
    233228                        $test=$this->bo->vfs->get_real_info(array('string' => $this->bo->basedir.$this->bo->homedir, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    234229                        if($test[mime_type]!='Directory') 
     
    344339                function index() 
    345340                { 
    346                         if($noheader || $nofooter || (count($this->fileman) > 0)) 
    347                         { 
    348                                 $noheader = True; 
    349                                 $nofooter = True; 
    350                                 $noappheader= True; 
    351                                 $nonavbar= True; 
    352                         } 
    353                         else 
    354                         { 
    355                                 $GLOBALS['phpgw_info']['flags'] = array 
    356                                 ( 
    357                                         'currentapp'    => 'filemanager', 
    358                                         'noheader'      => $noheader, 
    359                                         'nonavbar' => $nonavbar, 
    360                                         'nofooter'      => $nofooter, 
    361                                         'noappheader'   => $noappheader, 
    362                                         'enable_browser_class'  => True 
    363                                 ); 
    364  
    365                                 $GLOBALS['phpgw']->common->phpgw_header(); 
    366  
    367                         } 
     341                        $GLOBALS['phpgw_info']['flags'] = array 
     342                        ( 
     343                                'currentapp'    => 'filemanager', 
     344                                'noheader'      => False, 
     345                                'nonavbar' => False, 
     346                                'nofooter'      => False, 
     347                                'noappheader'   => False, 
     348                                'enable_browser_class'  => True 
     349                        ); 
     350 
     351                        $GLOBALS['phpgw']->common->phpgw_header(); 
    368352 
    369353                        echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/js/global.js'></script>"; 
     
    380364                        # Some hacks to set and display directory paths correctly 
    381365                        ### 
    382                         if(!($this->edit_x || $this->edit_save_x || $this->edit_save_done_x) && !$this->bo->vfs->acl_check(array( 
    383                                 'string' => $this->path, 
    384                                 'relatives' => array(RELATIVE_NONE), 
    385                                 'operation' => PHPGW_ACL_READ 
    386                         ))) 
    387                         { 
    388                                 $this->path = $this->bo->homedir;        
    389                         } 
    390366                        // new method for switching to a new dir. 
    391367                        if($this->changedir=='true' && $this->cdtodir || $this->goto_x) 
     
    452428                        while(list($num, $account) = each($groups)) 
    453429                        { 
    454 //                              if($this->bo->vfs->acl_check(array('owner_id' => $account['account_id'],'operation' => PHPGW_ACL_READ))) 
     430                                if($this->bo->vfs->acl_check(array('owner_id' => $account['account_id'],'operation' => PHPGW_ACL_READ))) 
    455431                                { 
    456432                                        $this->readable_groups[$account['account_lid']] = Array('account_id' => $account['account_id'], 'account_name' => $account['account_lid']); 
    457433                                } 
    458434                        } 
    459  
    460435 
    461436                        $this->groups_applications = array(); 
     
    480455                        } 
    481456 
    482                         # FIXME # comment waht happens here 
    483                         if($this->path != $this->bo->homedir && $this->path != $this->bo->fakebase && $this->path != '/' && !$this->bo->vfs->acl_check(array('string' => $this->path, 'relatives' => array(RELATIVE_NONE),'operation' => PHPGW_ACL_READ))) 
    484                         { 
    485                                 $this->messages[]= lang('Error:').lang('You do not have access to %1', $this->path); 
     457                        # Check available permissions for $this->path, so we can disable unusable operations in user interface 
     458                        $path = explode('/',$this->path); 
     459                        $owner_id = $this->bo->vfs->ownerOf($this->bo->fakebase,$path[2]); 
     460                        $user_id = $GLOBALS['phpgw_info']['user']['account_id']; 
     461                        if ($owner_id == $user_id) 
     462                        { 
     463                                $this->can_read = True; 
     464                                $this->can_add = True; 
     465                                $this->can_edit = True; 
     466                                $this->can_delete = True; 
     467                                $this->can_private = True; 
     468                        }else 
     469                        { 
     470                                $acl = CreateObject ('phpgwapi.acl', $owner_id); 
     471                                $acl->account_id = $owner_id; 
     472                                $acl->read_repository(); 
     473                                $rights = $acl->get_rights($user_id); 
     474                                $this->can_read = $rights & PHPGW_ACL_READ; 
     475                                $this->can_add = $rights & PHPGW_ACL_ADD; 
     476                                $this->can_edit = $rights & PHPGW_ACL_EDIT; 
     477                                $this->can_delete = $rights & PHPGW_ACL_DELETE; 
     478                                $this->can_private = $rights & PHPGW_ACL_PRIVATE; 
     479                        } 
     480         
     481                        # if is different path than home and no permission allowed 
     482                        if($this->path != $this->bo->homedir && $this->path != $this->bo->fakebase && $this->path != '/' && !$this->can_read) 
     483                        { 
     484                                echo lang('You do not have access to %1', $this->path); 
    486485                                $this->html_link('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->homedir, lang('Go to your home directory')); 
    487486 
     
    492491                        $this->bo->userinfo['working_id'] = $this->bo->vfs->working_id; 
    493492                        $this->bo->userinfo['working_lid'] = $GLOBALS['phpgw']->accounts->id2name($this->bo->userinfo['working_id']); 
    494  
    495                         # If their home directory doesn't exist, we try to create it 
    496                         # Same for group directories 
    497  
    498                          
    499                 // Moved to constructor 
    500                 /* 
    501                         if(($this->path == $this->homedir)      && !$this->bo->vfs->file_exists($pim_tmp_arr)) 
    502                         { 
    503                                 $this->bo->vfs->override_acl = 1; 
    504  
    505                                 if(!$this->bo->vfs->mkdir(array( 
    506                                         'string' => $this->bo->homedir, 
    507                                         'relatives' => array(RELATIVE_NONE) 
    508                                 ))) 
    509                                 { 
    510                                         $p = $this->bo->vfs->path_parts($pim_tmp_arr); 
    511  
    512                                         $this->messages[]= $GLOBALS['phpgw']->common->error_list(array( 
    513                                                 lang('Could not create directory %1', 
    514                                                 $this->bo->homedir . ' (' . $p->real_full_path . ')' 
    515                                         ))); 
    516                                 } 
    517  
    518                                 $this->bo->vfs->override_acl = 0; 
    519                         } 
    520                         */ 
    521493 
    522494                        # Verify path is real 
     
    538510 
    539511                        /* Update the vfs */ 
    540                         if ($_GET['update'] == 'True')  
     512                        if ($this->update_x == 'True')  
    541513                        { 
    542514                                $this->bo->vfs->update_real(array( 
     
    546518                        } 
    547519 
    548                         # Check available permissions for $this->path, so we can disable unusable operations in user interface 
    549                         if($this->bo->vfs->acl_check(array( 
    550                                 'string' => $this->path, 
    551                                 'relatives' => array(RELATIVE_NONE), 
    552                                 'operation' => PHPGW_ACL_ADD 
    553                         ))) 
    554                         { 
    555                                 $this->can_add = True; 
    556                         } 
    557                         if($this->bo->vfs->acl_check(array( 
    558                                 'string' => $this->path, 
    559                                 'relatives' => array(RELATIVE_NONE), 
    560                                 'operation' => PHPGW_ACL_EDIT 
    561                         ))) 
    562                         { 
    563                                 $this->can_edit = True; 
    564                         } 
    565                         if($this->bo->vfs->acl_check(array( 
    566                                 'string' => $this->path, 
    567                                 'relatives' => array(RELATIVE_NONE), 
    568                                 'operation' => PHPGW_ACL_DELETE 
    569                         ))) 
    570                         { 
    571                                 $this->can_delete = True; 
    572                         } 
    573  
    574  
    575520                        # Default is to sort by name 
    576521                        if(!$this->sortby) 
     
    613558                        { 
    614559                                $this->rename(); 
    615                         } 
    616                         elseif($this->comment_files) 
    617                         { 
    618                                 $this->editComment(); 
    619560                        } 
    620561                        elseif($this->edit_cancel_x) 
     
    752693                                        $files = $this->files_array[$i]; 
    753694 
    754                                         if($this->rename_x || $this->edit_comments_x) 
     695                                        if($this->rename_x) 
    755696                                        { 
    756697                                                unset($this_selected); 
    757698                                                unset($renamethis); 
    758                                                 unset($edit_this_comment); 
    759699 
    760700                                                for($j = 0; $j != $this->numoffiles; $j++) 
     
    771711                                                        $renamethis = 1; 
    772712                                                } 
    773                                                 elseif($this->edit_comments_x && $this_selected) 
    774                                                 { 
    775                                                         $edit_this_comment = 1; 
    776                                                 } 
    777713                                        } 
    778714 
     
    783719 
    784720                                        # Checkboxes 
    785                                         if(!$this->rename_x && !$this->edit_comments_x && $this->path != $this->bo->fakebase && $this->path != '/') 
     721                                        if(!$this->rename_x && $this->path != $this->bo->fakebase && $this->path != '/') 
    786722                                        { 
    787723                                                $cbox='<input type="checkbox" class="checkbox" name="fileman['.$i.']" value="'.$files['name'].'">'; 
     
    798734                                        } 
    799735                                        $minibar_data=""; 
    800                                         if($this->path == $this->bo->homedir) 
     736                                        if($this->can_private) 
    801737                                        { 
    802738                                                if ($files['type'] == "1") 
     
    809745                                                } 
    810746                                                $link=$this->encode_href('/index.php','menuaction=filemanager.vfs_functions.setRestricted','file='.$files['name'].'&path='.$this->path); 
    811                                                 $minibar_data = '<img id="restrict_'.$files['name'].'" onclick="javascript:cExecute(\''.$link.'\',setRestricted)" alt="'.lang("mark as restricted").'" title="'.lang("mark as restricted").'" src="'.$image.'">'; 
     747                                                $minibar_data = '<img id="restrict_'.$files['name'].'" onClick="cExecute(\''.$link.'\',setRestricted)" alt="'.lang("mark as restricted").'" title="'.lang("mark as restricted").'" src="'.$image.'">'; 
    812748                                        } 
    813749 
     
    965901                                        if($this->prefs['comment']) 
    966902                                        { 
    967                                                 if($edit_this_comment) 
    968                                                 { 
    969                                                         $col_data='<input type="text" name="comment_files[' . $files['name'] . ']" value="'.$files['comment'].'" maxlength="255">'; 
    970                                                 } 
    971                                                 else 
    972                                                 { 
    973                                                         $col_data=$files['comment']; 
    974                                                 } 
     903                                                if (strlen($files['comment']) == 0 ) 
     904                                                        $files['comment'] = "&lt;".lang("no comments")."&gt;"; 
     905                                                $col_data='<span id="'.$files['name'].'" onClick="setComments(this)">'.$files['comment'].'</span>'; 
    975906                                                $this->t->set_var('col_data',$col_data); 
    976907                                                $this->t->parse('columns','column',True); 
     
    993924                                } 
    994925 
    995                                 // when renaming or changing comments render extra sumbmit button 
    996                                 if($this->rename_x || $this->edit_comments_x) 
     926                                // when renaming render extra sumbmit button 
     927                                if($this->rename_x) 
    997928                                { 
    998929                                        $col_data='<br/><input type="submit" name="save_changes" value="'.lang('Save changes').'">'; 
     
    11961127 
    11971128                                                        $toolbar.='<td><input type="hidden" id="newfile_or_dir" name="newfile_or_dir" value="" /></td>'; 
    1198                                                         $toolbar.='<div onclick="alert(\'asdf\')">'; 
    11991129                                                        //TODO : create folder with problems 
    12001130                                                        //$toolbar3.=$this->inputImage('newdir','createdir',lang('Create Folder')); 
    12011131                                                        $toolbar.=$this->inputImage('new','createfile',lang('New...')); 
    1202                                                         $toolbar.='</div>'; 
    12031132                                                } 
    12041133 
    1205                                                 if(!$this->rename_x && !$this->edit_comments_x && $this->can_edit) 
     1134                                                if(!$this->rename_x && $this->can_edit) 
    12061135                                                { 
    12071136                                                        // edit text file button 
     
    12091138                                                } 
    12101139 
    1211                                                 if(!$this->edit_comments_x && $this->can_edit) 
     1140                                                if($this->can_edit) 
    12121141                                                { 
    12131142                                                        $toolbar.=$this->inputImage('rename','rename',lang('Rename')); 
    12141143                                                } 
    12151144 
    1216                                                 if(!$this->rename_x && !$this->edit_comments_x && $this->can_delete) 
     1145                                                if(!$this->rename_x && $this->can_delete) 
    12171146                                                { 
    12181147                                                        $toolbar.=$this->inputImage('delete','delete',lang('Delete')); 
    12191148                                                } 
    12201149 
    1221                                                 if(!$this->rename_x && $this->can_edit &&  
     1150                                                /*if(!$this->rename_x && $this->can_edit &&  
    12221151                                                $_SESSION['phpgw_info']['user']['preferences']['filemanager']['comment'] == 1) 
    12231152                                                { 
    12241153                                                        $toolbar.=$this->inputImage('edit_comments','edit_comments',lang('Edit comments')); 
    1225                                                 } 
     1154                                                }*/ 
    12261155 
    12271156                                        } 
    12281157 
    12291158                                        //      $toolbar.='</tr></table>'; 
    1230                                         if(!$this->rename_x && !$this->edit_comments_x) 
     1159                                        if(!$this->rename_x) 
    12311160                                        { 
    12321161                                                // copy and move buttons 
     
    13831312                        } 
    13841313                } 
    1385                 # Handle Editing comments 
    1386                 function editComment() 
    1387                 { 
    1388                         while(list($file) = each($this->comment_files)) 
    1389                         { 
    1390                                 if($badchar = $this->bo->bad_chars($this->comment_files[$file], False, True)) 
    1391                                 { 
    1392                                         $this->messages[]=lang('Error:').$this->bo->html_encode(': ' . lang('Comments cannot contain "%1"', $badchar), 1); 
    1393                                         continue; 
    1394                                 } 
    1395  
    1396                                 $this->bo->vfs->set_attributes(array( 
    1397                                         'string'        => $file, 
    1398                                         'relatives'     => array(RELATIVE_ALL), 
    1399                                         'attributes'    => array( 
    1400                                                 'comment' => stripslashes($this->comment_files[$file]) 
    1401                                         ) 
    1402                                 )); 
    1403  
    1404                                 $this->messages[]=lang('Updated comment for %1', $this->path.'/'.$file); 
    1405                         } 
    1406  
    1407                         $this->readFilesInfo(); 
    1408                         $this->filelisting(); 
    1409                 } 
    1410  
    14111314                # Handle Renaming Files and Directories 
    14121315                function rename() 
     
    14241327                                        $this->messages[]=lang('Error:').lang("File names cannot contain \\ or /"); 
    14251328                                } 
    1426                                 elseif($this->vfs_functions->verifyLock($from,RELATIVE_ALL) && $this->bo->vfs->mv(array( 
    1427                                         'from'  => $from, 
    1428                                         'to'    => $to 
     1329                                elseif($this->vfs_functions->verifyLock($from,RELATIVE_CURRENT) && $this->bo->vfs->mv(array( 
     1330                                        'from'  => $this->disppath.'/'.$from, 
     1331                                        'to'    => $this->disppath.'/'.$to, 
     1332                                        'relatives' => array(RELATIVE_NONE,RELATIVE_NONE) 
    14291333                                ))) 
    14301334                                { 
    1431                                         $this->messages[]=lang('Renamed %1 to %2', $this->disppath.'/'.$from, $this->disppath.'/'.$to); 
     1335                                        $this->messages[]=lang('Renamed %1 to %2', $from, $to); 
    14321336                                } 
    14331337                                else 
    14341338                                { 
    1435                                         $this->messages[]= lang('Error:').lang('Could not rename %1 to %2', $this->disppath.'/'.$from, $this->disppath.'/'.$to); 
     1339                                        $this->messages[]= lang('Error:').lang('Could not rename %1 to %2', $from, $to); 
    14361340                                } 
    14371341                        } 
     
    15061410                        } 
    15071411                        if($copied) 
     1412                         
    15081413                        { 
    15091414                                $x=0; 
     
    20851990                        { 
    20861991                                return '<td class="" align="center" valign="middle" height="28" width="70"> 
    2087                                 <input onclick="return formfmValidate(this.name)" title="'.$description.'" name="'.$name.'" type="image" alt="'.$name.'" src="'.$image.'" value="clicked" /><br><small>'.$description.'</small> 
     1992                                <input onClick="return formfmValidate(\''.$name.'\')" title="'.$description.'" name="'.$name.'" type="image" alt="'.$name.'" src="'.$image.'" value="clicked" /><br><small>'.$description.'</small> 
    20881993                                </td>'; 
    20891994                        } 
  • sandbox/filemanager/inc/class.vfs_functions.inc.php

    r1627 r1648  
    2222                        'touch' => True, 
    2323                        'download'=>True, 
    24                         'setRestricted'=>True 
     24                        'setRestricted'=>True, 
     25                        'editComment'=> True 
    2526                ); 
    2627 
     
    226227                        } 
    227228                } 
     229                function editComment() 
     230                { 
     231                        while(list($file) = each($this->comment_files)) 
     232                        { 
     233                                if($badchar = $this->bo->bad_chars($this->comment_files[$file], False, True)) 
     234                                { 
     235                                        echo "False:badchar:".$badchar; 
     236                                        return False; 
     237                                } 
     238 
     239                                $this->bo->vfs->set_attributes(array( 
     240                                        'string'        => $file, 
     241                                        'relatives'     => array(RELATIVE_ALL), 
     242                                        'attributes'    => array( 
     243                                        'comment' => stripslashes($this->comment_files[$file]) 
     244                                        ) 
     245                                )); 
     246 
     247                                echo "True:".$file; 
     248                                return True; 
     249                        } 
     250                } 
    228251        } 
  • sandbox/filemanager/inc/hook_sidebox_menu.inc.php

    r1556 r1648  
    3030        $file = Array( 
    3131                'Filemanager preferences'=>$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=filemanager'), 
    32                 'Update'=>$GLOBALS['phpgw']->link('/index.php','menuaction=filemanager.uifilemanager.index&update=True'), 
     32                'Update'=>$GLOBALS['phpgw']->link('/index.php','menuaction=filemanager.uifilemanager.index&update.x=1'), 
    3333                'Grant Access'=>$GLOBALS['phpgw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app=filemanager'),     
    3434        ); 
  • sandbox/filemanager/js/common_functions.js

    r1627 r1648  
    166166 
    167167function base64_encode(str) { 
    168         var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; 
     168        var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 
    169169        var encoded = []; 
    170170        var c = 0; 
     
    232232                write_error("Could not mark as restricted"); 
    233233} 
     234 
     235function setComments(el){ 
     236        if (el.innerHTML == "&lt;"+get_lang('no comments')+"&gt;") 
     237                var comment = ""; 
     238        else 
     239                var comment = el.innerHTML; 
     240        var filename = base64_encode(el.id); 
     241        input_el = document.createElement('INPUT'); 
     242        input_el.id = "inputTemp"+el.id; 
     243        input_el.size = (comment.length-2); 
     244        input_el.maxlength = "255"; 
     245        input_el.value = comment; 
     246        el.parentNode.appendChild(input_el); 
     247        el.parentNode.removeChild(el); 
     248        input_el.focus(); 
     249        input_el.onblur = function () { cExecute('/index.php?menuaction=filemanager.vfs_functions.editComment&comment_files['+filename+']='+this.value,updateComment); }; 
     250} 
     251 
     252function updateComment(data) { 
     253        var returnVal = data.split(':'); 
     254        if (data.indexOf("True") == 0){ 
     255                var input_el = document.getElementById("inputTemp"+returnVal[1]); 
     256                span_comment = document.createElement('span'); 
     257                span_comment.innerHTML = input_el.value; 
     258                span_comment.id=returnVal[1]; 
     259                span_comment.onclick=function () { setComments(span_comment) }; 
     260                input_el.parentNode.appendChild(span_comment); 
     261                input_el.parentNode.removeChild(input_el); 
     262                write_msg(get_lang('Updated comment for %1',returnVal[1])); 
     263        } 
     264        else 
     265        { 
     266                if (returnVal[1] == "badchar") 
     267                        write_error(get_lang('Comments cannot contain "%1"',returnVal[2])); 
     268                else 
     269                        write_error(get_lang('You have no permission to access this file')); 
     270        } 
     271 
     272} 
  • sandbox/filemanager/setup/phpgw_pt-br.lang

    r1627 r1648  
    2727created %1      filemanager     pt-br   Criado %1 
    2828You have no permission to access this file      filemanager     pt-br   Você não tem permissão para acessar este arquivo 
     29no comments     filemanager     pt-br   sem comentários 
    2930created %1,%2   filemanager     pt-br   Criado %1, %2 
    3031created by      filemanager     pt-br   Criado por 
  • trunk/phpgwapi/inc/class.vfs_sql.inc.php

    r1627 r1648  
    620620                                $data = array (); 
    621621                        } 
    622  
    623                         /* ExpressoLivre principle: In your home you do what you want*/ 
    624                         if (strpos($data['string'],$this->my_home) === 0) 
    625                                 return True; 
    626  
     622         
    627623                        $default_values = array 
    628624                                ( 
     
    639635                                return True; 
    640636                        } 
     637 
     638                        /* ExpressoLivre principle: In your home you do what you want*/ 
     639                        if (strpos($data['string'],$this->my_home) === 0) 
     640                                return True; 
     641                        if ($data['relatives'][0] == RELATIVE_NONE || $data['relatives'][0] == RELATIVE_ALL) 
     642                        { 
     643                                $path = explode('/',$data['string']); 
     644                                $data['string'] = '/'.$path[1].'/'.$path[2]; 
     645                        } 
     646 
     647 
    641648 
    642649                        if (!$data['owner_id']) 
     
    703710                                   We don't use ls () to get owner_id as we normally would, 
    704711                                   because ls () calls acl_check (), which would create an infinite loop 
    705                                 */ 
    706                                 $query = $GLOBALS['phpgw']->db->query ("SELECT owner_id FROM phpgw_vfs WHERE directory='". 
    707                                         $GLOBALS['phpgw']->db->db_addslashes($p2->fake_leading_dirs_clean)."' AND name='". 
    708                                         $GLOBALS['phpgw']->db->db_addslashes($p2->fake_name_clean)."'" . $this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__, __FILE__); 
    709                                 $GLOBALS['phpgw']->db->next_record (); 
    710  
    711                                 $owner_id = $GLOBALS['phpgw']->db->Record['owner_id']; 
     712                                 */ 
     713                                $owner_id = $this->ownerOf($p2->fake_leading_dirs_clean,$p2->fake_name_clean); 
    712714                        } 
    713715                        else 
    714716                        { 
    715717                                $owner_id = $data['owner_id']; 
    716                         } 
    717  
    718                         /* This is correct.  The ACL currently doesn't handle undefined values correctly */ 
    719                         if (!$owner_id) 
    720                         { 
    721                                 $owner_id = 0; 
    722718                        } 
    723719 
     
    781777                                return False; 
    782778                        } 
     779                } 
     780                function ownerOf($base,$path){ 
     781                        $query = $GLOBALS['phpgw']->db->query ("SELECT owner_id FROM phpgw_vfs WHERE directory='". 
     782                        $GLOBALS['phpgw']->db->db_addslashes($base)."' AND name='". 
     783                        $GLOBALS['phpgw']->db->db_addslashes($path)."' ".$this->extra_sql (array ('query_type' => VFS_SQL_SELECT)), __LINE__, __FILE__); 
     784                        $GLOBALS['phpgw']->db->next_record(); 
     785                        $owner_id = $GLOBALS['phpgw']->db->Record['owner_id']; 
     786                        if (!$owner_id) 
     787                        { 
     788                                $owner_id = 0; 
     789                        } 
     790                        return $owner_id; 
    783791                } 
    784792 
     
    856864                        $path = explode('/',$data['string']); 
    857865                        $quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2])); 
    858                         if ($quota > 0 && $this->get_size($data) >= $quota * 1024 * 1024) 
     866                        if ($quota > 0 && $this->get_size('/'.$path[1].'/'.$path[2]) >= $quota * 1024 * 1024) 
    859867                                return false; 
    860868 
     
    887895                                $acl_operation = PHPGW_ACL_ADD; 
    888896                        } 
    889                         // In your dir you can do anything you want 
    890                         $path = explode('/',$p->fake_full_path); 
    891                         if (!$this->acl_check (array( 
    892                                         'string'        => '/'.$path[1].'/'.$path[2], 
    893                                         'relatives'     => array ($p->mask), 
    894                                         'operation'     => $acl_operation 
    895                                 )) 
    896                         ) 
    897                         { 
    898                                 return False; 
    899                         } 
    900  
    901897                        umask(0177); 
    902898 
     
    10981094                        $path = explode('/',$data['to']); 
    10991095                        $quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2])); 
    1100                         $size = $this->get_size(array('string' => $data['to'], 'relatives' => $data['relatives'][1])); 
     1096                        $size = $this->get_size(array('string' => '/'.$path[1].'/'.$path[2], 'relatives' => $data['relatives'][1])); 
    11011097                        if ($quota > 0 && $size >= $quota * 1024 * 1024) 
    11021098                                return false; 
     
    13631359                                $data = array (); 
    13641360                        } 
    1365  
    1366                         $path = explode('/',$data['to']); 
    1367                         $quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2])); 
    1368                         $size = $this->get_size(array('string' => $data['to'], 'relatives' => $data['relatives'][1])); 
     1361                        if ($data['relatives'][1] == RELATIVE_NONE) 
     1362                        { 
     1363                                $path = explode('/',$data['to']); 
     1364                                $quota = $this->get_quota(array('string' => '/'.$path[1].'/'.$path[2])); 
     1365                                $size = $this->get_size(array('string' => '/'.$path[1].'/'.$path[2], 'relatives' => $data['relatives'][1])); 
     1366                        } 
     1367                        else 
     1368                        { 
     1369                                $quota = $this->get_quota(array('string' => $this->my_home)); 
     1370                                $size = $this->get_size(array('string' => $this->my_home, 'relatives' => $data['relatives'][1])); 
     1371                        } 
    13691372                        if ($quota > 0 && $size >= $quota * 1024 * 1024) 
    13701373                                return false; 
     
    13911394                                ) 
    13921395                        ); 
    1393                         // In your dir you can do anything you want 
    1394                         $path = explode('/',$t->fake_full_path); 
     1396 
    13951397                        if (!$this->acl_check (array( 
    1396                                         'string'        => '/'.$path[1].'/'.$path[2], 
    1397                                         'relatives'     => array ($f->mask), 
    1398                                         'operation'     => PHPGW_ACL_READ 
    1399                                 )) 
    1400                                 || !$this->acl_check (array( 
    1401                                         'string'        => '/'.$path[1].'/'.$path[2], 
    1402                                         'relatives'     => array ($f->mask), 
    1403                                         'operation'     => PHPGW_ACL_DELETE 
    1404                                 )) 
    1405                         ) 
    1406                         { 
    1407                                 return False; 
    1408                         } 
    1409  
    1410                         if (!$this->acl_check (array( 
    1411                                         'string'        => '/'.$path[1].'/'.$path[2], 
     1398                                        'string'        => $data['to'], 
    14121399                                        'relatives'     => array ($t->mask), 
    14131400                                        'operation'     => PHPGW_ACL_ADD 
     
    14251412                        { 
    14261413                                if (!$this->acl_check (array( 
    1427                                                 'string'        => '/'.$path[1].'/'.$path[2], 
     1414                                                'string'        => $data['to'], 
    14281415                                                'relatives'     => array ($t->mask), 
    14291416                                                'operation'     => PHPGW_ACL_EDIT 
     
    16151602                                ) 
    16161603                        ); 
    1617                         // Inside the folder that you have pemission you can do anything you want 
    1618                         $path = explode('/',$p->fake_full_path); 
    1619                         if (!$this->acl_check (array( 
    1620                                         'string'        => '/'.$path[1].'/'.$path[2], 
    1621                                         'relatives'     => array ($p->mask), 
    1622                                         'operation'     => PHPGW_ACL_DELETE 
    1623                                 )) 
    1624                         ) 
    1625                         { 
    1626                                 return False; 
    1627                         } 
    1628  
    16291604                        if (!$this->file_exists (array( 
    16301605                                        'string'        => $data['string'], 
  • trunk/phpgwapi/templates/default/css/rochas.css

    r1514 r1648  
    179179{ 
    180180        height:9px; 
     181} 
     182 
     183.dsused 
     184{ 
     185                background-image: url(../images/dsused.gif); 
    181186} 
    182187 
Note: See TracChangeset for help on using the changeset viewer.