Changeset 6061 for sandbox/webservice/api/rest/core/LoginResource.php
- Timestamp:
- 04/27/12 15:18:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/rest/core/LoginResource.php
r6019 r6061 4 4 public function post($request){ 5 5 // to Receive POST Params (use $this->params) 6 parent::post($request); 7 8 if(!$this-> isLoggedIn()) 9 { 10 if($sessionid = $GLOBALS['phpgw']->session->create($this->getParam('user'), $this->getParam('password'))) 11 { 12 $result = array( 13 'auth' => $sessionid.":".$GLOBALS['phpgw']->session->kp3, 14 'profile' => array($this->getUserProfile()) 15 ); 16 $this->setError(false); 17 $this->setResult($result); 18 } 19 else 20 { 21 $this->setError($GLOBALS['phpgw']->session->cd_reason); 22 } 6 parent::post($request); 7 if($sessionid = $GLOBALS['phpgw']->session->create($this->getParam('user'), $this->getParam('password'))) 8 { 9 $result = array( 10 'auth' => $sessionid.":".$GLOBALS['phpgw']->session->kp3, 11 'profile' => array($this->getUserProfile()) 12 ); 13 $this->setResult($result); 23 14 } 24 15 else 25 16 { 26 $result = array('auth' => $this->getParam('auth')); 27 $this->setResult($result); 17 throw new ResponseException("",$GLOBALS['phpgw']->session->cd_reason); 28 18 } 29 30 //to Send Response (JSON RPC format) 31 return $this->getResponse(); 19 return $this->getResponse(); 32 20 } 33 21
Note: See TracChangeset
for help on using the changeset viewer.