openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 083aacd5055ec4d4bd766cfb5d3b0022c2206f22
parent d69e8e8cde14d0ff953e891eb9e6c7d12ae584f4
Author: Jan Dankert <devnull@localhost>
Date:   Thu,  4 Jan 2018 22:53:53 +0100

Sicherheitsabfragen...

Diffstat:
modules/cms-core/action/WorkbenchAction.class.php | 42++++++++++++++++++++++++------------------
1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/modules/cms-core/action/WorkbenchAction.class.php b/modules/cms-core/action/WorkbenchAction.class.php @@ -49,24 +49,30 @@ class WorkbenchAction extends Action if ( $this->perspective == 'normal' ) { $project = Session::getProject(); - $rootFolder = new Folder( $project->getRootObjectId() ); - $rootFolder->load(); - $preselectedobjects[] = $rootFolder; - - if ( $conf['login']['start']['start_lastchanged_object'] ) - { - $user = Session::getUser(); - - $objectid = Value::getLastChangedObjectInProjectByUserId($project->projectid, $user->userid); - if ( Object::available($objectid)) - { - $object = new Object($objectid); - $object->load(); - - Logger::debug('preselecting object '.$objectid); - $preselectedobjects[] = $object; - } - } + if(!empty($project)){ + + $rootFolder = new Folder( $project->getRootObjectId() ); + $rootFolder->load(); + $preselectedobjects[] = $rootFolder; + + if ( $conf['login']['start']['start_lastchanged_object'] ) + { + $user = Session::getUser(); + if(!empty($user)){ + + $objectid = Value::getLastChangedObjectInProjectByUserId($project->projectid, $user->userid); + if ( Object::available($objectid)) + { + $object = new Object($objectid); + $object->load(); + + Logger::debug('preselecting object '.$objectid); + $preselectedobjects[] = $object; + } + } + + } + } } global $viewconfig;