Ignore:
Timestamp:
08/06/07 08:54:16 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

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

    r33 r46  
    7575                        $group_info['userPassword']                     = ''; 
    7676                         
     77                        // E-mail for groups 
     78                        if ($params['email'] != '') 
     79                                $group_info['mail'] = $params['email']; 
     80                         
    7781                        if (count($params['members'])) 
    7882                        { 
     
    9397                        { 
    9498                                $group_info['objectClass'][]  = 'sambaGroupMapping'; 
    95                                 $group_info['sambaSID']           = $params['sambadomain'] . '-' . (($id * 2) + 1001); 
     99                                $group_info['sambaSID']           = $params['sambasid'] . '-' . (($id * 2) + 1001); 
    96100                                $group_info['sambaGroupType'] = '2'; 
    97101                        } 
     
    166170                        } 
    167171                         
     172                        $ldap_mod_replace = array(); 
    168173                        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    169174                        // REPLACE SAMBASID OF SAMBA 
    170                         if ( ($this->current_config['expressoAdmin_samba_support'] == 'true') && ($diff['sambadomain']) )  
    171                         { 
    172                                 $ldap_mod_replace['sambaSID'] = $new_values['sambadomain'] . '-' . ((2 * $new_values['uidnumber'])+1001); 
    173                                 $this->db_functions->write_log("Alterado dominio samba do grupo $dn para " . $new_values['sambadomain'],'',$dn,'',''); 
     175                        if ( ($this->current_config['expressoAdmin_samba_support'] == 'true') && ($diff['sambasid']) && ($old_values['sambasid'])) 
     176                        { 
     177                                $ldap_mod_replace['sambasid'] = $new_values['sambasid'] . '-' . ((2 * $new_values['gidnumber'])+1001); 
     178                                $this->db_functions->write_log("Alterado dominio samba do grupo $dn para " . $new_values['sambasid'],'',$dn,'',''); 
    174179                        } 
    175180                         
     
    183188 
    184189                        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    185                         // CALL LDAP_REPLACE FUNCTION                    
     190                        // REPLACE E-Mail 
     191                        if ((($old_values['email']) && ($diff['email'])) &&  
     192                                $this->functions->check_acl($_SESSION['phpgw_session']['session_lid'],'edit_email_groups')) 
     193                        { 
     194                                $ldap_mod_replace['mail'] = $new_values['email']; 
     195                                $this->db_functions->write_log("Modificado E-Mail do grupo $dn",'',$dn,'',''); 
     196                        } 
     197 
     198                        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
     199                        // CALL LDAP_REPLACE FUNCTION 
    186200                        if (count($ldap_mod_replace)) 
    187201                        { 
     
    226240                                        $ldap_add['objectClass'][]              = 'sambaGroupMapping'; 
    227241                                        $ldap_add['sambagrouptype']             = '2'; 
    228                                         $ldap_add['sambasid']                   = $new_values['sambadomain'] . '-' . ((2 * $new_values['gidnumber'])+1001); 
     242                                        $ldap_add['sambasid']                   = $new_values['sambasid'] . '-' . ((2 * $new_values['gidnumber'])+1001); 
    229243                                         
    230244                                        $result = $this->ldap_functions->add_user_attributes($dn, $ldap_add); 
     
    241255                        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    242256                        // ADD ATTRIBUTES 
     257                        $ldap_add = array(); 
    243258                        if (($new_values['phpgwaccountvisible'] == 'on') && ($old_values['phpgwaccountvisible'] != '-1')) 
    244259                        { 
    245260                                $ldap_add['phpgwaccountvisible'] = '-1'; 
     261                                $this->db_functions->write_log("Adicionado atributo phpgwaccountvisible ao grupo $dn",'','','',''); 
     262                        } 
     263                        if ((($new_values['email']) && (!$old_values['email'])) && 
     264                                $this->functions->check_acl($_SESSION['phpgw_session']['session_lid'],'edit_email_groups')) 
     265                        { 
     266                                $ldap_add['mail'] = $new_values['email']; 
     267                                $this->db_functions->write_log("Adicionado atributo mail ao grupo $dn",'','','',''); 
     268                        } 
     269                        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
     270                        // CALL LDAP_ADD FUNCTION                        
     271                        if (count($ldap_add)) 
     272                        { 
    246273                                $result = $this->ldap_functions->add_user_attributes($dn, $ldap_add); 
    247274                                if (!$result['status']) 
     
    250277                                        $return['msg'] .= $result['msg']; 
    251278                                } 
    252                                 else 
    253                                         $this->db_functions->write_log("Adicionado atributo phpgwaccountvisible ao grupo $dn",'','','',''); 
    254                         } 
    255                          
     279                        } 
     280                                                 
     281                        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
    256282                        // REMOVE ATTRIBUTES 
     283                        $ldap_remove = array(); 
    257284                        if (($new_values['phpgwaccountvisible'] != 'on') && ($old_values['phpgwaccountvisible'] == '-1')) 
    258285                        { 
    259286                                $ldap_remove['phpgwaccountvisible'] = array(); 
     287                                $this->db_functions->write_log("Removido atributo phpgwaccountvisible do grupo $dn",'','','',''); 
     288                        } 
     289                        if (((!$new_values['email']) && ($old_values['email'])) && 
     290                                $this->functions->check_acl($_SESSION['phpgw_session']['session_lid'],'edit_email_groups')) 
     291                        { 
     292                                $ldap_remove['mail'] = array(); 
     293                                $this->db_functions->write_log("Removido atributo mail do grupo $dn",'','','',''); 
     294                        } 
     295                        //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
     296                        // CALL LDAP_REMOVED FUNCTION                    
     297                        if (count($ldap_remove)) 
     298                        { 
    260299                                $result = $this->ldap_functions->remove_user_attributes($dn, $ldap_remove); 
    261300                                if (!$result['status']) 
     
    264303                                        $return['msg'] .= $result['msg']; 
    265304                                } 
    266                                 else 
    267                                         $this->db_functions->write_log("Removido atributo phpgwaccountvisible do grupo $dn",'','','',''); 
    268305                        } 
    269306 
Note: See TracChangeset for help on using the changeset viewer.