mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
Remove user variable assignment
This commit is contained in:
@@ -51,10 +51,6 @@ class databox_cgu
|
||||
{
|
||||
$terms = array();
|
||||
|
||||
if ( ! $home) {
|
||||
$user = $app['phraseanet.user'];
|
||||
}
|
||||
|
||||
foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
|
||||
try {
|
||||
$cgus = $databox->get_cgus();
|
||||
@@ -68,10 +64,10 @@ class databox_cgu
|
||||
$userValidation = true;
|
||||
|
||||
if ( ! $home) {
|
||||
if ( ! $user->ACL()->has_access_to_sbas($databox->get_sbas_id())) {
|
||||
if ( ! $app['phraseanet.user']->ACL()->has_access_to_sbas($databox->get_sbas_id())) {
|
||||
continue;
|
||||
}
|
||||
$userValidation = ($user->getPrefs('terms_of_use_' . $databox->get_sbas_id()) !== $update && trim($value) !== '');
|
||||
$userValidation = ($app['phraseanet.user']->getPrefs('terms_of_use_' . $databox->get_sbas_id()) !== $update && trim($value) !== '');
|
||||
}
|
||||
|
||||
if ($userValidation)
|
||||
|
@@ -125,9 +125,7 @@ class databox_status
|
||||
return self::$_statuses;
|
||||
}
|
||||
|
||||
$user = $app['phraseanet.user'];
|
||||
|
||||
$sbas_ids = $user->ACL()->get_granted_sbas();
|
||||
$sbas_ids = $app['phraseanet.user']->ACL()->get_granted_sbas();
|
||||
|
||||
$statuses = array();
|
||||
|
||||
@@ -146,11 +144,9 @@ class databox_status
|
||||
|
||||
public static function getSearchStatus(Application $app)
|
||||
{
|
||||
$user = $app['phraseanet.user'];
|
||||
|
||||
$statuses = array();
|
||||
|
||||
$sbas_ids = $user->ACL()->get_granted_sbas();
|
||||
$sbas_ids = $app['phraseanet.user']->ACL()->get_granted_sbas();
|
||||
|
||||
$see_all = array();
|
||||
|
||||
@@ -158,7 +154,7 @@ class databox_status
|
||||
$see_all[$databox->get_sbas_id()] = false;
|
||||
|
||||
foreach ($databox->get_collections() as $collection) {
|
||||
if ($user->ACL()->has_right_on_base($collection->get_base_id(), 'chgstatus')) {
|
||||
if ($app['phraseanet.user']->ACL()->has_right_on_base($collection->get_base_id(), 'chgstatus')) {
|
||||
$see_all[$databox->get_sbas_id()] = true;
|
||||
break;
|
||||
}
|
||||
@@ -176,8 +172,9 @@ class databox_status
|
||||
|
||||
$see_this = isset($see_all[$sbas_id]) ? $see_all[$sbas_id] : false;
|
||||
|
||||
if ($user->ACL()->has_right_on_sbas($sbas_id, 'bas_modify_struct'))
|
||||
if ($app['phraseanet.user']->ACL()->has_right_on_sbas($sbas_id, 'bas_modify_struct')) {
|
||||
$see_this = true;
|
||||
}
|
||||
|
||||
foreach ($status as $bit => $props) {
|
||||
|
||||
|
Reference in New Issue
Block a user