[squeak-dev] [Q] help with requesting a html page

Edgar J. De Cleene edgardec2005 at gmail.com
Sun Nov 20 20:52:09 UTC 2011




On 11/20/11 14:18 PM, "Chris Cunnington" <smalltalktelevision at gmail.com>
wrote:

> HVNaughtieUsers? OK, so you're using HttpView2.
> 
> Your code example is too low level in an HVHttpView2 app. That stuff is
> abstracted away. You won't see
> 
> request propertyAt:
> 
> in here
> 
> http://map.squeak.org/srcautologin
> http://map.squeak.org/srcnewaccount
> 
> HttpView2 talks to Komanche for you. I'd look at the
> HVSimpleForms>>#megaform2 example and look at stuff like this:
> 
> "Add a password."
> pass _ b br; br; html: 'Password: '; inputPassword.
> pass2 _ b br; html: 'Verify: '; inputPassword.
> 
> (pass value isEmpty and: [pass2 value isEmpty]) ifFalse: [
> pass value = pass2 value
> ifTrue: [message value: '<b>Verified correctly!</b>']
> ifFalse: [message value: '<b>Verified incorrectly!</b>']].
> "Add two breaks and a submit button, end the form."
> button _ b br; br; submit: 'Hit me'.
> b endForm.
> 
> 
> And in SMSqueakMapView>>#login:url: (in SMServer at Göran's repo) which has:
> 
> b ifPost: [
> (requestedUrl value = (self prefix, '/login')) ifTrue:[requestedUrl value:
> self prefix].
> account _ model accountForUsername: username.
> account ifNil: [account _ model accountForEmail: username].
> account ifNil: [msg value: 'No account with that username or email!']
> ifNotNil: [
> account password isNil
> ifTrue: [msg value: 'First login should be done using the link provided in the
> confirmation email!']
> ifFalse: [
> (account correctPassword: password)
> ifTrue:[
> KomSession current attributes at: #account put: account.
> ^self redirectTo: requestedUrl value ]
> ifFalse:[
> KomSession current attributes at: #failedAccount put: account.
> msg value: 'Wrong password - ', (b getLinkLocal: '/mailnewpassword' text:
> 'would you like a new one?') ]]]
> ].
> 
> Of course, you could try using a body of code that wasn't developed in Squeak
> 3.8. 
> 
> http://www.squeakmap.org
> 
> Chris 
> 
> Thank Chris.
> In fact , is modified Kom + modified HV2.
> Off course , SqueakMap and other code by Goran is always an inspirational
> example
> 
> My poor man solution to my own question is (for now)
> 
> login
> | fields aPassword userName logged |
> 
> fields := self request fields.
> fields ifNotNil:[ userName := (fields at: 'username') first.
>     aPassword := (fields at: 'password') first.
>     logged := HVNaughtieUsers new verifyPassword: aPassword forUser: userName
> ].
> self halt.
> 
> I trying reverse engineering Mantis for a Squeak + Kom + HV2 + external
> Javascript.
> Re using for how his .php
> I called it Sapis see
> http://imageshack.us/photo/my-images/525/screenshot20111120at503.png/
> 
> And for now I have the following directory tree
> http://img840.imageshack.us/img840/2622/screenshot20111120at526.png
> 
> It¹s a long way to have Sapis in Squeak mimic the real Mantis.
> This is my first steps
> Edgar
> 
> PS. Mantis eats bugs, Sapo eats Mantis and other bugs.
> Bufonidae is the family <http://en.wikipedia.org/wiki/Family_%28biology%29>
> of the true toads, members of the order Anura
> <http://en.wikipedia.org/wiki/Anura>  (frogs and toads). They are the only
> family of anurans all members of which are known as "toads
> <http://en.wikipedia.org/wiki/Toads> ." The bufonids now comprise more than 35
> genera, Bufo <http://en.wikipedia.org/wiki/Bufo>  being the most widespread
> and well known.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20111120/4801d37f/attachment.htm


More information about the Squeak-dev mailing list