Add getAuthenticator usage

Replace $app['authentication']->getUser() by $app->getAuthenticatedUser()
replace twig app['authentication'].getUser() with corresponding method
This commit is contained in:
Benoît Burnichon
2015-06-30 19:51:02 +02:00
parent 3804eb5408
commit 4880f2bf5a
113 changed files with 437 additions and 428 deletions

View File

@@ -57,26 +57,26 @@ class set_selection extends set_abstract
$sbas_id = $record->get_sbas_id();
$record_id = $record->get_record_id();
if (! $rights) {
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_hd_grant($record)) {
if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_hd_grant($record)) {
continue;
}
if ($this->app['acl']->get($this->app['authentication']->getUser())->has_preview_grant($record)) {
if ($this->app['acl']->get($this->app->getAuthenticatedUser())->has_preview_grant($record)) {
continue;
}
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_access_to_base($base_id)) {
if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_access_to_base($base_id)) {
$to_remove[] = $id;
continue;
}
} else {
foreach ($rights as $right) {
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_base($base_id, $right)) {
if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_base($base_id, $right)) {
$to_remove[] = $id;
continue;
}
}
foreach ($sbas_rights as $right) {
if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbas_id, $right)) {
if ( ! $this->app['acl']->get($this->app->getAuthenticatedUser())->has_right_on_sbas($sbas_id, $right)) {
$to_remove[] = $id;
continue;
}
@@ -88,8 +88,8 @@ class set_selection extends set_abstract
$sql = 'SELECT record_id
FROM record
WHERE ((status ^ ' . $this->app['acl']->get($this->app['authentication']->getUser())->get_mask_xor($base_id) . ')
& ' . $this->app['acl']->get($this->app['authentication']->getUser())->get_mask_and($base_id) . ')=0
WHERE ((status ^ ' . $this->app['acl']->get($this->app->getAuthenticatedUser())->get_mask_xor($base_id) . ')
& ' . $this->app['acl']->get($this->app->getAuthenticatedUser())->get_mask_and($base_id) . ')=0
AND record_id = :record_id';
$stmt = $connsbas->prepare($sql);