Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Change the URL of user profile
Hey guys! I'm embedding vanillaforums into a website, and we have our own user profile. Page is setup with SSO/jsconnect and users get logged in automatically. The thing is that I want to link the user links (viewable in comments, discussions, etc.) to our websites profile page instead of their vanillaforums user profile.
Havent found a easy way to do this yet, does anyone have any pointers?
Thanks, and best regards.
0
Comments
See this
http://vanillaforums.org/profile.json/Xstasy
You would have to redirect the profile link then best use client side scripting to get the forum profile data.
grep is your friend.
Other useful stuff
http://vanillaforums.org/profile.json/discussions/Xstasy
http://vanillaforums.org/profile.json/comments/Xstasy
Very important
This data is not sanitized (especially discussion/comment Body) so don't treat as such. Strip tags or convert to html entities.
grep is your friend.
How would I redirect it when it's embedded? The same way it redirects to the dashboard maybe? Don't know if you fully understood my question. I want the user profile links generated by the forums to redirect to my website's internal profile. Not the data it self, even though it was nice to get those useful links, that way I would be able to implement some of that data into the internal profile.
Sorry yes i only answered part of your question.
UserUrl
is the function you need to to predefine.assuming the username are unique you could do something like so
create a file
conf/bootstrap.before.php
put in itYou need to change the actual Url to suit your needs.
grep is your friend.
Thanks a bunch, exactly what I was looking for! Only problem is that it opens in a new window (target _blank). It should redirect the current page (not the embedded iframe).
That just set the url not the anchor. You might try pre-defining
UserAnchor
this is the current exampleYou wan to remove the
Rel
option. Homework: you try.grep is your friend.
Sorry I reviewed you question. The reason for new window, is it should not be in the iframe, it is part of the embed code. There is method to switch it back then force to break out of the iframe (which would be on your side). I don't have time now to do the groundwork for you.
grep is your friend.
Changed the
return '<a href="'.htmlspecialchars(Url($UserUrl)).'"'.Attribute($Attributes).'>'.$Text.'</a>';
into
return '<a href="#"'.Attribute($Attributes).' onclick="parent.redirect(\''.$UserUrl.'\')">'.$Text.'</a>';
And removed rel, probably not the best solution, but it works.
why not do this dynamically with jquery an detection?
grep is your friend.
I realize this discussion is a bit old, but I though I'd share how I integrated SSO/jsconnect and external profiles.
1) Implement jsConnect as detailed by: https://blog.vanillaforums.com/jsconnect-technical-documentation/
2) In your applications sso authentication callback (authentication url), when constructing the JSON user resource, simply add an additional property 'Attributes' containing any user attributes you'd like stored in the Attributes column of User table.
3) Override the global UserUrl function in your plugin (we use 'profileUrl' attribute for our external profile URL. You can use whatever you wish.)
Note: If your site embeds Vanilla Forums, simply detect profile load inside frame and break out. (eg window.self !== window.top)
Google it if you don't know how.