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
|
@ -26,23 +26,26 @@ class DownloadActions extends Actions
|
||||||
|
|
||||||
if ($email)
|
if ($email)
|
||||||
{
|
{
|
||||||
$emailIsValid = filter_var($email, FILTER_VALIDATE_EMAIL);
|
if (filter_var($email, FILTER_VALIDATE_EMAIL))
|
||||||
|
|
||||||
if ($emailIsValid)
|
|
||||||
{
|
{
|
||||||
$user = Prefinery::findUser($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_PREFINERY_USER_ID);
|
||||||
Session::unsetKey(Session::KEY_DOWNLOAD_ALLOWED);
|
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))
|
if (!Session::get(Session::KEY_DOWNLOAD_ALLOWED))
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,11 +10,6 @@
|
||||||
<?php echo View::render('download/_betaNotice') ?>
|
<?php echo View::render('download/_betaNotice') ?>
|
||||||
<h4>{{download.verb}}</h4>
|
<h4>{{download.verb}}</h4>
|
||||||
<?php echo $downloadHtml ?>
|
<?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 else: ?>
|
||||||
<?php echo View::render('download/_unavailable', [
|
<?php echo View::render('download/_unavailable', [
|
||||||
'os' => $os
|
'os' => $os
|
||||||
|
|
Loading…
Add table
Reference in a new issue