mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
fix referral credits session bug
This commit is contained in:
parent
fde7975f73
commit
2a70635d48
2 changed files with 12 additions and 14 deletions
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -10,11 +10,6 @@
|
|||
<?php echo View::render('download/_betaNotice') ?>
|
||||
<h4>{{download.verb}}</h4>
|
||||
<?php echo $downloadHtml ?>
|
||||
<h4>{{download.credits}}</h4>
|
||||
<?php if ($prefineryUser): ?>
|
||||
<p>{{download.email1}}<strong><?php echo $prefineryUser['email'] ?></strong>{{download.email2}}</p>
|
||||
<div class="meta">{{download.email3}}</div>
|
||||
<?php endif ?>
|
||||
<?php else: ?>
|
||||
<?php echo View::render('download/_unavailable', [
|
||||
'os' => $os
|
||||
|
|
Loading…
Add table
Reference in a new issue