This commit is contained in:
Victor Dubiniuk 2013-08-08 14:02:54 +03:00 коммит произвёл Tobias Hintze
Родитель 412d07dedc
Коммит 778378b570
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -20,7 +20,7 @@
<default></default>
<notnull>true</notnull>
<length>512</length>
<comments>Relative to storage e.g. /welcome.odt</comments>
<comments>Relative to owner office storage /welcome.odt</comments>
</field>
<field>
<name>genesis_hash</name>
@ -28,6 +28,14 @@
<notnull>true</notnull>
<comments>To be sure the genesis did not change</comments>
</field>
<field>
<name>document_path</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>512</length>
<comments>Relative to storage e.g. /welcome.odt</comments>
</field>
<field>
<name>owner</name>
<type>text</type>

Просмотреть файл

@ -34,8 +34,9 @@ class View extends \OC\Files\View{
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$newName = '/' . self::getHashByGenesis($uid, $path) . '.odt';
$view = new \OC\Files\View('/' . $uid);
$newName = '/' . sha1($view->file_get_contents('/files' . $path)) . '.odt';
$view->copy('/files' . $path, self::OFFICE_DIRNAME . $newName);
\OC_FileProxy::$enabled = $proxyStatus;
return $newName;