I will remove the errors as soon as i get home. Do you think is this the
reason for the rising of the IS_STRONG() controls in the db.auth_user
update?.
Let me know if i need to post controls, views or models.
Thank you all , Richard and Massimo.
I am trying to study all the framework, looking for case studies, tutorial
but i think i am far to use the all potential of web2y. Hope to improve as
soon as possible.
Have a nice day
Il giorno sabato 13 ottobre 2012 16:42:26 UTC+2, Massimo Di Pierro ha
scritto:
>
> You do not need two decorators:
>
> @auth.requires_login()
> @auth.requires_membership('risorse_umane' or 'admin')
>
> auth.requires_membership also requires login.
> You cannot do
> @auth.requires_membership('risorse_umane' or 'admin')
> because that is the same as
> @auth.requires_membership('risorse_umane')
> since 'risorse_umane' evaluates to True.
>
> There may be something else going on.
>
>
>
> On Friday, 12 October 2012 10:04:35 UTC-5, piero crisci wrote:
>>
>> I tryed to find others with the same iusse problem without understand how
>> to solve the problems :(
>>
>> I set in the db.py the follow table
>>
>> ########################################
>> db.define_table('auth_user',
>> Field('username', type='string',
>> label=T('Username')),
>> Field('first_name', type='string',
>> label=T('First Name')),
>> Field('last_name', type='string',
>> label=T('Last Name')),
>> Field('email', type='string',
>> label=T('Email')),
>> Field('password', type='password',length=512,
>> readable=False,
>> label=T('Password')),
>> Field('created_on','datetime',default=request.now,
>> label=T('Created On'),writable=False,readable=False),
>> Field('modified_on','datetime',default=request.now,
>> label=T('Modified On'),writable=False,readable=False,
>> update=request.now),
>> Field('registration_key',default='',
>> writable=False,readable=False),
>> Field('reset_password_key',default='',
>> writable=False,readable=False),
>> Field('registration_id',default='',
>> writable=False,readable=False),
>> format='%(username)s',
>> migrate=settings.migrate)
>>
>>
>> db.auth_user.first_name.requires =
>> IS_NOT_EMPTY(error_message=auth.messages.is_empty)
>> db.auth_user.last_name.requires =
>> IS_NOT_EMPTY(error_message=auth.messages.is_empty)
>> #db.auth_user.password.requires = [ IS_STRONG(min=8,
>> number=1,special=1,error_message = "La password deve contenere almeno 8
>> Caratteri, un Numero, un Carattere Speciale, un carattere Maiuscolo"),
>> CRYPT(key=auth.settings.hmac_key)]
>> db.auth_user.password.requires= [*IS_STRONG(min=8),
>> CRYPT(auth.settings.hmac_key)*]
>>
>> db.auth_user.username.requires = IS_NOT_IN_DB(db, db.auth_user.username,
>> error_message = 'Username già censita')
>> db.auth_user.email.requires =
>> (IS_EMAIL(error_message=auth.messages.invalid_email),
>> IS_NOT_IN_DB(db,
>> db.auth_user.email,error_message = 'Email già censita'))
>> auth.define_tables(migrate = settings.migrate)
>>
>> I set in the default.py this def for manage the user changes .
>>
>> @auth.requires_login()
>> @auth.requires_membership('risorse_umane' or 'admin')
>> def anagrafica_utenti_db_manage():
>> form = SQLFORM.smartgrid(db.auth_user,onupdate=auth.archive)
>> return locals()
>>
>> When i try to modify the name or the surname the framework rise the
>> IS_STRONG control even if i don't touch the password string.
>> I am new with web2py and i want just to know if i need to create a form
>> to make the user changes or i can fix this problem using the smartgrid.
>> I also set the "Requires approval" for the new registration. How can i
>> delete the "Pending" in the registration key ? (I can t do it right now
>> because of the IS_STRONG control.
>> Thanks for help
>> And sorry for bother you
>>
>
--