-
- 358 Posts
Bullat, the problem occurs when MODx tries to display the edit page *after* logout. If the user is still on the edit page when logging off, he/she must be directed to another page, otherwise this error occurs.
Think some kind of fix is needed in the snippet.
-
- 98 Posts
Uncle68, thanks for the explanation. I’ll try to figure out how to redirect back to previous page to prevent the error. Thanks again. Much appreciated.
Why isn’t the profile editing page assigned to a document group that is associated with the web group a user accessing their profile for editing would belong to? Then on logout the user would automatically be sent to the "unauthorized" page, usually the home page. And/or the weblogin snippet should have a "logouthomeid" value set so the user is automatically sent to that page on logout. A non-logged in user should not be able to access the profile editing page at all.
-
- 98 Posts
Susan: Thanks so much for your clear and detailed reply. Although I have my "Edit your Profile" link hidden until a user has logged in, I hadn’t yet set up a document group for registered users! So I did that and added the &logouthomeid parameter and I’m all set and works fine. You have no idea how useful an answer like yours is to all we noobs. Thanks again.
Uncle68: In the slim chance that you don’t know this...
1) Went to Manager > Security > Web Permissions and created a Document Group for registered user pages. I attached that to my Registered User Group.
2) Edited my "Edit your Profile" page (under Access Permissions at the very bottom of the page) to check the box next to my new document group.
3) Added the parameter &logouthomeid=`1` to my WebLogin snippet call in my template.
4) Then let out a Woot! because it works fine now.
However, it is a bug in the WebEditProfile snippet not to check for that and redirect somewhere, by default to the home page but with an option to specify where to send a non-logged-in user if he does somehow end up on the page. I’ll have to do something about it.
Updated: Version 1.3 - added redirect for non-logged-in users. For this redirect to work, the page the snippet is called in must be uncached.
The profile editing page should still be protected by a document group that only logged-in users have access to.
http://modxcms.com/Web-Edit-Profile-Snippet-1.0-990.html
-
- 98 Posts
Susan, could you post the old v1.2 snippet here or add it to the "previous versions" in the repository? I was too eager and didn’t save a copy when upgrading to v1.3. I know, mortal sin. v1.3 doesn’t work properly for my circumstances and I need to go back to the v1.2. I have a tiny login box (called in template to display on every page) and the user doesn’t see the "Edit your Profile" until logged in. It didn’t matter with v1.2 whether a page was cached or not and worked fine. Could someone post the v1.2 here or in repository? Thanks.
EDIT: Okay, I did save a copy, thank goodness. But you might consider adding the old version to the "previous versions" in the repository. Thanks for a great snippet, Susan.