mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Remove user variable assignment
This commit is contained in:
@@ -394,14 +394,13 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
{
|
||||
$dstatus = databox_status::getDisplayStatus($this->app);
|
||||
$sbas_id = $this->get_sbas_id();
|
||||
$user = $this->app['phraseanet.user'];
|
||||
|
||||
$status = '';
|
||||
|
||||
if (isset($dstatus[$sbas_id])) {
|
||||
foreach ($dstatus[$sbas_id] as $n => $statbit) {
|
||||
if ($statbit['printable'] == '0' &&
|
||||
!$user->ACL()->has_right_on_base($this->base_id, 'chgstatus')) {
|
||||
!$this->app['phraseanet.user']->ACL()->has_right_on_base($this->base_id, 'chgstatus')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -82,8 +82,6 @@ class record_exportElement extends record_adapter
|
||||
|
||||
$sbas_id = phrasea::sbasFromBas($this->app, $this->base_id);
|
||||
|
||||
$user = $this->app['phraseanet.user'];
|
||||
|
||||
$subdefgroups = $this->app['phraseanet.appbox']->get_databox($sbas_id)->get_subdef_structure();
|
||||
|
||||
$subdefs = array();
|
||||
@@ -101,17 +99,17 @@ class record_exportElement extends record_adapter
|
||||
'thumbnail' => true
|
||||
);
|
||||
|
||||
if ($user->ACL()->has_right_on_base($this->get_base_id(), 'candwnldhd')) {
|
||||
if ($this->app['phraseanet.user']->ACL()->has_right_on_base($this->get_base_id(), 'candwnldhd')) {
|
||||
$go_dl['document'] = true;
|
||||
}
|
||||
if ($user->ACL()->has_right_on_base($this->get_base_id(), 'candwnldpreview')) {
|
||||
if ($this->app['phraseanet.user']->ACL()->has_right_on_base($this->get_base_id(), 'candwnldpreview')) {
|
||||
$go_dl['preview'] = true;
|
||||
}
|
||||
if ($user->ACL()->has_hd_grant($this)) {
|
||||
if ($this->app['phraseanet.user']->ACL()->has_hd_grant($this)) {
|
||||
$go_dl['document'] = true;
|
||||
$go_dl['preview'] = true;
|
||||
}
|
||||
if ($user->ACL()->has_preview_grant($this)) {
|
||||
if ($this->app['phraseanet.user']->ACL()->has_preview_grant($this)) {
|
||||
$go_dl['preview'] = true;
|
||||
}
|
||||
|
||||
@@ -121,14 +119,14 @@ class record_exportElement extends record_adapter
|
||||
->who_have_right(array('order_master'))
|
||||
->execute()->get_results();
|
||||
|
||||
$go_cmd = (count($masters) > 0 && $user->ACL()->has_right_on_base($this->base_id, 'cancmd'));
|
||||
$go_cmd = (count($masters) > 0 && $this->app['phraseanet.user']->ACL()->has_right_on_base($this->base_id, 'cancmd'));
|
||||
|
||||
$orderable['document'] = false;
|
||||
$downloadable['document'] = false;
|
||||
|
||||
if (isset($sd['document']) && is_file($sd['document']->get_pathfile())) {
|
||||
if ($go_dl['document'] === true) {
|
||||
if ($user->ACL()->is_restricted_download($this->base_id)) {
|
||||
if ($this->app['phraseanet.user']->ACL()->is_restricted_download($this->base_id)) {
|
||||
$this->remain_hd --;
|
||||
if ($this->remain_hd >= 0)
|
||||
$downloadable['document'] = array(
|
||||
@@ -176,7 +174,7 @@ class record_exportElement extends record_adapter
|
||||
if (isset($sd[$name]) && is_file($sd[$name]->get_pathfile())) {
|
||||
if ($class == 'document') {
|
||||
|
||||
if ($user->ACL()->is_restricted_download($this->base_id)) {
|
||||
if ($this->app['phraseanet.user']->ACL()->is_restricted_download($this->base_id)) {
|
||||
$this->remain_hd --;
|
||||
if ($this->remain_hd >= 0)
|
||||
$downloadable[$name] = array(
|
||||
|
@@ -316,9 +316,7 @@ class record_preview extends record_adapter
|
||||
|
||||
$tab = array();
|
||||
|
||||
$user = $this->app['phraseanet.user'];
|
||||
|
||||
$report = $user->ACL()->has_right_on_base($this->get_base_id(), 'canreport');
|
||||
$report = $this->app['phraseanet.user']->ACL()->has_right_on_base($this->get_base_id(), 'canreport');
|
||||
|
||||
$connsbas = connection::getPDOConnection($this->app, $this->get_sbas_id());
|
||||
|
||||
@@ -330,7 +328,7 @@ class record_preview extends record_adapter
|
||||
|
||||
if ( ! $report) {
|
||||
$sql .= ' AND ((l.usrid = :usr_id AND l.site= :site) OR action="add")';
|
||||
$params[':usr_id'] = $user->get_id();
|
||||
$params[':usr_id'] = $this->app['phraseanet.user']->get_id();
|
||||
$params[':site'] = $this->app['phraseanet.registry']->get('GV_sit');
|
||||
}
|
||||
|
||||
@@ -401,8 +399,7 @@ class record_preview extends record_adapter
|
||||
return $this->view_popularity;
|
||||
}
|
||||
|
||||
$user = $this->app['phraseanet.user'];
|
||||
$report = $user->ACL()->has_right_on_base(
|
||||
$report = $this->app['phraseanet.user']->ACL()->has_right_on_base(
|
||||
$this->get_base_id(), 'canreport');
|
||||
|
||||
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
|
||||
@@ -491,8 +488,7 @@ class record_preview extends record_adapter
|
||||
return $this->refferer_popularity;
|
||||
}
|
||||
|
||||
$user = $this->app['phraseanet.user'];
|
||||
$report = $user->ACL()->has_right_on_base(
|
||||
$report = $this->app['phraseanet.user']->ACL()->has_right_on_base(
|
||||
$this->get_base_id(), 'canreport');
|
||||
|
||||
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
|
||||
@@ -566,14 +562,11 @@ class record_preview extends record_adapter
|
||||
*/
|
||||
public function get_download_popularity()
|
||||
{
|
||||
|
||||
if ( ! is_null($this->download_popularity)) {
|
||||
return $this->download_popularity;
|
||||
}
|
||||
|
||||
$user = $this->app['phraseanet.user'];
|
||||
$report = $user->ACL()->has_right_on_base(
|
||||
$this->get_base_id(), 'canreport');
|
||||
$report = $this->app['phraseanet.user']->ACL()->has_right_on_base($this->get_base_id(), 'canreport');
|
||||
|
||||
$ret = false;
|
||||
if ( ! $report && ! $this->app['phraseanet.registry']->get('GV_google_api')) {
|
||||
|
Reference in New Issue
Block a user