成员登录后,自动重定向到个人主文件夹

成员登录后,自动重定向到个人主文件夹
After login you want authenticated users to be directed straight to their folders. Normally, after login, the users are redirected to the where ever they wanted to go in the first place.

Solution :

The file that controls what happens after a user logs in is the file CMFPlone/skins/plone_login/login_next.cpy. So customize this file and edit it.

Basically what is happening here is, login_next.cpy will look for a variable called came_from. If the came_from variable is set, then it will redirect the user to whatever came_from is set as. At this point I knew what I had to do, the challenge was to find the right methods to achieve what I want. I needed the method to tell me what is the authenticated user's home folder. After some digging around I found it.

Just add this line to the login_next.cpy, somewhere at line 25 :

home_url = membership_tool.getAuthenticatedMember().getHomeFolder().absolute_url()
came_from = home_url

设置