Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/com_privacy/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public function display($cachable = false, $urlparams = array())
{
$view = $this->input->get('view', $this->default_view);

// Submitting information requests through the frontend is restricted to authenticated users at this time
if ($view === 'request' && JFactory::getUser()->guest)
// Submitting information requests and confirmation through the frontend is restricted to authenticated users at this time
if ((in_array($view, array('confirm', 'request'))) && JFactory::getUser()->guest)
{
$this->setRedirect(
JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode('index.php?option=com_privacy&view=request'), false)
JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode('index.php?option=com_privacy&view=' . $view), false)
);

return $this;
Expand Down
4 changes: 3 additions & 1 deletion components/com_privacy/models/confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public function confirmRequest($data)
{
// Get the form.
$form = $this->getForm();
$data['email'] = JStringPunycode::emailToPunycode($data['email']);

// Check for an error.
if ($form instanceof Exception)
Expand Down Expand Up @@ -59,6 +58,9 @@ public function confirmRequest($data)
return false;
}

// Get the user email address
$data['email'] = JFactory::getUser()->email;

// Search for the information request
/** @var PrivacyTableRequest $table */
$table = $this->getTable();
Expand Down
10 changes: 0 additions & 10 deletions components/com_privacy/models/forms/confirm.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset name="default" label="COM_PRIVACY_CONFIRM_REQUEST_FIELDSET_LABEL">
<field
name="email"
type="text"
label="JGLOBAL_EMAIL"
description="COM_PRIVACY_FIELD_CONFIRM_EMAIL_DESC"
validate="email"
required="true"
size="30"
/>

<field
name="confirm_token"
type="text"
Expand Down
10 changes: 0 additions & 10 deletions components/com_privacy/models/forms/request.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset name="default">
<field
name="email"
type="email"
label="JGLOBAL_EMAIL"
description="COM_PRIVACY_FIELD_CONFIRM_EMAIL_DESC"
validate="email"
required="true"
size="30"
/>

<field
name="request_type"
type="list"
Expand Down
6 changes: 4 additions & 2 deletions components/com_privacy/models/request.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public function createRequest($data)
}

// Get the form.
$form = $this->getForm();
$data['email'] = JStringPunycode::emailToPunycode($data['email']);
$form = $this->getForm();

// Check for an error.
if ($form instanceof Exception)
Expand Down Expand Up @@ -69,6 +68,9 @@ public function createRequest($data)
return false;
}

// Get the user email address
$data['email'] = JFactory::getUser()->email;

// Search for an open information request matching the email and type
$db = $this->getDbo();
$query = $db->getQuery(true)
Expand Down