HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Login redirect question

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#103283 (In Topic #20225)
Avatar

Well-settled

Is there a way to automatically redirect users directly to a specific URL after they log in to my website?

Any help is always appreciated and thank you in advance,

LocalMc


Last edit: by Local Mc
Back to the top
 
Posted
Item has a rating of 5 (Liked by Local McLiked by Chris Graham)  
Rating:
#103298
Avatar

Community saint

I haven't tested this, so I'm not sure if this will work. You might be able to add a hidden form <input> line to the HTML login forms. I haven't checked all of the templates, but the two main templates for user logins would be BLOCK_SIDE_PERSONAL_STATS_NO.tpl and LOGIN_SCREEN.tpl. Adding something like this:

Code


<input name="redirect" type="hidden" value="http://www.yoursite.com/index.php?redirected=1">

inside the HTML <form> in those templates just might work. Just change the http://www.yoursite.com/index.php?redirected=1 part to be the URL to page you want members to be redirected to. You can probably omit the ?redirected=1 from the URL.

Be sure to add the new <input> near the bottom of the form, probably just above the </form> line. Keeping it near the bottom of the form should ensure it overrides any redirect parameter that gets inserted by ocPortal higher up in the form, as is the case with the LOGIN_SCREEN.tpl.  

Using the template editor for your theme in your site Admin Zone should allow you to make the edits without compromising the original files. Just be aware that any future bug fixes, updates, or upgrades to ocPortal or any addon related to logins (like the Facebook integration addon) could include changes or additions to the original templates. These changes or additions may be necessary to complete a login. Without them, that could cause your logins to become broken until you either integrate those changes into your override or you integrate your change (the added <input> line) into the new original templates.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: