Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Mailer plugin and site login

Mailer plugin and site login 4 months 3 weeks ago #25536

  • neil2482
  • neil2482's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Karma: -7
  • Thank you received: 0
Hi

I have Joomla 3.8 and JEM 2.2.3 installed with the mailer plugin active

Everything works great and notifications are sent as they should. The email notification sent will include a link such as this
www.north-halifax-taekwondo.co.uk/index....t-open-championships

JEM is included in am area whose access is controlled by an ACL. If the user clicks on the link and they are NOT logged into the site, they get a 404 error message. If they are logged in, they get to the event no problems.

How can I amend the link to just show the site name, i.e. www.north-halifax-taekwondo.co.uk . This will allow the user to log in and manually navigate to the event.

Alternativley, can it be set so that they go to a log in page then once logged in, are redirected to the event?

I would point out, im not too comp savey, i only know what i have read, so if i need to amend any coding, would it be possible to give me a step by step blow on how to do it please?

Thanks

Neil

Please Log in or Create an account to join the conversation.

Mailer plugin and site login 2 weeks 5 days ago #26114

I have this exact same issue - did you resolve the login aspect, I want the link to prompt for login and go to the event.

Please Log in or Create an account to join the conversation.

Mailer plugin and site login 2 weeks 5 days ago #26115

Sounds like a good idea to me.
Here is some information if someone want to take it further stackoverflow.com/questions/25659505/joo...back-in-custom-compo
I think a change to the event model will be required to check if error is caused by insufficient user permissions and then redirect to login page instead of throwing exception and 404 page.
The following user(s) said Thank You: david.obrien

Please Log in or Create an account to join the conversation.

Mailer plugin and site login 1 week 4 days ago #26137

I'm not a great developer, I'm looking at the options listed, and think this one would help:

$url = JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode('YOUR COMPONENT VIEW URL HERE')
$this->setRedirect($url);
return $this;

But which file should it go in?

Please Log in or Create an account to join the conversation.

Mailer plugin and site login 1 week 4 days ago #26138

david.obrien wrote: I'm not a great developer


Maybe I'm better than I thought :)

In httpdocs/components/com_jem/models/event.php (line 151) I changed it to:

if (empty($data)) {
$app =& JFactory::getApplication();
$app->redirect('index.php?option=com_users&view=login&return=' . base64_encode('index.php?option=com_jem&view=event&id='.$pk));
//throw new Exception(JText::_('COM_JEM_EVENT_ERROR_EVENT_NOT_FOUND'), 404);
}

And it appears to work a treat for me - any issues with what I have done?

Thanks,
David

Please Log in or Create an account to join the conversation.

Mailer plugin and site login 1 week 4 days ago #26142

That should work for most cases. Only one small issue I can see: $data can be empty due to user permissions or simply because event does not exist. If you direct user to login with redirect to the same non-existing event you may never get the actual 404. Solution: test if the user is already logged on before sending them to login page - if user is already logged on show the 404 error. To test create a URL with not existing event id.
The following user(s) said Thank You: david.obrien

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.230 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.

Follow us......