ElkArte Community

Project Support => Support => Topic started by: shasha on June 22, 2015, 10:37:14 am

Title: Simple Portal Help
Post by: shasha on June 22, 2015, 10:37:14 am
Hello Mods,

You guys are the best.

I am using the simple portal addon on my forum. I set it as the frontpage.

The problem is, when users log into the forum, they get directed to my forum board. I do not want it like that. I would love them to remain on the simple portal page even after they have logged in.

Any help?

Title: Re: Simple Portal Help
Post by: Burke Knight on June 22, 2015, 10:53:27 am
Administration Center > SimplePortal > Configuration > General Settings

Disable Portal Redirection

QuoteIf this box is unchecked, users will be redirected to the portal after they login or logout. If this box is checked, then users will be redirected to the BoardIndex.

Would be better to ask questions about addons in their topics. :)
Title: Re: Simple Portal Help
Post by: shasha on June 22, 2015, 11:01:14 am
thanks @Burke Knight i did that but it keeps redirecting to other page.
Title: Re: Simple Portal Help
Post by: shasha on June 22, 2015, 11:14:07 am
@Burke Knight i just fixed it. funny thing though is that i had to unselect portal redirection. the reverse worked. lol

sorry for posting this here. didn't know there was addon support page.

You guys rock a million.
Title: Re: Simple Portal Help
Post by: emanuele on June 22, 2015, 11:17:42 am
That is slightly different, but should work the same:
Code: [Select]
$(document).ready(function() {
$('#top_section_notice input[type=submit]').click(function() {
var $form = $(this).closest('form'),
data = {};

$form.submit(function() {
$(this).find('input,select').each(function (index, value) {
var $val = $(value);
data[$val.attr('name')] = $val.val();
});

$.ajax({
type: 'POST',
url: $form.attr('action'),
data: data,
beforeSend: ajax_indicator(true)
})
.done(function(request) {
var $req = $(request);
if ($req.find('#frmLogin').length > 0)
{
document.open();
document.write(request);
document.close();
history.pushState(null, $req.attr('title'), $form.attr('action'));
}
else
location.reload(true);
})
.fail(function() {
window.location.href = $form.attr('action');
})
.always(function() {
ajax_indicator(false);
});

return false;
});
});
});
Adding it to... for example script_elk.js, the login should become "AJAX" and if successful the page will just reload without being redirected to "wrong" pages.
It's a bit tricky, but I guess it's allowed. :P
Title: Re: Simple Portal Help
Post by: Burke Knight on June 23, 2015, 11:10:16 am
Quote from: shasha – @Burke Knight i just fixed it. funny thing though is that i had to unselect portal redirection. the reverse worked. lol

sorry for posting this here. didn't know there was addon support page.

You guys rock a million.

If you wanted them redirected to the portal, as it says, need to uncheck it.
Checked, disables the redirect to portal, and sends to board index.
It's not reversed, if you had to uncheck to send to portal.