Ignore:
Timestamp:
07/11/12 11:45:10 (12 years ago)
Author:
niltonneto
Message:

Ticket #0000 - Copiadas as alterações do Trunk. Versão final da 2.4.1.

Location:
branches/2.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4

  • branches/2.4/expressoAdmin1_2/inc/class.bosectors.inc.php

    r6713 r6754  
    4545                        $sector_info = array(); 
    4646                        $sector_info['ou']                              = $_POST['sector'];   
    47                         $sector_info['objectClass'][]   = 'top';  
    48                 $sector_info['objectClass'][]   = 'organizationalUnit';  
    49                 $sector_info['objectClass'][]   = 'phpgwQuotaControlled';  
    50                         /*Insere as informações sobre quota total por usuários e por gigabytes de espaço em disco   
    51               Se não vierem os dados, ele coloca 0 (Caso não exista controle de cota).   
    52                  */  
    53                     $sector_info['diskQuota'] = isset($_POST['disk_quota']) ? (int)$_POST['disk_quota'] : 0;   
    54                     $sector_info['usersQuota'] = isset($_POST['users_quota']) ? (int)$_POST['users_quota'] : 0;  
    55  
     47                        $sector_info['objectClass'][]   = 'top'; 
     48                        $sector_info['objectClass'][]   = 'organizationalUnit'; 
     49                        $sector_info['objectClass'][]   = 'phpgwQuotaControlled'; 
     50                        /*Insere as informações sobre quota total por usuários e por gigabytes de espaço em disco   
     51              Se não vierem os dados, ele coloca 0 (Caso não exista controle de cota).  
     52             */ 
     53                $sector_info['diskQuota'] = isset($_POST['disk_quota']) ? (int)$_POST['disk_quota'] : 0;  
     54                $sector_info['usersQuota'] = isset($_POST['users_quota']) ? (int)$_POST['users_quota'] : 0;  
    5655 
    5756                        $systemName = $GLOBALS['phpgw_info']['server']['system_name']; 
     
    111110                                $this->so->remove_attribute($sector_info[0]['dn'], $ldap_mod_del); 
    112111                        }  
    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);  
     112 
     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); 
    121121                        } 
    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                         } 
     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                        } 
    134134                        // Volta para o ListSectors 
    135135                        ExecMethod('expressoAdmin1_2.uisectors.list_sectors'); 
Note: See TracChangeset for help on using the changeset viewer.