1
0
Fork 0

WebApp: Require a very simple login...

This commit is contained in:
Holger Hans Peter Freyther 2010-12-11 12:30:46 +01:00
parent 1c8cce66ef
commit 0427513af8
1 changed files with 28 additions and 0 deletions

View File

@ -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 [