From 55727bd1a23af7737c22b7b5e847ff426cd6f835 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 20 Nov 2019 13:47:57 +0100 Subject: [PATCH] do not use $this->check_access() anymore --- views/bootstrap/class.Acl.php | 7 +- views/bootstrap/class.RoleMgr.php | 3 +- views/bootstrap/class.Tasks.php | 3 +- views/bootstrap/class.UserList.php | 3 +- views/bootstrap/class.UsrMgr.php | 12 +-- views/bootstrap/class.ViewDocument.php | 114 ++++++++++++------------- 6 files changed, 73 insertions(+), 69 deletions(-) diff --git a/views/bootstrap/class.Acl.php b/views/bootstrap/class.Acl.php index d20321f25..8ccd96601 100644 --- a/views/bootstrap/class.Acl.php +++ b/views/bootstrap/class.Acl.php @@ -133,6 +133,7 @@ $(document).ready( function() { $dms = $this->params['dms']; $user = $this->params['user']; $selrole = $this->params['selrole']; + $accessobject = $this->params['accessobject']; if($selrole) { $this->contentHeading(getMLText("role_info")); @@ -148,11 +149,11 @@ $(document).ready( function() { echo "
".htmlspecialchars($currUser->getComment()).""; echo ""; echo ""; - if($this->check_access(array('UsrMgr', 'RemoveUser'))) { + if($accessobject->check_view_access(array('UsrMgr', 'RemoveUser'))) { echo "
"; - if($this->check_access('UsrMgr')) + if($accessobject->check_view_access('UsrMgr')) echo "getID()."\"> "; - if($this->check_access('RemoveUser')) + if($accessobject->check_view_access('RemoveUser')) echo "getID()."\">"; echo "
"; } diff --git a/views/bootstrap/class.RoleMgr.php b/views/bootstrap/class.RoleMgr.php index 9011f70e4..15c797e89 100644 --- a/views/bootstrap/class.RoleMgr.php +++ b/views/bootstrap/class.RoleMgr.php @@ -73,6 +73,7 @@ $(document).ready( function() { $user = $this->params['user']; $selrole = $this->params['selrole']; $settings = $this->params['settings']; + $accessobject = $this->params['accessobject']; if($selrole) { $this->contentHeading(getMLText("role_info")); @@ -88,7 +89,7 @@ $(document).ready( function() { echo "
".htmlspecialchars($currUser->getComment()).""; echo ""; echo ""; - if($this->check_access(array('UsrMgr', 'RemoveUser'))) { + if($accessobject->check_view_access(array('UsrMgr', 'RemoveUser'))) { echo "
"; echo $this->html_link('UsrMgr', array('userid'=>$currUser->getID()), array(), '', false); echo $this->html_link('RemoveUser', array('userid'=>$currUser->getID()), array(), '', false); diff --git a/views/bootstrap/class.Tasks.php b/views/bootstrap/class.Tasks.php index 53c8c6656..7f85f7556 100644 --- a/views/bootstrap/class.Tasks.php +++ b/views/bootstrap/class.Tasks.php @@ -227,6 +227,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Bootstrap_Style { function menuTasks() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; + $accessobject = $this->params['accessobject']; $tasks = $this->__myTasks(); if(!$tasks) @@ -320,7 +321,7 @@ class SeedDMS_View_Tasks extends SeedDMS_Bootstrap_Style { $content .= " \n"; $content .= " \n"; } - if ($this->check_access('MyDocuments')) { + if ($accessobject->check_view_access('MyDocuments')) { $content .= "
  • \n"; $content .= "
  • ".getMLText("my_documents")."
  • \n"; } diff --git a/views/bootstrap/class.UserList.php b/views/bootstrap/class.UserList.php index 263922b07..e6dbb43fc 100644 --- a/views/bootstrap/class.UserList.php +++ b/views/bootstrap/class.UserList.php @@ -38,6 +38,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style { $httproot = $this->params['httproot']; $quota = $this->params['quota']; $pwdexpiration = $this->params['pwdexpiration']; + $accessobject = $this->params['accessobject']; $this->htmlStartPage(getMLText("admin_tools")); $this->globalNavigation(); @@ -104,7 +105,7 @@ class SeedDMS_View_UserList extends SeedDMS_Bootstrap_Style { } echo ""; echo ""; - if($this->check_access(array('UsrMgr', 'RemoveUser'))) { + if($accessobject->check_view_access(array('UsrMgr', 'RemoveUser'))) { echo "
    "; echo $this->html_link('UsrMgr', array('userid'=>$currUser->getID()), array(), '', false); echo $this->html_link('RemoveUser', array('userid'=>$currUser->getID()), array(), '', false); diff --git a/views/bootstrap/class.UsrMgr.php b/views/bootstrap/class.UsrMgr.php index 89f39d80b..5257c23c6 100644 --- a/views/bootstrap/class.UsrMgr.php +++ b/views/bootstrap/class.UsrMgr.php @@ -194,6 +194,7 @@ $(document).ready( function() { $quota = $this->params['quota']; $undeluserids = $this->params['undeluserids']; $enableemail = $this->params['enableemail']; + $accessobject = $this->params['accessobject']; if($seluser) { ?> @@ -205,7 +206,7 @@ $(document).ready( function() {
    contentContainerStart(); ?> -check_view_access($this, array('action'=>'form'))) { ?> +check_view_access($this, array('action'=>'form'))) { ?>
    getID()."\"" : "") ?>>
    diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 365b02065..e1c733b18 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -359,8 +359,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { if(!$showfullpreview) return; - $accessop = $this->params['accessobject']; - if($accessop->check_controller_access('ViewOnline', array('action'=>'version'))) { + $accessobject = $this->params['accessobject']; + if($accessobject->check_controller_access('ViewOnline', array('action'=>'version'))) { $latestContent = $this->callHook('documentLatestContent', $document); if($latestContent === null) $latestContent = $document->getLatestContent(); @@ -444,7 +444,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $user = $this->params['user']; $folder = $this->params['folder']; $document = $this->params['document']; - $accessop = $this->params['accessobject']; + $accessobject = $this->params['accessobject']; $viewonlinefiletypes = $this->params['viewonlinefiletypes']; $enableownerrevapp = $this->params['enableownerrevapp']; $enableownerreceipt = $this->params['enableownerreceipt']; @@ -535,7 +535,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { if(is_string($txt)) echo $txt; $this->documentInfos(); - if($accessop->check_controller_access('ViewOnline', array('action'=>'run'))) { + if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) { $this->preview(); } ?> @@ -614,11 +614,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { $previewer->createPreview($latestContent); if ($file_exists) { if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes))) { - if($accessop->check_controller_access('ViewOnline', array('action'=>'run'))) { + if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) { print "getVersion()."\">"; } } else { - if($accessop->check_controller_access('Download', array('action'=>'version'))) { + if($accessobject->check_controller_access('Download', array('action'=>'version'))) { print "getVersion()."\">"; } } @@ -629,7 +629,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; } if ($file_exists) { - if($accessop->check_controller_access('Download', array('action'=>'run')) || $accessop->check_controller_access('ViewOnline', array('action'=>'run'))) + if($accessobject->check_controller_access('Download', array('action'=>'run')) || $accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) print ""; } print "\n"; @@ -682,69 +682,69 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print ""; print "