Re: [web2py] Re: password encrypt during insert

2013-05-08 Thread vikas gupta
i had forgotten to add [0], didnt help though. still got the same error login_bare worked though i could pass login and password and it validated the user for me... Does login_bare do anything with respect to the session or does it just validate the fact that the user exists and

Re: [web2py] Re: password encrypt during insert

2013-05-07 Thread 黄祥
please try this (please ensure that you have the empty db.auth_user): models/db_insert_auth_user.py if db(db.auth_user).isempty(): db.auth_user.bulk_insert([{'first_name' : 'Manager', 'last_name' : 'Manager', 'email' : 'mana...@gmail.com',

Re: [web2py] Re: password encrypt during insert

2013-05-07 Thread vikas gupta
something weird here, my messages arent getting reflected... trying again. this is what i get from the print statement: gluon.validators.LazyCrypt object at 0xac526eec the bulk insert was successful... i can see the records in the db. password is encrypted. -- --- You received this message

Re: [web2py] Re: password encrypt during insert

2013-05-07 Thread Massimo Di Pierro
I now see the problem: encpasswd=db.auth_user.password.validate(mypassword)[0] logger.debug(encrypted passwd - %s % encpasswd) should be encpasswd=db.auth_user.password.validate(mypassword)[0] logger.debug(encrypted passwd - %s % str(encpasswd)) because the encrypted password is not a string

Re: [web2py] Re: password encrypt during insert

2013-05-07 Thread vikas gupta
I tried that.. now the logger statement throws the same error: File /home/www-data/web2py/applications/trotez/controllers/default.py, line 185, in userRegister logger.debug(encrypted passwd - %s % str(encpasswd)) File /home/www-data/web2py/gluon/validators.py, line 2760, in __str__

Re: [web2py] Re: password encrypt during insert

2013-05-07 Thread Massimo Di Pierro
What is the un-encrypted password? I suspect, there is something in there which is not unicode. On Tuesday, 7 May 2013 09:01:53 UTC-5, vikas gupta wrote: I tried that.. now the logger statement throws the same error: File /home/www-data/web2py/applications/trotez/controllers/default.py,

Re: [web2py] Re: password encrypt during insert

2013-05-07 Thread vikas gupta
i havent specified unicode.. passwd is abc123 On Tuesday, May 7, 2013 10:02:07 PM UTC+5:30, Massimo Di Pierro wrote: What is the un-encrypted password? I suspect, there is something in there which is not unicode. On Tuesday, 7 May 2013 09:01:53 UTC-5, vikas gupta wrote: I tried that.. now

Re: [web2py] Re: password encrypt during insert

2013-05-07 Thread vikas gupta
another message disappeared... i think i clicked the wrong button, reply to author instead of post... sorry massimo, my messages might come to you as a PM. will be careful in future. I got the insert to work with this, I guess unicode is needed. db.auth_user.bulk_insert([{'first_name'

Re: [web2py] Re: password encrypt during insert

2013-05-06 Thread vikas gupta
I am trying this and I am getting errors: id=db.auth_user.insert( email=myemail, password=(db.auth_user.password.validate(mypassword)[0]), first_name=myname) I get this error: TypeError: character mapping must return integer, None or unicode File

Re: [web2py] Re: password encrypt during insert

2013-05-06 Thread 黄祥
please use ' for string data type e.g. db.auth_user.insert('email' : 'myem...@gmail.com', 'password' : db.auth_user.password.validate('mypassword')[0], 'first_name' : 'myname') best regards On Monday, May 6, 2013 1:11:02 PM UTC-4, vikas gupta wrote: I am trying this and I am getting errors:

Re: [web2py] Re: password encrypt during insert

2013-05-06 Thread vikas gupta
I tried this: id=db.auth_user.insert( 'email':myemail, 'password':(db.auth_user.password.validate(mypassword)[0]), 'first_name':myname) I get a syntax error at the first ':' myemail, mypassword and myname are string variables and are populated correctly. In my original statement, putting

Re: [web2py] Re: password encrypt during insert

2013-05-06 Thread Massimo Di Pierro
This is not valid pyhton syntax id=db.auth_user.insert(email=myemail, password=db.auth_user.password.validate(mypassword)[0], first_name=myname) or id=db.auth_user.insert( **{'email':myemail, 'password':(db.auth_user.password.validate(mypassword)[0]), 'first_name':myname}) On Monday, 6

Re: [web2py] Re: password encrypt during insert

2013-05-06 Thread vikas gupta
I tried this : id=db.auth_user.insert( **{'email':myemail, 'password':(db.auth_user.password.validate(mypassword)[0]), 'first_name':myname}) and still get the same error at this line: TypeError: character mapping must return integer, None or unicode I tried the bulk insert:

Re: [web2py] Re: password encrypt during insert

2013-05-06 Thread Massimo Di Pierro
Try print repr(db.auth_user.password.validate(mypassword)[0]) what do you get? On Monday, 6 May 2013 23:22:29 UTC-5, vikas gupta wrote: I tried this : id=db.auth_user.insert( **{'email':myemail, 'password':(db.auth_user.password.validate(mypassword)[0]), 'first_name':myname})

[web2py] Re: password encrypt during insert

2011-04-28 Thread salbefe
Hello, Yo can do this: db.auth_user.insert(first_name=...,last_name=...,email=...,password=db.auth_user.password.validate(myPassword)) On 28 abr, 08:36, 黄祥 steve.van.chris...@gmail.com wrote: hi, is there a way to input encrypted user password for the first time execution? i mean like

Re: [web2py] Re: password encrypt during insert

2011-04-28 Thread Stifan Kristi
hello, thank you so much for your pointer, salbefe. i can input the encrypted password but the result not like i've expected before. i mean there is an additional character on the field password. e.g. db.auth_user.bulk_insert([{'first_name' : 'a', 'last_name' :

[web2py] Re: password encrypt during insert

2011-04-28 Thread salbefe
I've been testing and I have the same problem as you. I tried with: CRYPT()('yourpassword')[0] that I found in other posts but it does not work too. I think that we are missing something or that is a bug; perhaps Maximo could help us. On 28 abr, 13:42, Stifan Kristi

Re: [web2py] Re: password encrypt during insert

2011-04-28 Thread Anthony
On Thursday, April 28, 2011 7:42:15 AM UTC-4, 黄祥 wrote: hello, thank you so much for your pointer, salbefe. i can input the encrypted password but the result not like i've expected before. i mean there is an additional character on the field password. e.g.

Re: [web2py] Re: password encrypt during insert

2011-04-28 Thread Stifan Kristi
thank you so much for your pointer, anthony, the encrypted password is without *|encrypted password|None.* i've compared with the manual that i put on the register form is same. (same password 'a' string) but, pardon there is strange behaviour during login, the user that i inserted via script

[web2py] Re: password encrypt during insert

2011-04-28 Thread salbefe
it works for me ! Thanks a lot On 28 abr, 17:02, Stifan Kristi steve.van.chris...@gmail.com wrote: thank you so much for your pointer, anthony, the encrypted password is without *|encrypted password|None.* i've compared with the manual that i put on the register form is same. (same password

Re: [web2py] Re: password encrypt during insert

2011-04-28 Thread Anthony
On Thursday, April 28, 2011 11:02:18 AM UTC-4, 黄祥 wrote: thank you so much for your pointer, anthony, the encrypted password is without *|encrypted password|None.* i've compared with the manual that i put on the register form is same. (same password 'a' string) but, pardon there is

[web2py] Re: password encrypt during insert

2011-04-28 Thread Massimo Di Pierro
Is it possible that db.auth_user.requires is not set or it is changed? On Apr 28, 10:02 am, Stifan Kristi steve.van.chris...@gmail.com wrote: thank you so much for your pointer, anthony, the encrypted password is without *|encrypted password|None.* i've compared with the manual that i put on

Re: [web2py] Re: password encrypt during insert

2011-04-28 Thread ron_m
email of a.a.com is not a valid email address according to your code. I am not sure if there is any validation during login

Re: [web2py] Re: password encrypt during insert

2011-04-28 Thread Stifan Kristi
yes, u right, ron, there is a mistaken on my field value, thanks for show me my wrong code, it's work right now. thank you all for your pointer. On Fri, Apr 29, 2011 at 12:10 AM, ron_m ron.mco...@gmail.com wrote: email of a.a.com is not a valid email address according to your code. I am not