Ignore:
Timestamp:
06/27/12 14:56:25 (12 years ago)
Author:
eduardow
Message:

Ticket #2863 - Backport da funcionalidade de Controle de Cotas de usuário e disco(Cotas OU).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/expressoAdmin1_2/inc/class.bosectors.inc.php

    r6660 r6662  
    111111                                $this->so->remove_attribute($sector_info[0]['dn'], $ldap_mod_del); 
    112112                        }  
    113                                           
    114                         //Modifica o conteúdo das cotas.  
    115                         if( (isset($_POST['disk_quota']) ) && (isset($_POST['users_quota']) ) ) { //se for passado alguma coisa, lógico  
    116                                 $ldap_mod_replace = array();  
    117                                 $ldap_mod_replace['diskQuota'] = $_POST['disk_quota'];  
    118                                 $ldap_mod_replace['usersQuota'] = $_POST['users_quota'];  
    119                                 $this->so->replace_attribute($sector_info[0]['dn'], $ldap_mod_replace);  
     113                        if(!in_array('phpgwQuotaControlled',$sector_info[0]['objectclass'] ))  
     114                        {  
     115                                $ldap_mod_add = array();  
     116                                $ldap_mod_add['objectClass'][] = 'phpgwQuotaControlled';  
     117                                $ldap_mod_add['diskQuota'] = isset($_POST['disk_quota']) ? (int)$_POST['disk_quota'] : 0;  
     118                                $ldap_mod_add['usersQuota'] = isset($_POST['users_quota']) ? (int)$_POST['users_quota'] : 0;  
     119  
     120                                $this->so->add_attribute($sector_info[0]['dn'], $ldap_mod_add);  
    120121                        } 
    121                          
     122                        else  
     123                        {  
     124                                $ldap_mod_replace = array();   
     125                                if(isset($_POST['disk_quota']))  
     126                                        $ldap_mod_replace['diskQuota'] = (int)$_POST['disk_quota'];   
     127  
     128                                if(isset($_POST['users_quota']))  
     129                                        $ldap_mod_replace['usersQuota'] = (int)$_POST['users_quota'];   
     130  
     131                                if(count($ldap_mod_replace) > 0)  
     132                                        $this->so->replace_attribute($sector_info[0]['dn'], $ldap_mod_replace);   
     133                        } 
    122134                        // Volta para o ListSectors 
    123135                        ExecMethod('expressoAdmin1_2.uisectors.list_sectors'); 
Note: See TracChangeset for help on using the changeset viewer.