我有我的web2py應用程序的工作登錄表單。web2py post登錄重定向
我不知道我改變了什麼,但登錄後執行應用程序返回我的無效功能默認/用戶信息。
我正在使用auth.settings.controller =「user」重定向到正確的控制器。現在它不起作用。
應用程序應該回到它來自的頁面。只有登錄用戶
解決此問題後,我正在安裝自己的SVN,但在那之前。 我真的不知道是什麼
我ALO使用auth.navbar()做
我考慮到身份驗證是{{=在全局 '權威性'()和 auth.navbar(分隔符= ( ' '' |', ''))}}
我的用戶CONTROLER user.py是
DEF用戶(): 形式= AUTH() 返回字典(形式=形式)
和我的user.py模型是
if(request.controller =='user'or request.controller =='school'or request.controller =='timetable'and request.cookies.has_key('mycookie' ): response.generic_patterns = ['*'] if request.is_local else [] database = request.cookies ['mycookie']。value baza = DAL('postgres:// postgres:postgres @ localhost /' +數據庫遷移= TRUE) 從gluon.tools導入郵件 AUTH =驗證(巴扎)
auth.settings.logout_next=URL('school','index?school=' + database)
auth.settings.registration_requires_approval = True
#auth.settings.reset_password_requires_verification = True
#auth.settings.login_after_registration = False
auth.settings.register_onaccept=lambda form: mail.send(to=['[email protected]'],
subject='web2py registration',
# If reply_to is omitted, then mail.settings.sender is used
reply_to='[email protected]le.com',
message='Kreiral se je nov uporabnik, ki ga je potrebno potrditi')
auth.settings.expiration = 3600
auth.define_tables()
mail=Mail()
auth.settings.mailer=mail
mail.settings.server='smtp.gmail.com:587'
mail.settings.sender='[email protected]'
mail.settings.login='[email protected]:xxx'
#auth.settings.registration_requires_verification = True
auth.messages.registration_pending = u'Registracija je v postopku odobritve. Ko bo vaš račun potrjen boste prejeli e-mail.'
auth.messages.invalid_login = 'Nepravilno geslo'
auth.messages.invalid_user = 'Uporabnik ne obstaja'
auth.settings.controller="user"
## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, etc.
## register with janrain.com, write your domain:api_key in private/janrain.key
from gluon.contrib.login_methods.rpx_account import use_janrain
use_janrain(auth,filename='private/janrain.key')
你可以顯示你的Auth設置代碼以及你的用戶控制器代碼?當您進入登錄頁面時,查詢字符串中的_next參數是什麼? – Anthony
如果我點擊取回密碼,我會收到一封錯誤地址的電子郵件。它試圖讓我在portalov_iurnik/default/user/reset_password/1346840165-f35f1af2-f1fb-45c1-afff-fb822c2cf35d它應該將我重定向到portalov_iurnik/user/user/reset_password/1346840165-f35f1af2-f1fb-45c1-afff-fb822c2cf35d 。它始終處於默認狀態。 如果我輸入網頁的URL,我應該把它重定向到/ portal_iurnik/default/user/etc – Yebach