Revision 7308,
1.0 KB
checked in by alexandrecorreia, 12 years ago
(diff) |
Ticket #3093 - Integração da API REST.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[7308] | 1 | <?php |
---|
| 2 | class LogoutResource extends ExpressoAdapter { |
---|
| 3 | |
---|
| 4 | public function post($request){ |
---|
| 5 | // to Receive POST Params (use $this->params) |
---|
| 6 | parent::post($request); |
---|
| 7 | |
---|
| 8 | if($this-> isLoggedIn()) |
---|
| 9 | { if ($_SESSION['phpgw_session']['session_id'] && file_exists($GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$_SESSION['phpgw_session']['session_id'])) |
---|
| 10 | { |
---|
| 11 | $dh = opendir($GLOBALS['phpgw_info']['server']['temp_dir']. SEP . $_SESSION['phpgw_session']['session_id']); |
---|
| 12 | while ($file = readdir($dh)) |
---|
| 13 | { |
---|
| 14 | if ($file != '.' && $file != '..') |
---|
| 15 | { |
---|
| 16 | unlink($GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$_SESSION['phpgw_session']['session_id'].SEP.$file); |
---|
| 17 | } |
---|
| 18 | } |
---|
| 19 | rmdir($GLOBALS['phpgw_info']['server']['temp_dir'].SEP.$_SESSION['phpgw_session']['session_id']); |
---|
| 20 | } |
---|
| 21 | $GLOBALS['phpgw']->hooks->process('logout'); |
---|
| 22 | $GLOBALS['phpgw']->session->destroy($_SESSION['phpgw_session']['session_id'], $GLOBALS['kp3']); |
---|
| 23 | $this->setResult(true); |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | //to Send Response (JSON RPC format) |
---|
| 27 | return $this->getResponse(); |
---|
| 28 | } |
---|
| 29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.