Changeset 3acff4e72a4ed507ea71dbb4dfa1339aecf0138a
- Timestamp:
- 04/13/09 16:24:31 (3 years ago)
- Author:
- Robin Gareus <robin@…>
- Parents:
- bd0385dc59fe794d2171654707bf107779051760
- Children:
- cb749e0f9f6f4cebd2387b5e2d8318780434257b
- git-committer:
- Robin Gareus <robin@gareus.org> / 2009-04-13T18:24:31Z+0200
- Message:
-
added pass.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rbd0385d
|
r3acff4e
|
|
| 1 | 1 | package org.red5.demos.oflaDemo; |
| | 2 | |
| | 3 | import java.io.*; |
| 2 | 4 | |
| 3 | 5 | import org.red5.server.api.Red5; |
| … |
… |
|
| 21 | 23 | private IScope appScope; |
| 22 | 24 | |
| 23 | | private IServerStream serverStream; |
| 24 | | |
| 25 | 25 | { |
| 26 | 26 | log.info("oflaDemo created"); |
| … |
… |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | | /** {@inheritDoc} */ |
| 31 | 30 | @Override |
| 32 | 31 | public boolean appStart(IScope app) { |
| … |
… |
|
| 37 | 36 | } |
| 38 | 37 | |
| 39 | | /** {@inheritDoc} */ |
| | 38 | |
| | 39 | private boolean checkPass(String u, String p) { |
| | 40 | if (u.equals("secret")) return true; |
| | 41 | return false; |
| | 42 | } |
| | 43 | |
| 40 | 44 | @Override |
| 41 | 45 | public boolean appConnect(IConnection conn, Object[] params) { |
| … |
… |
|
| 53 | 57 | } |
| 54 | 58 | |
| 55 | | boolean accept = true ; //(Boolean)params[0]; |
| | 59 | boolean accept = checkPass(params[0].toString(),params[1].toString()); |
| 56 | 60 | if (!accept) { |
| 57 | | rejectClient( "invalid permissions." ); |
| | 61 | rejectClient("invalid permissions."); |
| 58 | 62 | return false; |
| 59 | 63 | } |
| … |
… |
|
| 66 | 70 | public void appDisconnect(IConnection conn) { |
| 67 | 71 | log.info("oflaDemo appDisconnect" + conn.getClient().getId() ); |
| 68 | | if (appScope == conn.getScope() && serverStream != null) { |
| 69 | | serverStream.close(); |
| 70 | | } |
| | 72 | try{ |
| | 73 | Runtime.getRuntime().exec("/tmp/test.sh"); |
| | 74 | } catch (IOException e) {} |
| 71 | 75 | super.appDisconnect(conn); |
| 72 | 76 | } |