Changeset 6459 for trunk/prototype
- Timestamp:
- 06/11/12 18:05:43 (12 years ago)
- Location:
- trunk/prototype
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/config/filter.ini
r6021 r6459 10 10 11 11 [before.delete] 12 deleteVacationRule = modules/filters/interceptors/FilterMapping.php 12 13 deleteRule = modules/filters/interceptors/FilterMapping.php 13 14 … … 22 23 makeId = modules/filters/interceptors/FilterMapping.php 23 24 applySieveFilter = modules/filters/interceptors/FilterMapping.php 25 verifyVacationRule = modules/filters/interceptors/FilterMapping.php 24 26 25 27 26 28 [after.update] 27 29 makeId = modules/filters/interceptors/FilterMapping.php 30 verifyVacationRule = modules/filters/interceptors/FilterMapping.php 28 31 29 32 -
trunk/prototype/config/user.ini
r5804 r6459 44 44 givenName = givenName 45 45 sn = sn 46 dn = dn 47 vacationInfo = vacationInfo 48 vacationActive = vacationActive 46 49 displayName = displayName 47 50 mailAlternateAddress = mailAlternateAddress -
trunk/prototype/modules/filters/interceptors/FilterMapping.php
r6392 r6459 697 697 return( $return ); 698 698 } 699 700 /** 701 * Método que insere no ldap as informações do vacation 702 * 703 * @license http://www.gnu.org/copyleft/gpl.html GPL 704 * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 705 * @sponsor Caixa Econômica Federal 706 * @author Cristiano Corrêa Schmidt 707 * @param <$uri> 708 * @param <$result> 709 * @param <$criteria> 710 * @param <$original> 711 * @return <void> 712 * @access public 713 */ 714 public function verifyVacationRule( &$uri , &$params , &$criteria , $original ) 715 { 716 if( $original['properties']['id'] === 'vacation' ) 717 { 718 719 $user = Controller::read(array('concept' => 'user' , 'id' => config::me('uidNumber') , 'service' => 'OpenLDAP')); 720 $ldapConf = Config::service('OpenLDAP', 'config'); 721 $con = ldap_connect( $ldapConf['host'] ); 722 ldap_set_option( $con,LDAP_OPT_PROTOCOL_VERSION, 3 ); 723 ldap_bind( $con, $ldapConf['user'], $ldapConf['password']); 724 725 $info = array(); 726 if(!in_array('Vacation', $user['objectClass'])) 727 $info['objectClass'] = 'Vacation'; 728 729 $info['vacationActive'] = strtoupper($original['properties']['enabled']); 730 731 if(isset($original['properties']['actions']) && isset($original['properties']['actions'][0]['parameter'])) 732 $info['vacationInfo'] = $original['properties']['actions'][0]['parameter']; 733 else if( !isset($user['vacationInfo']) ) 734 { 735 $rules = $this->getRules(); 736 if(is_array($rules)) 737 foreach ($rules as $rule) 738 if($rule['id'] === 'vacation') 739 $info['vacationInfo'] = $rule['actions'][0]['parameter']; 740 } 741 742 if(!in_array('Vacation', $user['objectClass'])) 743 ldap_mod_add ( $con , $user['dn'] , $info ); 744 else 745 ldap_modify ( $con , $user['dn'] , $info ); 746 747 748 ldap_close($con); 749 750 } 751 752 } 753 754 /** 755 * Método que remove do ldap as informações do vacation 756 * 757 * @license http://www.gnu.org/copyleft/gpl.html GPL 758 * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 759 * @sponsor Caixa Econômica Federal 760 * @author Cristiano Corrêa Schmidt 761 * @param <$uri> 762 * @param <$result> 763 * @param <$criteria> 764 * @param <$original> 765 * @return <void> 766 * @access public 767 */ 768 public function deleteVacationRule( &$uri , &$params , &$criteria , $original ) 769 { 770 if( $original['URI']['id'] === 'vacation' ) 771 { 772 $user = Controller::read(array('concept' => 'user' , 'id' => config::me('uidNumber') , 'service' => 'OpenLDAP')); 773 $ldapConf = Config::service('OpenLDAP', 'config'); 774 $con = ldap_connect( $ldapConf['host'] ); 775 ldap_set_option( $con,LDAP_OPT_PROTOCOL_VERSION, 3 ); 776 ldap_bind( $con, $ldapConf['user'], $ldapConf['password']); 777 $info = array(); 778 $info['vacationActive'] = 'FALSE'; 779 $info['vacationInfo'] = ""; 780 ldap_modify ( $con , $user['dn'] , $info ); 781 ldap_close($con); 782 } 783 } 699 784 }
Note: See TracChangeset
for help on using the changeset viewer.