Changeset 7931 for sandbox


Ignore:
Timestamp:
03/01/13 10:11:21 (11 years ago)
Author:
alexandrecorreia
Message:

Ticket #2507 - Adicionado o cadastro dos seguintes campos datanascimento,st,city e sexo no ldap

Location:
sandbox/webservice/api/rest/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sandbox/webservice/api/rest/admin/CommonFunctions.php

    r7882 r7931  
    1414                 
    1515                return str_replace( $array1, $array2, $param); 
     16        } 
     17 
     18        public function mascaraBirthDate($param) 
     19        { 
     20                $bDate = trim(preg_replace("/[^0-9]/", "", $param)); 
     21 
     22                $bDate = preg_replace('/(\d{2})(\d{2})(\d{4})/','$1/$2/$3',$bDate); 
     23 
     24                if( preg_match("#/#", $bDate) === 1 ) 
     25                        $strDate = implode("-",array_reverse(explode('/',$bDate)));  
     26 
     27                return $strDate; 
    1628        } 
    1729 
  • sandbox/webservice/api/rest/admin/CreateUserResource.php

    r7878 r7931  
    3535                                $rgUser                 = trim($this->getParam('accountRg')); 
    3636                                $rgUF                   = trim($this->getParam('accountRgUf')); 
     37                                $birthDate              = $common->mascaraBirthDate($this->getParam('accountBirthDate')); 
     38                                $st                     = $this->getParam('accountSt'); 
     39                                $city                   = $this->getParam('accountCity'); 
     40                                $sex                    = $this->getParam('accountSex'); 
    3741                                $description    = $common->convertChar(trim($this->getParam('accountDescription'))); 
    3842 
     
    121125                                $fields['corporative_information_rguf'] = $rgUF; 
    122126                                $fields['corporative_information_description'] = $description; 
     127                                $fields['corporative_information_datanascimento'] = $birthDate; 
     128                                $fields['corporative_information_st']   = $st; 
     129                                $fields['corporative_information_city'] = $city; 
     130                                $fields['corporative_information_sexo'] = $sex; 
    123131 
    124132                                // Validate Fields 
Note: See TracChangeset for help on using the changeset viewer.