Changeset 4259 for branches/2.2.0.1


Ignore:
Timestamp:
05/06/11 17:05:05 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #1726 - resolvendo problema de cota padrão nula. r4220

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.0.1/filemanager/inc/class.uifilemanager.inc.php

    r3936 r4259  
    182182                $test = $this->bo->vfs->get_real_info(array('string' => $this->bo->basedir . $this->bo->homedir, 'relatives' => array(RELATIVE_NONE), 'relative' => False)); 
    183183                if ($test[mime_type] != 'Directory') { 
     184                         
     185                        $c_admin = CreateObject('phpgwapi.config', 'expressoAdmin1_2'); 
     186                        $c_admin->read_repository(); 
     187                        if($c_admin->config_data['expressoAdmin_cotasOu']) 
     188                                $this->generate_error(lang("You have access to the application, but you have no quota. Please contact your administrator")); 
     189                         
    184190                        $this->bo->vfs->override_acl = 1; 
    185191 
     
    191197                                 'string' => $this->bo->homedir, 
    192198                                 'relatives' => array(RELATIVE_NONE), 
    193                                  'new_quota' => $this->current_config['filemanager_quota_size'] 
     199                                 'new_quota' => $this->current_config['filemanager_quota_size']?$this->current_config['filemanager_quota_size']:0 
    194200                        )); 
    195201 
     
    206212                        } 
    207213                } 
     214                 
     215        } 
     216 
     217        function generate_error($error) { 
     218                $template = CreateObject('phpgwapi.Template', PHPGW_SERVER_ROOT . '/filemanager/templates/'.$GLOBALS['phpgw_info']['server']['template_set']); 
     219                $template->set_file( 
     220                                Array( 
     221                                        'error_model' => 'errors.tpl' 
     222                                ) 
     223                        ); 
     224                $template->set_block('error_model','error_page'); 
     225                $template->set_var("errors",$error); 
     226                $GLOBALS['phpgw_info']['flags'] = array 
     227                         ( 
     228                         'currentapp' => 'filemanager', 
     229                         'noheader' => False, 
     230                         'nonavbar' => False, 
     231                         'nofooter' => False, 
     232                         'noappheader' => False, 
     233                         'enable_browser_class' => True 
     234                ); 
     235                $GLOBALS['phpgw']->common->phpgw_header(); 
     236                $template->pfp('out','error_page'); 
     237                $GLOBALS['phpgw']->common->phpgw_footer(); 
     238                $GLOBALS['phpgw']->common->phpgw_exit(); 
    208239        } 
    209240 
Note: See TracChangeset for help on using the changeset viewer.