Hi,
profile/edit action uses:
forward($owner->getUrl());
How can force that action to forward to another page?
In particular I have installed login_redirector, in order to send users to profile/edit after first login; then I would like to send them to a welcome page. So the custom forward is required only once.
I am quite noob, so don't be too cryptic :-)
Thanks,
Teo
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
Eg, for forwarding to Activity page:
RvR, without more clarification, it sounds like you're suggesting that Teo should edit that file directly to change it to the URL he wants. Is that what you're suggesting?
@Evan Winslow
Of course, I've meant pagehandler but not absolute URL. Thanks for correction
@Teo
Use the page handler name as registered by elgg_register_page_handler() instead of YOUR_LINK above.
Docs: http://docs.elgg.org/Tutorials/PageHandlers
Evan meant that you should never edit core files; Teo needs to create his own plugin that overrides the profile/edit action to change the forward address, or to hook into the forward hook and intercept it if coming from the forward/edit action.
Sure, via hook only ;)
Eg.,
And in my_theme/actions/profile/edit.php
kthx :)
Thanks for the replies. I know I don't have to modify core files, in fact I have copied alboorg theme and I am customizing it.
In my_theme/start.php I have added:
and in my_theme/actions/profile/edit.php I have copied original profile/edit.php and changed the original forward to:
It doesn't work and it send me to "forward($owner->getUrl());". What am I missing?
Tnx
@Teo All works for me (tried now)
1 - Check that your code was added between my_theme init function. Eg., for aaborg_theme is:
2 - Replace your theme at the bottom via Administration -> Plugins then Flush caches and check again
Thanks RvR now it works, it was outside the last } ... I have to clean the code :-)
Any idea how to trigger it only the first time the user edit its profile? as i wrote before, I am using login_redirector to sent new users to profile/edit on their first login. When the push save now they are forwarded to 'groups/all?filter=alpha'. The following times they edit their profile, I would like to send them to profile/$user. This is what I have tryed:
It seems that if(empty($user->last_login)) doesn't work, so I am always forwarded to $user->getUrl()
U need the user's GUID. See on set_last_login how it works
- Previous
- 1
- 2
- Next
You must log in to post replies.