Ignore:
Timestamp:
06/08/07 15:18:19 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/inc/class.bosectors.inc.php

    r2 r32  
    4545                        $sector_info['objectClass'][0]  = 'top'; 
    4646                        $sector_info['objectClass'][1]  = 'organizationalUnit'; 
     47                        $sector_info['objectClass'][2]  = 'phpgwAccount'; 
     48                         
     49                        if ($_POST['sector_visible']) 
     50                                $sector_info['phpgwaccountvisible'] = '-1'; 
    4751                         
    4852                        // Chama funcao para escrever no OpenLDAP, case de erro, volta com msg de erro. 
     
    6165                        $GLOBALS['phpgw']->redirect($url); 
    6266                } 
    63                  
     67 
    6468                function save_sector() 
    6569                { 
     70                        $sector_info = $this->so->get_info($_POST['context']); 
     71                         
     72                        if (($_POST['sector_visible'] == 'on') && ($sector_info['phpgwaccountvisible'] != '-1')) 
     73                        { 
     74                                foreach ($sector_info[0]['objectclass'] as $objectClass) 
     75                                { 
     76                                        if ($objectClass == 'phpgwAccount') 
     77                                                $phpgwAccount = true; 
     78                                        else 
     79                                                $phpgwAccount = false; 
     80                                } 
     81                                 
     82                                if (!$phpgwAccount) 
     83                                { 
     84                                        $ldap_mod_add['objectClass'][] = 'phpgwAccount'; 
     85                                } 
     86                                 
     87                                $ldap_mod_add['phpgwaccountvisible'] = '-1'; 
     88                                $this->so->add_attribute($sector_info[0]['dn'], $ldap_mod_add); 
     89                        } 
     90                        else 
     91                        { 
     92                                $ldap_mod_del['phpgwaccountvisible'] = array(); 
     93                                $this->so->remove_attribute($sector_info[0]['dn'], $ldap_mod_del); 
     94                        } 
     95                                 
    6696                        // Volta para o ListSectors 
    67                         $url = ($GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uisectors.list_sectors')); 
    68                         $GLOBALS['phpgw']->redirect($url); 
     97                        ExecMethod('expressoAdmin1_2.uisectors.list_sectors'); 
    6998                } 
    70                  
     99 
    71100                function delete_sector() 
    72101                { 
Note: See TracChangeset for help on using the changeset viewer.