/** * get system wide path and detect mount points * * @param string $path * @return string */ protected function getPathToKeys($path) { list($owner, $relativePath) = $this->util->getUidAndFilename($path); $systemWideMountPoint = $this->util->isSystemWideMountPoint($relativePath, $owner); if ($systemWideMountPoint) { $systemPath = $this->keys_base_dir . $relativePath . '/'; } else { $systemPath = '/' . $owner . $this->keys_base_dir . $relativePath . '/'; } return $systemPath; }
/** * copy keys if a file was renamed * * @param string $source * @param string $target * @param string $owner * @param bool $systemWide */ public function copyKeys($source, $target) { list($owner, $source) = $this->util->getUidAndFilename($source); list(, $target) = $this->util->getUidAndFilename($target); $systemWide = $this->util->isSystemWideMountPoint($target); if ($systemWide) { $sourcePath = $this->keys_base_dir . $source . '/'; $targetPath = $this->keys_base_dir . $target . '/'; } else { $sourcePath = '/' . $owner . $this->keys_base_dir . $source . '/'; $targetPath = '/' . $owner . $this->keys_base_dir . $target . '/'; } if ($this->view->file_exists($sourcePath)) { $this->keySetPreparation(dirname($targetPath)); $this->view->copy($sourcePath, $targetPath); } }