IRC logs of #tryton for Friday, 2012-07-06

chat.freenode.net #tryton log beginning Fri Jul 6 00:00:01 CEST 2012
2012-07-06 00:21 <__efx__> hi there, somebody here ? I would like to connect to tryton using proteus with the set_trytond method (direct connection). I have a question regarding this method. Why no password is required to connect to tryton ? And how can I extract the encrypted password of a user using proteus because when I select a user and look at the password field I got only *
2012-07-06 00:29 <__efx__> Or how to check a user password in proteus when using direct connection to the server
2012-07-06 09:10 <__efx__> hello
2012-07-06 09:11 <__efx__> Somebody knows the detail on how password a stored in tryton. If I am not wrong it uses sha1 encryption right?
2012-07-06 09:28 <bechamel> __efx__: yes sha with a salt
2012-07-06 09:30 <__efx__> bechamel: thank you, and what is the salt, because I would like to add to config.set_trytond the need of the password. Because actually it can connect without password...
2012-07-06 09:33 <__efx__> the set_trytond function of proteus by the way
2012-07-06 09:44 <bechamel> __efx__: the corresponding code is in the get_login method in trytond/res/user.py
2012-07-06 09:46 <__efx__> bechamel : I was just looking at it, so I tried the same with proteus. When I get my user the salt is None so I simply hashed my password with the hashlib (as done in the get_login method) however when I made a : User.find([('login','=',MYLOGIN),('password','=',MYHASHEDPASS)]) I got no results..
2012-07-06 09:48 <__efx__> and without the password I got something. Furthermore I can not find the hashed password with proteus because it returns 'xxxxxxxx' in the password field
2012-07-06 09:50 <__efx__> ok the problem comes from the Salt because proteus returns None but in the database it is not None
2012-07-06 09:57 <bechamel> __efx__: I think you should call User.get_login instead of re-creating it
2012-07-06 09:59 <__efx__> bechamel: I changed in config.py of proteus at the line 194 the user_obj.search by user_obj.login
2012-07-06 10:00 <__efx__> bechamel: but I don't understand what the user is selected with the search method and disregards completely the password
2012-07-06 10:00 <__efx__> bechamel : does that make sense ?
2012-07-06 10:00 <__efx__> sorry it was *why instead of what
2012-07-06 10:01 <__efx__> bechamel : or is it an error ?
2012-07-06 10:03 <bechamel> __efx__: when you use set_trytond, you bypass the network and connect directly to to the python code, so no password is needed
2012-07-06 10:04 <bechamel> __efx__: " does that make sense ?" -> it depends of your use case :)
2012-07-06 10:05 <__efx__> bechamel: yes that's true
2012-07-06 10:06 <bechamel> __efx__: actually a good behaviour would be to cann user_obj.login if the password is not empty
2012-07-06 10:06 <bechamel> __efx__: like that we have both behaviours
2012-07-06 10:07 <__efx__> bechamel: yes I think that would be excellent. I can write a patch for that but I have still a question, when I use the get_login method with a bad password then it returns a 0 and proteus still managed to connect with that, but they are no user with id=0 in the database..
2012-07-06 10:07 <bechamel> s/cann/call/
2012-07-06 10:10 <bechamel> __efx__: actually user_id == 0 means root user, the one which bypass all access stuffs :)
2012-07-06 10:10 <bechamel> __efx__: so it's even worse
2012-07-06 10:11 <__efx__> bechamel: :), so if get_login returns 0 then we just have to set it to None
2012-07-06 10:11 <bechamel> __efx__: so, you must test that get_login returns an id > 0
2012-07-06 10:12 <bechamel> __efx__: yes, check for example in trytond/security.py
2012-07-06 10:12 <__efx__> I can directly check on the config.py of proteus
2012-07-06 10:14 <__efx__> Now I have the following behavior. If I use set_trytond without password the the search method is used if the password is set then the the login method is used and a test if the result of the login method is <=0 then the self.user is set to None
2012-07-06 10:14 <__efx__> *then the
2012-07-06 10:16 <bechamel> __efx__: sounds good
2012-07-06 10:17 <__efx__> bechamel : should I propose a patch for that ? And if yes where should I put it ?
2012-07-06 10:21 <pietervdr> pjstevns: Again I have difficulties with installing the account_nl module. Can I skype/email you?
2012-07-06 10:22 <bechamel> __efx__: create an issue on the bug tracker, and upload your patch on codereview, see http://code.google.com/p/tryton/wiki/HowtoContribute
2012-07-06 10:39 <__efx__> bechamel : ok I will do that this afternoon, thank you again
2012-07-06 14:11 -!- pietervdr(52ab65e9@gateway/web/freenode/ip.82.171.101.233) has left #tryton
2012-07-06 15:51 <pjstevns> ja, moment
2012-07-06 15:52 <pjstevns> wrong channel...
2012-07-06 15:52 -!- pjstevns(~pjstevns@nfg3.nfgs.net) has left #tryton
2012-07-06 17:03 <udono> nicoe: hi, do you know the revision of https://bitbucket.org/nicoe/hgreview which is able to apply http://codereview.tryton.org/241001/ ?
2012-07-06 17:06 <nicoe> udono: good question ;)
2012-07-06 17:06 <nicoe> udono: I'll work on that during my week-end
2012-07-06 17:07 <udono> nicoe: ok, thanks. So I'll just wait.
2012-07-06 18:38 <rhubner> hi nicoe
2012-07-06 18:39 <nicoe> rhubner: hi
2012-07-06 18:39 <nicoe> rhubner: I saw your email
2012-07-06 18:40 <rhubner> nicoe: I have to do a SQL query to get the dates in fields_view_get method and add the same "result"?
2012-07-06 18:40 <rhubner> nicoe: ok...
2012-07-06 18:40 <rhubner> nicoe: Did you understand my question on email?
2012-07-06 18:40 <rhubner> my questions*
2012-07-06 18:41 <nicoe> Yes
2012-07-06 18:42 <nicoe> For the question about how to get the data : in a previous email I explained that you have to set the correct date in the context and then trigger a read
2012-07-06 18:43 <nicoe> About how to get the dates ... I think you should do this somewhere else than in modelview
2012-07-06 18:44 <nicoe> probably add a method in ModelStorage or something like that
2012-07-06 18:44 <nicoe> I will investigate.
2012-07-06 18:46 <rhubner> nicoe: Ok... I will check the previous email...
2012-07-06 18:48 <rhubner> nicoe: I managed to make the widget appear in correct form... I dont know if I did the best way! But it worked...
2012-07-06 18:49 <nicoe> Great
2012-07-06 20:11 <gbisheimer> Hi
2012-07-06 20:11 <gbisheimer> Hello to all
2012-07-06 20:12 <gbisheimer> Anybody there?
2012-07-06 20:13 <gbisheimer> bye
2012-07-06 20:13 <udono> :-)
2012-07-06 21:12 -!- rhubner(~rhubner@177.40.67.34) has left #tryton

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!