auth new user registration even after login

19 zobrazení
Přeskočit na první nepřečtenou zprávu

Kalpish Singhal

nepřečteno,
23. 11. 2015 20:38:4523.11.15
komu: web2py-users
I want my admin user group can only register new members and their password should be send to respective user mail id using auth_user table, how to do this when auth is logged in because no signup option is their after login in the menu?

Dave S

nepřečteno,
23. 11. 2015 20:54:1123.11.15
komu: web2py-users


On Monday, November 23, 2015 at 5:38:45 PM UTC-8, Kalpish Singhal wrote:
I want my admin user group can only register new members and their password should be send to respective user mail id using auth_user table, how to do this when auth is logged in because no signup option is their after login in the menu?


I'm a little bit confused by this ... who logs in and then doesn't have a signup option?

If the new user is logged in, do they need to be registered?   Or are they already registered which is required to login?

Is the flow below not what you are using?



new user attempts to access site
      |
      | not authorized triggers redirect
      v
new user fills in registration
      |
      |---------------------------> reg form records info, alerts admin   ----------|
      V                                                                             |
new user waits for email                                                            v
      :                                                                    admin approves registration
      :                                                                              |
      :<--------------------------- approval triggers email <------------------------|
      v
new user reads email
      |
      |
      v
new user uses password to login
      |
      |
      v
new user accesses site features

If you have another scenario, could you outline it a bit?  That will help us understand what you're trying to do.

Dave
/dps



黄祥

nepřečteno,
23. 11. 2015 21:22:2823.11.15
komu: web2py-users
i guess you have set :
step 1 :
auth.settings.actions_disabled = ['register']

step 2 set the callback :
def __after_insert_auth_user(f, id):
row = db(db.auth_user.id == id).select().first()
mail.send(mail.email, 'Login credential', 'Email : %s, Password : password' % (mail.email) )

db.auth_user._after_insert.append(__after_insert_auth_user)

step 3 input the auth_user table for new user manually, which is admin job with :
db.auth_user.insert(first_name = 'a', last_name = 'a', email = 'a...@a.com', password = db.auth_user.password.validate('password')[0] )

in step 3 you can use the cli or appadmin, or custom controller

best regards,
stifan
Odpovědět všem
Odpověď autorovi
Přeposlat
0 nových zpráv