Revision 7813,
1.6 KB
checked in by alexandrecorreia, 11 years ago
(diff) |
Ticket #2507 - Ajustando os padrões dos nomes das variáveis
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[7810] | 1 | <?php |
---|
| 2 | |
---|
| 3 | class EditUserResource extends AdminAdapter |
---|
| 4 | { |
---|
| 5 | public function post($request) |
---|
| 6 | { |
---|
| 7 | // to Receive POST Params (use $this->params) |
---|
| 8 | parent::post($request); |
---|
| 9 | |
---|
| 10 | if( $this->isLoggedIn() ) |
---|
| 11 | { |
---|
| 12 | // Permission |
---|
| 13 | $permission = array(); |
---|
| 14 | $permission['action'] = 'edit_users'; |
---|
| 15 | $permission['apps'] = $this->getUserApps(); |
---|
| 16 | |
---|
| 17 | //Load Conf Admin |
---|
| 18 | $this->loadConfAdmin(); |
---|
| 19 | |
---|
| 20 | if( $this->validatePermission($permission) ) |
---|
| 21 | { |
---|
| 22 | $uidUser = $this->getParam('account_uidnumber_edit'); |
---|
| 23 | |
---|
| 24 | // Validate fields |
---|
| 25 | if( trim($uidUser) == "" && isset($uidUser) ) |
---|
| 26 | Errors::runException( "ADMIN_UIDNUMBER_EMPTY" ); |
---|
| 27 | |
---|
| 28 | // Get User |
---|
| 29 | $fields = $this->editUser($uidUser); |
---|
| 30 | |
---|
| 31 | if( $fields != false ) |
---|
| 32 | { |
---|
| 33 | // Return fields |
---|
| 34 | $return = array(); |
---|
[7813] | 35 | $return['accountUidnumber'] = $fields['uidnumber']; |
---|
| 36 | $return['accountLogin'] = $fields['uid']; |
---|
| 37 | $return['accountEmail'] = $fields['mail']; |
---|
| 38 | $return['accountName'] = $fields['givenname']." ".$fields['sn']; |
---|
| 39 | $return['accountPhone'] = $fields['telephonenumber']; |
---|
| 40 | $return['accountCpf'] = $fields['corporative_information_cpf']; |
---|
| 41 | $return['accountRg'] = $fields['corporative_information_rg']; |
---|
| 42 | $return['accountRgUf'] = $fields['corporative_information_rguf']; |
---|
| 43 | $return['accountDescription'] = $fields['corporative_information_description']; |
---|
[7810] | 44 | |
---|
| 45 | $this->setResult( array( "result" => $return )); |
---|
| 46 | } |
---|
| 47 | else |
---|
| 48 | Errors::runException( "ADMIN_USER_NOT_FOUND" ); |
---|
| 49 | } |
---|
| 50 | else |
---|
| 51 | { |
---|
| 52 | Errors::runException( "ACCESS_NOT_PERMITTED" ); |
---|
| 53 | } |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | return $this->getResponse(); |
---|
| 57 | } |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.