By Simon Logan on Friday, 17 November 2017
Posted in Technical Issues
Replies 21
Likes 0
Views 600
Votes 0
On our site most pages work okay in terms of people trying to access a restricted page, being redirected to the login page, then being redirected back to the originally requested page after a successful login, however this doesn't seem to work for any Easyblog pages?

What happens is that they try to access a secure blog post such as https://www.delta-ee.com/delta-ee-blog/new-gas-heating-service-market-insights-now-available.html is that they are taken to the error page but the error code is being shown as a 404 rather than a 403. When they click on the login link the redirection to the original page no longer works.

How can we get it so that users can attempt to access a secure post, then login and are immediately returned back to the page?
Hey there,

Can you please edit your first post at the top and include the following access please?

- Site Admin access (Please ensure that the user has super admin access)

- FTP access (We need this because if we use a file manager in Joomla, there are times where we have a typo and this might eventually break your entire back end and front end for instance if we are editing a system plugin). There is no way to save the site unless we have the ftp access.
·
Saturday, 18 November 2017 17:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Ooops, added this info a few days ago but forgot to post to tell you I'd done so!
·
Wednesday, 22 November 2017 19:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Simon,

When a user / bot cannot access a page, it is ideal to render a 404 page as this would then tell the search engines that these pages shouldn't be crawled publicly.

The problem is when it is being triggered as a 404 error, it does not handle the redirection as the error page comes from the Joomla template. I noticed that on the error page, there is a login button, http://take.ms/NI93r . What you could do is to pass the return parameter for the login url so that Joomla will know how to redirect upon successful login.
·
Wednesday, 22 November 2017 21:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

Thanks for this - I guess I'm not clear still on why Easyblog's behaviour is different than Joomla default pages as the Joomla ones work much more smoothly in terms of allowing users to easily access the content. If they're logged in they go straight to the page, if not then they login and are then taken to the page.

With EB posts if they aren't logged in then they are just refused access to the post. we added the login button to the error page to allow people to login but this loses the redirection. Whilst your suggestion might work (am I able to grab the return parameter from that error page, is that information available to it?) I just wondered if it would be possible to have EB return a 403 rather than 404 error (I think EasyDiscuss has a setting to do this for similar reasons?) as this would cut out extra steps for the users and ensure the EB pages behave more like other pages.

The indexing issue is less of an issue as bots might index the page but not the content - to us it's more important that users trying to access this content can do so easily?
·
Wednesday, 22 November 2017 22:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

I have consulted this with our developer and will consider to add this feature on our future release. I have logged this issues internally. Thanks for your understanding.
·
Thursday, 23 November 2017 13:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Just to follow up on this as I've been in communication with Carsten who develops the "redirect on login" plugin and I think the problem is that Easyblog returns a 404 rather than a 403 error. I realise you are considering adding some manner of dealing with this to a future release but in the meantime is there a way for me to override this behaviour, even if it means having to do it in such a way as to mean I will need to reapply after an upgrade?

Either to return a 403 and redirect to the login page as other extensions do or, as you suggest, to grab and encode the return URL so it can be passed to the login page?
·
Monday, 04 December 2017 21:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Simon,

We have already added this feature internally for 5.2. At the mean time, what you can do is to download the attached file and upload the files into the following locations (the ftp access you provided doesn't work for me)

view.html.php -> /components/com_easyblog/views/entry/
easyblog.php -> /administrator/components/com_easyblog/includes/
·
Monday, 04 December 2017 21:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Mark that's great, will give it a go now to see how it does. Do I simply need to upload the files or is there a new config item to set as well?
·
Monday, 04 December 2017 21:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Simon,

I have modified the codes a little so that there isn't any configuration there since you want to apply this
·
Monday, 04 December 2017 21:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

tried this now (downloaded the files, then uploaded to the directories on live site, then tried to access the page again but got the same as before. Not sure if I've missed anything? I've changed the FTP access details and confirmed they work in case it's easier for you to look/check.

I think ideally what we need is for anyone trying to access a secured blog post to be taken to https://www.delta-ee.com/login (with the encoded return URL the "login to access this page" message displayed.
·
Monday, 04 December 2017 22:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Simon,

When I tried to access https://www.delta-ee.com/delta-ee-blog/new-gas-heating-service-market-insights-now-available.html it does redirect me to https://www.delta-ee.com/login?return=aHR0cHM6Ly93d3cuZGVsdGEtZWUuY29....

Is this not working for you? Anyhow, I have applied some other changes again, can you test this again?
·
Monday, 04 December 2017 22:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Tried again now so I get taken to the login page with the redirect URL but upon login I am simply kept on the login page rather than being taken back to the original page (though I can see the encoded URL in the address bar).

The impression I got from Carsten who does the Redirect On Login plugin is that his plugin looks for a system message since there is no "access denied" event he can hook into. So I wonder, unless you can see anything else, if the issue is just that we need a system message to be supplied to the login page? (Waiting to hear back from him about this).

A regular joomla page (which enacts the redirection page to the original page perfectly) displays the system message "Please login first".
·
Monday, 04 December 2017 22:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Simon,

The patch that I added adds a return=xxx (base64 value) in the query string which lets Joomla know that it should redirect to that page upon successful login.
·
Monday, 04 December 2017 23:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark

Yeah I saw that part of it, the issue is that the site still isn't redirecting away from the login page afterwards (https://www.screencast.com/t/XdEfMjc80). The first in that screencast is a regular page, works as expected, second is an Edocman link and third is an Easyblog link, both of those have encoded URLs which aren't then redirected to.

The fact that Edocman does the same thing makes me wonder if it's the ROL plugin that's not functioning properly. As mentioned Carsten does say that the plugin works by looking for the "plese login first" system message which doesn't appear in the Easyblog page just now (but doesn't work in the Edocman work either!)
·
Monday, 04 December 2017 23:59
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Simon,

Hm, I am wondering if that plugin is actually causing the redirection to not occur. By default, when a query string contains the "return=" in the URL, it would then redirect the user (This is the case with the core Joomla authentication)

Could you try disabling the plugin (that is performing these redirection) and see if Joomla redirects correctly? I believe Docman is probably doing the same too
·
Tuesday, 05 December 2017 01:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Just tested and with it disabled I am instead redirected to https://www.delta-ee.com/view-your-user-details.html
·
Tuesday, 05 December 2017 01:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, I can't figure out what's wrong with your site but I am pretty sure something is redirecting the request. Here's one example of the return behavior,

This will redirect to the calendar view:

http://easyblog.stackideas.com/index.php?option=com_users&view=login&return=aHR0cDovL2Vhc3libG9nLnN0YWNraWRlYXMuY29tL2NhbGVuZGFy


This will redirect to the blogger view:

http://easyblog.stackideas.com/index.php?option=com_users&view=login&aHR0cDovL2Vhc3libG9nLnN0YWNraWRlYXMuY29tL2Jsb2dnZXI=

You can test this with the user demo / password
·
Tuesday, 05 December 2017 01:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Mark, will follow this up with Carsten and see what can be done.
·
Tuesday, 05 December 2017 20:43
·
0 Likes
·
0 Votes
·
0 Comments
·
No problem Simon Keep me updated on this as I am pretty curious too.
·
Tuesday, 05 December 2017 20:55
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post