mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 22:13:13 +00:00
Add getAuthenticator usage
Replace $app['authentication']->getUser() by $app->getAuthenticatedUser() replace twig app['authentication'].getUser() with corresponding method
This commit is contained in:
@@ -814,14 +814,14 @@ class User_Query implements User_QueryInterface
|
||||
}
|
||||
|
||||
if ($this->only_templates === true) {
|
||||
if (!$this->app['authentication']->getUser()) {
|
||||
if (!$this->app->getAuthenticatedUser()) {
|
||||
throw new InvalidArgumentException('Unable to load templates while disconnected');
|
||||
}
|
||||
$sql .= ' AND model_of = ' . $this->app['authentication']->getUser()->getId();
|
||||
$sql .= ' AND model_of = ' . $this->app->getAuthenticatedUser()->getId();
|
||||
} elseif ($this->include_templates === false) {
|
||||
$sql .= ' AND model_of IS NULL';
|
||||
} elseif ($this->app['authentication']->getUser()) {
|
||||
$sql .= ' AND (model_of IS NULL OR model_of = ' . $this->app['authentication']->getUser()->getId() . ' ) ';
|
||||
} elseif ($this->app->getAuthenticatedUser()) {
|
||||
$sql .= ' AND (model_of IS NULL OR model_of = ' . $this->app->getAuthenticatedUser()->getId() . ' ) ';
|
||||
} else {
|
||||
$sql .= ' AND model_of IS NULL';
|
||||
}
|
||||
|
Reference in New Issue
Block a user