On Monday, 9 December 2013 21:42:46 UTC-6, Michel Hayek wrote:
>
> Sorry Dave if what i described is not clear.
>
> 1. After a successful register directly the code will perform an insert 
> into my second table, the issue here is i don't know where i place my 
> insert function, in which file and after which line.
>

auth.settings.register_onaccept = lambda form: do_your_insert()
 

> 2. When the admin is approving the registered user and he open the admin 
> page( (appadmin/update/db/auth_user/xxx)) clear the pending field and hits 
> the button submit, after that submit function is executed i need to place a 
> redirect function, so the admin will be redirected to another page (only on 
> approving the registered user)
>

You cannot change the behavior of admin but you can use
http://127.0.0.1:8000/yourapp/appadmin/manage/auth
to manage permissions etc.
In this case you can put in a model:

if request.controller=='appadmin' and request.function=='manage':
     db.auth_user._after_update.append(lambda qset, fields: not 
fields.get('registration_key',None) and do_something())

do_something() will be called every time the manager edit the record of a 
user (and the user is approved after the edit).

 

>
> Thanks
>
> On Monday, December 9, 2013 1:51:39 PM UTC-6, Michel Hayek wrote:
>>
>> I'm fairly new to web2py and i'm using the register & login forms from 
>> Web2PY. I was able to enable approval and send email for the admin. but i 
>> need to do 2 things
>>
>>
>>    1. Upon user successful register i need to insert into another table 
>>    (Users)
>>    2. After the Admin approve the User 
>>    (appadmin/update/db/auth_user/xxx) i need to redirect to another page
>>
>> Is it possible?
>>
>> Thanks
>>
>> *This e-mail is confidential and may also be privileged. If you are not 
>> the intended **recipient, please notify the sender immediately, delete 
>> it from your system and do **not copy, disseminate, distribute or 
>> disclose any information contained therein.*
>>
>
> *This e-mail is confidential and may also be privileged. If you are not 
> the intended **recipient, please notify the sender immediately, delete it 
> from your system and do **not copy, disseminate, distribute or disclose 
> any information contained therein.*
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to