source: sandbox/webservice/api/rest/core/LoginResource.php @ 7941

Revision 7941, 1.2 KB checked in by alexandrecorreia, 11 years ago (diff)

Ticket #2507 - Verificando se os campos possuem valor para a atualização

RevLine 
[6019]1<?php
2
[6149]3class LoginResource extends ExpressoAdapter {
[6148]4
5        private function getUserProfile(){
[6664]6                if($this->getExpressoVersion() != "2.2") {
7                        $_SESSION['wallet']['user']['uidNumber'] = $GLOBALS['phpgw_info']['user']['account_id'];
8                }
[6148]9       
10                return array(
[7941]11                                'contactID'                             => $GLOBALS['phpgw_info']['user']['account_dn'],
12                                'contactMails'                  => array($GLOBALS['phpgw_info']['user']['email']),
13                                'contactPhones'                 => array($GLOBALS['phpgw_info']['user']['telephonenumber']),
14                                'contactFullName'               => $GLOBALS['phpgw_info']['user']['fullname'],
[7930]15                                'contactLID'                    => $GLOBALS['phpgw_info']['user']['account_lid'],
16                                'contactUIDNumber'              => $GLOBALS['phpgw_info']['user']['account_id'],
[7941]17                                'contactApps'                   => $this->getUserApps()
[6148]18                );
19        }
20       
[6019]21        public function post($request){
22                // to Receive POST Params (use $this->params)
[6061]23                parent::post($request);
24                if($sessionid = $GLOBALS['phpgw']->session->create($this->getParam('user'), $this->getParam('password')))
25                {
26                        $result = array(
27                                'auth'                  => $sessionid.":".$GLOBALS['phpgw']->session->kp3,
28                                'profile'               => array($this->getUserProfile())
29                        );
30                        $this->setResult($result);
[6019]31                }
32                else
33                {
[6165]34                        Errors::runException($GLOBALS['phpgw']->session->cd_reason);
[6019]35                }
[6061]36                return $this->getResponse();
[6019]37        }       
38
39}
Note: See TracBrowser for help on using the repository browser.