diff --git a/controller/action/DownloadActions.class.php b/controller/action/DownloadActions.class.php index bf3c55fc..bf255604 100644 --- a/controller/action/DownloadActions.class.php +++ b/controller/action/DownloadActions.class.php @@ -23,26 +23,29 @@ class DownloadActions extends Actions { $email = static::param('e'); $user = []; - + if ($email) { - $emailIsValid = filter_var($email, FILTER_VALIDATE_EMAIL); - - if ($emailIsValid) + if (filter_var($email, FILTER_VALIDATE_EMAIL)) { $user = Prefinery::findUser($email); - if ($user) - { - static::setSessionVarsForPrefineryUser($user); - } } - if (!$emailIsValid || !$user) + if (!$user) { Session::unsetKey(Session::KEY_PREFINERY_USER_ID); Session::unsetKey(Session::KEY_DOWNLOAD_ALLOWED); } } + elseif (Session::get(Session::KEY_PREFINERY_USER_ID)) + { + $user = Prefinery::findUser(Session::get(Session::KEY_PREFINERY_USER_ID)); + } + + if ($user) + { + static::setSessionVarsForPrefineryUser($user); + } if (!Session::get(Session::KEY_DOWNLOAD_ALLOWED)) { diff --git a/view/template/download/getAllowed.php b/view/template/download/getAllowed.php index 0229b62f..1b3e4859 100644 --- a/view/template/download/getAllowed.php +++ b/view/template/download/getAllowed.php @@ -10,11 +10,6 @@
{{download.email1}}{{download.email2}}
- - $os