Get rid of session use in auto playlist

The user object was triggering the creation of a user context that tried to grab something from the session. The later code never tried to use this due to the checkPerm flag.

I'm assuming the user model used to have a sane constructor w/o side effects in the times where this code had it's heyday.
This commit is contained in:
Lucas Bickel 2017-03-22 12:26:18 +01:00
parent 934cad44b5
commit 1fc1e6a199
3 changed files with 16 additions and 16 deletions

View file

@ -1,6 +1,6 @@
<?php
class Application_Model_Scheduler
final class Application_Model_Scheduler
{
private $con;
private $fileInfo = array(
@ -23,7 +23,7 @@ class Application_Model_Scheduler
private $checkUserPermissions = true;
public function __construct()
public function __construct($checkUserPermissions=true)
{
$this->con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
@ -40,7 +40,11 @@ class Application_Model_Scheduler
$this->nowDT = DateTime::createFromFormat("U", time(), new DateTimeZone("UTC"));
}
$this->user = Application_Model_User::getCurrentUser();
$this->setCheckUserPermissions($checkUserPermissions);
if ($this->checkUserPermissions) {
$this->user = Application_Model_User::getCurrentUser();
}
$this->crossfadeDuration = Application_Model_Preference::GetDefaultCrossfadeDuration();
}