Revision 7930,
1.2 KB
checked in by alexandrecorreia, 11 years ago
(diff) |
Ticket #2507 - Retorno do uidnumber e uid para o portal da SEED
|
Rev | Line | |
---|
[6019] | 1 | <?php |
---|
| 2 | |
---|
[6149] | 3 | class 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( |
---|
| 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'], |
---|
[6239] | 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.