Fwd: We would love some help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: We would love some help

J. P. L. Martín
Hello people, I'm making a Practical Work in Pharo with my classmates, the Work should be a fully working application to manage a University Library. At the moment we have most of the work done, I must say it's messy and far from being beautiful, but it works and it's likely to be approved. Here is what's done so far: https://github.com/arguser/Paradigmas-Final

Most of the work was doing making research and guided mostly y examples, so far I didn't find how to do or make work some features:
* A Dialog which prompts for User and Password (We don't know how to implement it in-code either)
* Block a father window when a child is made, so the father window can't be closed if a child window exist.
* Make some content of windows change size dynamically.
* Search only for filled-in fields from search form.

If any advice or example can be given addressing the previous matters it will be really helpful.

Thanks in advance!


Reply | Threaded
Open this post in threaded view
|

Re: Fwd: We would love some help

hilaire
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: We would love some help

hilaire
In reply to this post by J. P. L. Martín
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: We would love some help

J. P. L. Martín
In reply to this post by hilaire
Most of the GUI is based on UITheme examples, yet I wasn't able to figure out about user/password prompt. And I'm missing how should I implement it on code (not GUI) OrderedCollection of Class Users with instanse variable "password" asString?


On Fri, Feb 1, 2013 at 9:20 PM, Hilaire Fernandes <[hidden email]> wrote:
Related to widget (for password and search only for filled-in fields),
did you take a look at the examples methods in the class side of UITheme?

Hilaire


Le 02/02/2013 00:36, J. P. L. Martín a écrit :
> Hello people, I'm making a Practical Work in Pharo with my classmates,
> the Work should be a fully working application to manage a University
> Library. At the moment we have most of the work done, I must say it's
> messy and far from being beautiful, but it works and it's likely to be
> approved. Here is what's done so far:
> https://github.com/arguser/Paradigmas-Final
>
> Most of the work was doing making research and guided mostly y examples,
> so far I didn't find how to do or make work some features:
> * A Dialog which prompts for User and Password (We don't know how to
> implement it in-code either)
> * Block a father window when a child is made, so the father window can't
> be closed if a child window exist.
> * Make some content of windows change size dynamically.
> * Search only for filled-in fields from search form.
>
> If any advice or example can be given addressing the previous matters it
> will be really helpful.
>
> Thanks in advance!
>
>




Reply | Threaded
Open this post in threaded view
|

Re: Fwd: We would love some help

Paul DeBruicker
In reply to this post by J. P. L. Martín
For an example of the login process using Pharo + Seaside see

http://www.squeaksource.com/TFLogin

Which you can probably adapt for just Pharo


To store the passwords, if you're on linux, use the bcrypt
implementation in the PasswordHashingFFI package from here:

http://www.squeaksource.com/Cryptography.html

I'd be interested in getting PasswordHashingFFI working on Windows or
MacOSX so would help if I can.  But using it makes your implementation
depend upon an external library you'd likely have to find and supply for
users.







On 02/01/2013 03:36 PM, J. P. L. Martín wrote:

> Hello people, I'm making a Practical Work in Pharo with my classmates,
> the Work should be a fully working application to manage a University
> Library. At the moment we have most of the work done, I must say it's
> messy and far from being beautiful, but it works and it's likely to be
> approved. Here is what's done so far:
> https://github.com/arguser/Paradigmas-Final
>
> Most of the work was doing making research and guided mostly y examples,
> so far I didn't find how to do or make work some features:
> * A Dialog which prompts for User and Password (We don't know how to
> implement it in-code either)
> * Block a father window when a child is made, so the father window can't
> be closed if a child window exist.
> * Make some content of windows change size dynamically.
> * Search only for filled-in fields from search form.
>
> If any advice or example can be given addressing the previous matters it
> will be really helpful.
>
> Thanks in advance!
>
>


Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

Benjamin Van Ryseghem (Pharo)
Why not just something like

| password cryptedPassword |

password := UITheme current passwordEntryIn: World text: 'Password' title: 'Title' entryText: ''.
cryptedPassword := MD5 new initialize hashStream: password readStream

?


Ben

On Feb 2, 2013, at 5:06 PM, Paul DeBruicker <[hidden email]> wrote:

For an example of the login process using Pharo + Seaside see

http://www.squeaksource.com/TFLogin

Which you can probably adapt for just Pharo


To store the passwords, if you're on linux, use the bcrypt
implementation in the PasswordHashingFFI package from here:

http://www.squeaksource.com/Cryptography.html

I'd be interested in getting PasswordHashingFFI working on Windows or
MacOSX so would help if I can.  But using it makes your implementation
depend upon an external library you'd likely have to find and supply for
users.







On 02/01/2013 03:36 PM, J. P. L. Martín wrote:
Hello people, I'm making a Practical Work in Pharo with my classmates,
the Work should be a fully working application to manage a University
Library. At the moment we have most of the work done, I must say it's
messy and far from being beautiful, but it works and it's likely to be
approved. Here is what's done so far:
https://github.com/arguser/Paradigmas-Final

Most of the work was doing making research and guided mostly y examples,
so far I didn't find how to do or make work some features:
* A Dialog which prompts for User and Password (We don't know how to
implement it in-code either)
* Block a father window when a child is made, so the father window can't
be closed if a child window exist.
* Make some content of windows change size dynamically.
* Search only for filled-in fields from search form.

If any advice or example can be given addressing the previous matters it
will be really helpful.

Thanks in advance!





Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

Benjamin Van Ryseghem (Pharo)
In reply to this post by J. P. L. Martín


Ben

On Feb 2, 2013, at 2:56 AM, J. P. L. Martín <[hidden email]> wrote:

Most of the GUI is based on UITheme examples, yet I wasn't able to figure out about user/password prompt. And I'm missing how should I implement it on code (not GUI) OrderedCollection of Class Users with instanse variable "password" asString?


On Fri, Feb 1, 2013 at 9:20 PM, Hilaire Fernandes <[hidden email]> wrote:
Related to widget (for password and search only for filled-in fields),
did you take a look at the examples methods in the class side of UITheme?

Hilaire


Le 02/02/2013 00:36, J. P. L. Martín a écrit :
> Hello people, I'm making a Practical Work in Pharo with my classmates,
> the Work should be a fully working application to manage a University
> Library. At the moment we have most of the work done, I must say it's
> messy and far from being beautiful, but it works and it's likely to be
> approved. Here is what's done so far:
> https://github.com/arguser/Paradigmas-Final
>
> Most of the work was doing making research and guided mostly y examples,
> so far I didn't find how to do or make work some features:
> * A Dialog which prompts for User and Password (We don't know how to
> implement it in-code either)

You can also have a look at PasswordInitializationDialogWindow: 
PasswordInitializationDialogWindow new openInWorld

For encryption, you can also use 
SecureHashAlgorithm new hashMessage: aString

> * Block a father window when a child is made, so the father window can't
> be closed if a child window exist.

childerWindow openModal: fatherWindow

> * Make some content of windows change size dynamically.

You can do that using Morphic, but this is quite tricky (in fact, you need to remove all the sub widgets, then change their layout and re add them)
Spec provides a simpler way to do it. If you are interested in, I can point you some documentation :)


> * Search only for filled-in fields from search form.
>

Sorry, I do not get this one :)


Ben

> If any advice or example can be given addressing the previous matters it
> will be really helpful.
>
> Thanks in advance!
>
>





Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

Paul DeBruicker
In reply to this post by Benjamin Van Ryseghem (Pharo)
I guess it depends on the cost to you or your organization of having
someone you don't want/know getting access to information that should be
password protected.

A thorough argument for bcrypt rather than md5/SHA is made here:

http://codahale.com/how-to-safely-store-a-password/


I use it because for roughly the same number of lines of code passwords
are much harder to crack.



On 02/02/2013 09:02 AM, Benjamin wrote:

> Why not just something like
>
> | password cryptedPassword |
>
> password := UITheme current passwordEntryIn: World text: 'Password'
> title: 'Title' entryText: ''.
> cryptedPassword := MD5 new initialize hashStream: password readStream
>
> ?
>
>
> Ben
>
> On Feb 2, 2013, at 5:06 PM, Paul DeBruicker <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>> For an example of the login process using Pharo + Seaside see
>>
>> http://www.squeaksource.com/TFLogin
>>
>> Which you can probably adapt for just Pharo
>>
>>
>> To store the passwords, if you're on linux, use the bcrypt
>> implementation in the PasswordHashingFFI package from here:
>>
>> http://www.squeaksource.com/Cryptography.html
>>
>> I'd be interested in getting PasswordHashingFFI working on Windows or
>> MacOSX so would help if I can.  But using it makes your implementation
>> depend upon an external library you'd likely have to find and supply for
>> users.
>>
>>
>>
>>
>>
>>
>>
>> On 02/01/2013 03:36 PM, J. P. L. Martín wrote:
>>> Hello people, I'm making a Practical Work in Pharo with my classmates,
>>> the Work should be a fully working application to manage a University
>>> Library. At the moment we have most of the work done, I must say it's
>>> messy and far from being beautiful, but it works and it's likely to be
>>> approved. Here is what's done so far:
>>> https://github.com/arguser/Paradigmas-Final
>>>
>>> Most of the work was doing making research and guided mostly y examples,
>>> so far I didn't find how to do or make work some features:
>>> * A Dialog which prompts for User and Password (We don't know how to
>>> implement it in-code either)
>>> * Block a father window when a child is made, so the father window can't
>>> be closed if a child window exist.
>>> * Make some content of windows change size dynamically.
>>> * Search only for filled-in fields from search form.
>>>
>>> If any advice or example can be given addressing the previous matters it
>>> will be really helpful.
>>>
>>> Thanks in advance!
>>>
>>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

Benjamin Van Ryseghem (Pharo)
Ok :)

I will read this (since I am not an expert in security and encryption, it's cool to have something to read to be less stupid about this ^^)

Ben

On Feb 2, 2013, at 6:33 PM, Paul DeBruicker <[hidden email]> wrote:

I guess it depends on the cost to you or your organization of having
someone you don't want/know getting access to information that should be
password protected.

A thorough argument for bcrypt rather than md5/SHA is made here:

http://codahale.com/how-to-safely-store-a-password/


I use it because for roughly the same number of lines of code passwords
are much harder to crack.



On 02/02/2013 09:02 AM, Benjamin wrote:
Why not just something like

| password cryptedPassword |

password := UITheme current passwordEntryIn: World text: 'Password'
title: 'Title' entryText: ''.
cryptedPassword := MD5 new initialize hashStream: password readStream

?


Ben

On Feb 2, 2013, at 5:06 PM, Paul DeBruicker <[hidden email]
<mailto:[hidden email]>> wrote:

For an example of the login process using Pharo + Seaside see

http://www.squeaksource.com/TFLogin

Which you can probably adapt for just Pharo


To store the passwords, if you're on linux, use the bcrypt
implementation in the PasswordHashingFFI package from here:

http://www.squeaksource.com/Cryptography.html

I'd be interested in getting PasswordHashingFFI working on Windows or
MacOSX so would help if I can.  But using it makes your implementation
depend upon an external library you'd likely have to find and supply for
users.







On 02/01/2013 03:36 PM, J. P. L. Martín wrote:
Hello people, I'm making a Practical Work in Pharo with my classmates,
the Work should be a fully working application to manage a University
Library. At the moment we have most of the work done, I must say it's
messy and far from being beautiful, but it works and it's likely to be
approved. Here is what's done so far:
https://github.com/arguser/Paradigmas-Final

Most of the work was doing making research and guided mostly y examples,
so far I didn't find how to do or make work some features:
* A Dialog which prompts for User and Password (We don't know how to
implement it in-code either)
* Block a father window when a child is made, so the father window can't
be closed if a child window exist.
* Make some content of windows change size dynamically.
* Search only for filled-in fields from search form.

If any advice or example can be given addressing the previous matters it
will be really helpful.

Thanks in advance!








Reply | Threaded
Open this post in threaded view
|

Fwd: We would love some help

J. P. L. Martín
In reply to this post by Benjamin Van Ryseghem (Pharo)
I'm not sure how should I, for making the GUI we mainly based on the ContactList example on PharoCasts: http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html
This is my child window:

UIPrestamos>>openModal

openModal
    | builder content dialog |
    prestamo id: (Prestamo database size = 0 ifTrue: 1 ifFalse: [Prestamo database last id + 1]) asString.
    builder := UITheme builder.
    content := builder
        newLabelGroup:
            {('Prestamo: '
                ->
                    (builder
                        newLabelFor: self prestamo getLabel: #id getEnabled: nil  )).
            ('Socio '
                ->
                    (builder
                        newTextEntryFor: self prestamo
                        getText: #idSocio
                        setText: #idSocio:
                        help: 'Codigo de Socio')).
                        ('Ejemplar: '
                ->
                    (builder
                        newTextEntryFor: self prestamo
                        getText: #idEjemplar
                        setText: #idEjemplar:
                        help: 'Codigo de Ejemplar'))}.
    dialog := builder newPluggableDialogWindow: 'Nuevo Prestamo' for: content.
    builder openModal: dialog.
    dialog cancelled ifFalse: [self doOnOK].

----
Which is called this way:

UIBabel>>addPrestamo

addPrestamo
    | prestamo alerta |
    prestamo := Prestamo new.
    alerta := AlertDialogWindow new.
    UIPrestamos new
        prestamo: prestamo;
        onOK: [ ((Ejemplar  database anySatisfy: [:x | x idEjemplar = prestamo idEjemplar and: (x fechaBaja = '') ]) and: (Socio  database anySatisfy: [:y| y numeroDeSocio = prestamo idSocio])) ifTrue: [Prestamo database add: prestamo] ifFalse: [alerta alert: 'El socio o el ejemplar no se encuentra disponible'].
                seleccionado := Prestamo database size.
                self
                    changed: #listado;
                    changed: #selecciono ];
        openModal.

----
I've also found another way to show lists, using GridMorph instead of the current PluggableMultiColumnList, sadly it look really hard and lot of refactor should be done :(
> * Block a father window when a child is made, so the father window can't
> be closed if a child window exist.

childerWindow openModal: fatherWindow


Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

Stéphane Ducasse
In reply to this post by Paul DeBruicker
thanks paul
this is another nice article. I always learn something with these.

Stef

On Feb 2, 2013, at 6:33 PM, Paul DeBruicker wrote:

> I guess it depends on the cost to you or your organization of having
> someone you don't want/know getting access to information that should be
> password protected.
>
> A thorough argument for bcrypt rather than md5/SHA is made here:
>
> http://codahale.com/how-to-safely-store-a-password/
>
>
> I use it because for roughly the same number of lines of code passwords
> are much harder to crack.
>
>
>
> On 02/02/2013 09:02 AM, Benjamin wrote:
>> Why not just something like
>>
>> | password cryptedPassword |
>>
>> password := UITheme current passwordEntryIn: World text: 'Password'
>> title: 'Title' entryText: ''.
>> cryptedPassword := MD5 new initialize hashStream: password readStream
>>
>> ?
>>
>>
>> Ben
>>
>> On Feb 2, 2013, at 5:06 PM, Paul DeBruicker <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>> For an example of the login process using Pharo + Seaside see
>>>
>>> http://www.squeaksource.com/TFLogin
>>>
>>> Which you can probably adapt for just Pharo
>>>
>>>
>>> To store the passwords, if you're on linux, use the bcrypt
>>> implementation in the PasswordHashingFFI package from here:
>>>
>>> http://www.squeaksource.com/Cryptography.html
>>>
>>> I'd be interested in getting PasswordHashingFFI working on Windows or
>>> MacOSX so would help if I can.  But using it makes your implementation
>>> depend upon an external library you'd likely have to find and supply for
>>> users.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 02/01/2013 03:36 PM, J. P. L. Martín wrote:
>>>> Hello people, I'm making a Practical Work in Pharo with my classmates,
>>>> the Work should be a fully working application to manage a University
>>>> Library. At the moment we have most of the work done, I must say it's
>>>> messy and far from being beautiful, but it works and it's likely to be
>>>> approved. Here is what's done so far:
>>>> https://github.com/arguser/Paradigmas-Final
>>>>
>>>> Most of the work was doing making research and guided mostly y examples,
>>>> so far I didn't find how to do or make work some features:
>>>> * A Dialog which prompts for User and Password (We don't know how to
>>>> implement it in-code either)
>>>> * Block a father window when a child is made, so the father window can't
>>>> be closed if a child window exist.
>>>> * Make some content of windows change size dynamically.
>>>> * Search only for filled-in fields from search form.
>>>>
>>>> If any advice or example can be given addressing the previous matters it
>>>> will be really helpful.
>>>>
>>>> Thanks in advance!
>>>>
>>>>
>>>
>>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

Benjamin Van Ryseghem (Pharo)
In reply to this post by J. P. L. Martín
Sorry, but it's too late now for me to read spanish :s
Can you provide an "english" version of this please ?

Ben

On Feb 2, 2013, at 7:54 PM, J. P. L. Martín <[hidden email]> wrote:

I'm not sure how should I, for making the GUI we mainly based on the ContactList example on PharoCasts: http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html
This is my child window:

UIPrestamos>>openModal

openModal
    | builder content dialog |
    prestamo id: (Prestamo database size = 0 ifTrue: 1 ifFalse: [Prestamo database last id + 1]) asString.
    builder := UITheme builder.
    content := builder
        newLabelGroup:
            {('Prestamo: '
                ->
                    (builder
                        newLabelFor: self prestamo getLabel: #id getEnabled: nil  )).
            ('Socio '
                ->
                    (builder
                        newTextEntryFor: self prestamo
                        getText: #idSocio
                        setText: #idSocio:
                        help: 'Codigo de Socio')).
                        ('Ejemplar: '
                ->
                    (builder
                        newTextEntryFor: self prestamo
                        getText: #idEjemplar
                        setText: #idEjemplar:
                        help: 'Codigo de Ejemplar'))}.
    dialog := builder newPluggableDialogWindow: 'Nuevo Prestamo' for: content.
    builder openModal: dialog.
    dialog cancelled ifFalse: [self doOnOK].

----
Which is called this way:

UIBabel>>addPrestamo

addPrestamo
    | prestamo alerta |
    prestamo := Prestamo new.
    alerta := AlertDialogWindow new.
    UIPrestamos new
        prestamo: prestamo;
        onOK: [ ((Ejemplar  database anySatisfy: [:x | x idEjemplar = prestamo idEjemplar and: (x fechaBaja = '') ]) and: (Socio  database anySatisfy: [:y| y numeroDeSocio = prestamo idSocio])) ifTrue: [Prestamo database add: prestamo] ifFalse: [alerta alert: 'El socio o el ejemplar no se encuentra disponible'].
                seleccionado := Prestamo database size.
                self
                    changed: #listado;
                    changed: #selecciono ];
        openModal.

----
I've also found another way to show lists, using GridMorph instead of the current PluggableMultiColumnList, sadly it look really hard and lot of refactor should be done :(
> * Block a father window when a child is made, so the father window can't
> be closed if a child window exist.

childerWindow openModal: fatherWindow



Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

J. P. L. Martín
Prestamo = Loan
Ejemplar = a Copy (of a Material)
Socio = Library member.
Listado = List
Selecciono = Selected
Alerta = Alert

Anyway you could ignore most of the spanish stuff since the problem is how should I call openModal so it blocks the main window. So, add loan creates a Loan new, then does an openModal on UILoans where you load the Loan data: CopyID, MemberID, etc. if you hit OK some conditions should apply for it to be added on the Loan database (anOrderedCollection). openModal on UILoans just popups a newPluggableDialogWindow with textEntries to fill the Loan fields before adding it to the database.


On Sat, Feb 2, 2013 at 4:09 PM, Benjamin <[hidden email]> wrote:
Sorry, but it's too late now for me to read spanish :s
Can you provide an "english" version of this please ?

Ben

On Feb 2, 2013, at 7:54 PM, J. P. L. Martín <[hidden email]> wrote:

I'm not sure how should I, for making the GUI we mainly based on the ContactList example on PharoCasts: http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html
This is my child window:

UIPrestamos>>openModal

openModal
    | builder content dialog |
    prestamo id: (Prestamo database size = 0 ifTrue: 1 ifFalse: [Prestamo database last id + 1]) asString.
    builder := UITheme builder.
    content := builder
        newLabelGroup:
            {('Prestamo: '
                ->
                    (builder
                        newLabelFor: self prestamo getLabel: #id getEnabled: nil  )).
            ('Socio '
                ->
                    (builder
                        newTextEntryFor: self prestamo
                        getText: #idSocio
                        setText: #idSocio:
                        help: 'Codigo de Socio')).
                        ('Ejemplar: '
                ->
                    (builder
                        newTextEntryFor: self prestamo
                        getText: #idEjemplar
                        setText: #idEjemplar:
                        help: 'Codigo de Ejemplar'))}.
    dialog := builder newPluggableDialogWindow: 'Nuevo Prestamo' for: content.
    builder openModal: dialog.
    dialog cancelled ifFalse: [self doOnOK].

----
Which is called this way:

UIBabel>>addPrestamo

addPrestamo
    | prestamo alerta |
    prestamo := Prestamo new.
    alerta := AlertDialogWindow new.
    UIPrestamos new
        prestamo: prestamo;
        onOK: [ ((Ejemplar  database anySatisfy: [:x | x idEjemplar = prestamo idEjemplar and: (x fechaBaja = '') ]) and: (Socio  database anySatisfy: [:y| y numeroDeSocio = prestamo idSocio])) ifTrue: [Prestamo database add: prestamo] ifFalse: [alerta alert: 'El socio o el ejemplar no se encuentra disponible'].
                seleccionado := Prestamo database size.
                self
                    changed: #listado;
                    changed: #selecciono ];
        openModal.

----
I've also found another way to show lists, using GridMorph instead of the current PluggableMultiColumnList, sadly it look really hard and lot of refactor should be done :(
> * Block a father window when a child is made, so the father window can't
> be closed if a child window exist.

childerWindow openModal: fatherWindow




Reply | Threaded
Open this post in threaded view
|

Fwd: We would love some help

J. P. L. Martín
In reply to this post by Stéphane Ducasse

> On 02/02/2013 09:02 AM, Benjamin wrote:
>> Why not just something like
>>
>> | password cryptedPassword |
>>
>> password := UITheme current passwordEntryIn: World text: 'Password'
>> title: 'Title' entryText: ''.
>> cryptedPassword := MD5 new initialize hashStream: password readStream
>>
>> ?
>>
>>
>> Ben

Any way to put only the password field into modal with UITheme buider? Let's say:
UILogin>>login
login

|builder content dialog|

builder := UITheme builder.

content := {
'User: ' -> (builder newTextEntryFor: self getText: #username setText: #username: help: 'Username').
Password -> (builder newPasswordEntry (for example) setText: #password help: 'Password').}

   
    dialog := builder newPluggableDialogWindowIn: 'Acceso' for: content.
    builder openModal: dialog.






Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

J. P. L. Martín
In reply to this post by J. P. L. Martín
Solution was pretty easy, I've replaced

builder openModal: dialog

with:

World openModal: dialog


On Sat, Feb 2, 2013 at 4:26 PM, J. P. L. Martín <[hidden email]> wrote:
Prestamo = Loan
Ejemplar = a Copy (of a Material)
Socio = Library member.
Listado = List
Selecciono = Selected
Alerta = Alert

Anyway you could ignore most of the spanish stuff since the problem is how should I call openModal so it blocks the main window. So, add loan creates a Loan new, then does an openModal on UILoans where you load the Loan data: CopyID, MemberID, etc. if you hit OK some conditions should apply for it to be added on the Loan database (anOrderedCollection). openModal on UILoans just popups a newPluggableDialogWindow with textEntries to fill the Loan fields before adding it to the database.


On Sat, Feb 2, 2013 at 4:09 PM, Benjamin <[hidden email]> wrote:
Sorry, but it's too late now for me to read spanish :s
Can you provide an "english" version of this please ?

Ben

On Feb 2, 2013, at 7:54 PM, J. P. L. Martín <[hidden email]> wrote:

I'm not sure how should I, for making the GUI we mainly based on the ContactList example on PharoCasts: http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html
This is my child window:

UIPrestamos>>openModal

openModal
    | builder content dialog |
    prestamo id: (Prestamo database size = 0 ifTrue: 1 ifFalse: [Prestamo database last id + 1]) asString.
    builder := UITheme builder.
    content := builder
        newLabelGroup:
            {('Prestamo: '
                ->
                    (builder
                        newLabelFor: self prestamo getLabel: #id getEnabled: nil  )).
            ('Socio '
                ->
                    (builder
                        newTextEntryFor: self prestamo
                        getText: #idSocio
                        setText: #idSocio:
                        help: 'Codigo de Socio')).
                        ('Ejemplar: '
                ->
                    (builder
                        newTextEntryFor: self prestamo
                        getText: #idEjemplar
                        setText: #idEjemplar:
                        help: 'Codigo de Ejemplar'))}.
    dialog := builder newPluggableDialogWindow: 'Nuevo Prestamo' for: content.
    builder openModal: dialog.
    dialog cancelled ifFalse: [self doOnOK].

----
Which is called this way:

UIBabel>>addPrestamo

addPrestamo
    | prestamo alerta |
    prestamo := Prestamo new.
    alerta := AlertDialogWindow new.
    UIPrestamos new
        prestamo: prestamo;
        onOK: [ ((Ejemplar  database anySatisfy: [:x | x idEjemplar = prestamo idEjemplar and: (x fechaBaja = '') ]) and: (Socio  database anySatisfy: [:y| y numeroDeSocio = prestamo idSocio])) ifTrue: [Prestamo database add: prestamo] ifFalse: [alerta alert: 'El socio o el ejemplar no se encuentra disponible'].
                seleccionado := Prestamo database size.
                self
                    changed: #listado;
                    changed: #selecciono ];
        openModal.

----
I've also found another way to show lists, using GridMorph instead of the current PluggableMultiColumnList, sadly it look really hard and lot of refactor should be done :(
> * Block a father window when a child is made, so the father window can't
> be closed if a child window exist.

childerWindow openModal: fatherWindow





Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

Sean P. DeNigris
Administrator
J. P. L. Martín wrote
I've replaced "builder openModal: dialog" with "World openModal: dialog"
Note that in 2.0, it's even easier: "dialog openModal"
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: We would love some help

Miguel Moquillon
In reply to this post by Paul DeBruicker
In fact, the one-way hash functions (MD5, SHA-1, SHA-256/512, ...) are
not for password encryption, they are for computing a digest of messages
in order to ensure their integrity. These functions usually suffer of
recognizability and of computing speed and hence they cannot be used to
encrypt passwords.

To encrypt passwords, some features are added to these well-known hash
functions in order to generate more entropy in the computing of the
digest: salting and stretching. For example, the algorithms used in the
Unix systems are variations of MD5 and of SHA-256/512 using these two
techniques.
In another way, in effect, there is a family of cryptographic algorithms
that is more suited to encrypt the passwords: the adaptive key
derivation functions in which we can find bcrypt but also PBKDF2 and
scrypt. (OpenBSD, an operating system obsessed with security, uses
bcrypt as its default authentication mechanism).

Beside the cryptographic functions for passwords, there is also some
recommendations to follow. Among them:
- prefer passphrases to passwords: the user can more easily remember
them and they add inherently more of entropy,
- for each authentication failure, multiply by 2 or more the time
between two retries.

Miguel

Le 02/02/2013 18:33, Paul DeBruicker a écrit :

> I guess it depends on the cost to you or your organization of having
> someone you don't want/know getting access to information that should be
> password protected.
>
> A thorough argument for bcrypt rather than md5/SHA is made here:
>
> http://codahale.com/how-to-safely-store-a-password/
>
>
> I use it because for roughly the same number of lines of code passwords
> are much harder to crack.
>
>
>
> On 02/02/2013 09:02 AM, Benjamin wrote:
>> Why not just something like
>>
>> | password cryptedPassword |
>>
>> password := UITheme current passwordEntryIn: World text: 'Password'
>> title: 'Title' entryText: ''.
>> cryptedPassword := MD5 new initialize hashStream: password readStream
>>
>> ?
>>
>>
>> Ben
>>
>> On Feb 2, 2013, at 5:06 PM, Paul DeBruicker <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>> For an example of the login process using Pharo + Seaside see
>>>
>>> http://www.squeaksource.com/TFLogin
>>>
>>> Which you can probably adapt for just Pharo
>>>
>>>
>>> To store the passwords, if you're on linux, use the bcrypt
>>> implementation in the PasswordHashingFFI package from here:
>>>
>>> http://www.squeaksource.com/Cryptography.html
>>>
>>> I'd be interested in getting PasswordHashingFFI working on Windows or
>>> MacOSX so would help if I can.  But using it makes your implementation
>>> depend upon an external library you'd likely have to find and supply for
>>> users.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 02/01/2013 03:36 PM, J. P. L. Martín wrote:
>>>> Hello people, I'm making a Practical Work in Pharo with my classmates,
>>>> the Work should be a fully working application to manage a University
>>>> Library. At the moment we have most of the work done, I must say it's
>>>> messy and far from being beautiful, but it works and it's likely to be
>>>> approved. Here is what's done so far:
>>>> https://github.com/arguser/Paradigmas-Final
>>>>
>>>> Most of the work was doing making research and guided mostly y examples,
>>>> so far I didn't find how to do or make work some features:
>>>> * A Dialog which prompts for User and Password (We don't know how to
>>>> implement it in-code either)
>>>> * Block a father window when a child is made, so the father window can't
>>>> be closed if a child window exist.
>>>> * Make some content of windows change size dynamically.
>>>> * Search only for filled-in fields from search form.
>>>>
>>>> If any advice or example can be given addressing the previous matters it
>>>> will be really helpful.
>>>>
>>>> Thanks in advance!
>>>>
>>>>
>>>
>


--