Update authentication to service provider

This commit is contained in:
Romain Neutron
2013-02-15 19:58:17 +01:00
parent 71027acdbf
commit 76413165ff
42 changed files with 275 additions and 295 deletions

View File

@@ -233,11 +233,16 @@ class User_Query implements User_QueryInterface
}
if ($this->only_templates === true) {
if (!$this->app['authentication']->getUser()) {
throw new InvalidArgumentException('Unable to load templates while disconnected');
}
$sql .= ' AND model_of = ' . $this->app['authentication']->getUser()->get_id();
} elseif ($this->include_templates === false) {
$sql .= ' AND model_of=0';
} else {
} elseif ($this->app['authentication']->getUser()) {
$sql .= ' AND (model_of=0 OR model_of = ' . $this->app['authentication']->getUser()->get_id() . ' ) ';
} else {
$sql .= ' AND model_of=0';
}
if ($this->activities) {