diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-12-11 12:30:46 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-12-11 12:30:46 +0100 |
commit | 0427513af8d1cde8314ea08c56e95f76b31a84cd (patch) | |
tree | f3427663ea192267b8b2b5fff5dabf12ce02b143 | |
parent | 1c8cce66ef7cd750fc48659919daca06eb2e14f0 (diff) |
WebApp: Require a very simple login...
-rw-r--r-- | WebApp.st | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -120,6 +120,13 @@ Iliad.ILWidget subclass: CallWidget [ Iliad.ILSession subclass: GSMTestphoneSession [ | user gsmConfig procedures | + isAuthenticated [ + ^ user = 'toto-user' + ] + + username: aUser [ + user := aUser. + ] gsmConfig [ ^ gsmConfig ifNil: [gsmConfig := PhoneConfig new. ]] procedures [ ^ procedures ifNil: [procedures := OrderedCollection new]] @@ -162,6 +169,27 @@ Iliad.ILApplication subclass: GSMTestphoneApp [ e build: self lu. ]. ] + + loginContents [ + <category: 'building'> + ^[:e | + e form build: [:form | + form input action: [:val | self login: val]. + form button text: 'Login']] + ] + + login: aString [ + <category: 'actions'> + self session username: aString. + self redirectToCurrentController + ] + + dispatchOverride [ + <category: 'dispatching'> + ^self session isAuthenticated + ifFalse: [self loginContents] + ifTrue: [super dispatchOverride] + ] ] Eval [ |