first check if folder has parent before accessing the parent

This commit is contained in:
Uwe Steinmann 2014-03-04 17:58:00 +01:00
parent fc6a034c2b
commit d3caff7cdc

View File

@ -145,6 +145,9 @@ if ($action == "setowner") {
$message = "ownership_changed_email_body";
$params = array();
$params['name'] = $folder->getName();
if($folder->getParent())
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
else
$params['folder_path'] = $folder->getFolderPathPlain();
$params['username'] = $user->getFullName();
$params['old_owner'] = $oldOwner->getFullName();
@ -189,7 +192,10 @@ else if ($action == "notinherit") {
$message = "access_permission_changed_email_body";
$params = array();
$params['name'] = $folder->getName();
if($folder->getParent())
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
else
$params['folder_path'] = $folder->getFolderPathPlain();
$params['username'] = $user->getFullName();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
$params['sitename'] = $settings->_siteName;
@ -222,6 +228,9 @@ else if ($action == "notinherit") {
$message = "access_permission_changed_email_body";
$params = array();
$params['name'] = $folder->getName();
if($folder->getParent())
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
else
$params['folder_path'] = $folder->getFolderPathPlain();
$params['username'] = $user->getFullName();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
@ -273,7 +282,10 @@ else if ($action == "inherit") {
$message = "access_permission_changed_email_body";
$params = array();
$params['name'] = $folder->getName();
if($folder->getParent())
$params['folder_path'] = $folder->getParent()->getFolderPathPlain();
else
$params['folder_path'] = $folder->getFolderPathPlain();
$params['username'] = $user->getFullName();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
$params['sitename'] = $settings->_siteName;