summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjfd <jfd@lance>2012-08-25 03:13:59 +0200
committerjfd <jfd@lance>2012-08-25 03:13:59 +0200
commitdc3bec62113b39254c4488b0502d7852328fdc84 (patch)
treef2aaf10908d5d666d3b894befe6c02382f4f10d9
parente8ffd5c04249f84770e618eeb57f39c2e93afe35 (diff)
downloadnextcloud-server-dc3bec62113b39254c4488b0502d7852328fdc84.tar.gz
nextcloud-server-dc3bec62113b39254c4488b0502d7852328fdc84.zip
OC_Share no longer exists. remove hooks that would trigger require_once / autoloading failures, so i can at least upload files
-rw-r--r--apps/admin_audit/appinfo/app.php3
-rw-r--r--apps/admin_audit/lib/hooks_handlers.php3
-rw-r--r--apps/files_sharing/get.php2
-rw-r--r--apps/files_versions/lib/versions.php63
4 files changed, 41 insertions, 30 deletions
diff --git a/apps/admin_audit/appinfo/app.php b/apps/admin_audit/appinfo/app.php
index e52f633cf14..2cbed5bf572 100644
--- a/apps/admin_audit/appinfo/app.php
+++ b/apps/admin_audit/appinfo/app.php
@@ -13,6 +13,9 @@ OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_write, 'OC
OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_read, 'OC_Admin_Audit_Hooks_Handlers', 'read');
OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_delete, 'OC_Admin_Audit_Hooks_Handlers', 'delete');
+//FIXME OC_Share does no longer exist
+/*
OCP\Util::connectHook('OC_Share', 'public', 'OC_Admin_Audit_Hooks_Handlers', 'share_public');
OCP\Util::connectHook('OC_Share', 'public-download', 'OC_Admin_Audit_Hooks_Handlers', 'share_public_download');
OCP\Util::connectHook('OC_Share', 'user', 'OC_Admin_Audit_Hooks_Handlers', 'share_user');
+*/ \ No newline at end of file
diff --git a/apps/admin_audit/lib/hooks_handlers.php b/apps/admin_audit/lib/hooks_handlers.php
index c5aec97d939..17a553837da 100644
--- a/apps/admin_audit/lib/hooks_handlers.php
+++ b/apps/admin_audit/lib/hooks_handlers.php
@@ -63,7 +63,8 @@ class OC_Admin_Audit_Hooks_Handlers {
$permissions = $params['permissions'];
$with = $params['with'];
$user = OCP\User::getUser();
- $rw = $permissions & OC_Share::WRITE ? 'w' : 'o';
+ //$rw = $permissions & OC_Share::WRITE ? 'w' : 'o'; //FIXME OC_Share no longer exists, hack to check permissions
+ $rw = $permissions & 1 ? 'w' : 'o';
self::log('Shared "'.$path.'" (r'.$rw.') with user "'.$with.'" by '.$user);
}
static protected function log($msg) {
diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php
index 1d219719b2d..bcbe5985fb6 100644
--- a/apps/files_sharing/get.php
+++ b/apps/files_sharing/get.php
@@ -4,6 +4,7 @@ $RUNTIME_APPTYPES=array('authentication');
OC_App::loadApps($RUNTIME_APPTYPES);
OCP\JSON::checkAppEnabled('files_sharing');
+//FIXME lib_share / OC_Share no longer exists
require_once 'lib_share.php';
//get the path of the shared file
@@ -75,6 +76,7 @@ if (isset($_GET['token']) && $source = OC_Share::getSource($_GET['token'])) {
header("Content-Length: " . OC_Filesystem::filesize($source));
//download the file
@ob_clean();
+ //FIXME OC_Share no longer exists
OCP\Util::emitHook('OC_Share', 'public-download', array('source'=>$source, 'token'=>$token));
OC_Filesystem::readfile($source);
}
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index f146676757d..30f0b93a7ff 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -64,14 +64,15 @@ class Storage {
$files_view = \OCP\Files::getStorage("files");
$users_view = \OCP\Files::getStorage("files_versions");
$users_view->chroot(\OCP\User::getUser().'/');
-
- if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
- $pos = strpos($source, '/files', 1);
- $uid = substr($source, 1, $pos - 1);
- $filename = substr($source, $pos + 6);
- } else {
+
+ //FIXME OC_Share no longer exists
+ //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
+ // $pos = strpos($source, '/files', 1);
+ // $uid = substr($source, 1, $pos - 1);
+ // $filename = substr($source, $pos + 6);
+ //} else {
$uid = \OCP\User::getUser();
- }
+ //}
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory') . $this->view->getAbsolutePath('');
@@ -134,13 +135,14 @@ class Storage {
$users_view = \OCP\Files::getStorage("files_versions");
$users_view->chroot(\OCP\User::getUser().'/');
- if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
- $pos = strpos($source, '/files', 1);
- $uid = substr($source, 1, $pos - 1);
- $filename = substr($source, $pos + 6);
- } else {
+ //FIXME OC_Share no longer exists
+ //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
+ // $pos = strpos($source, '/files', 1);
+ // $uid = substr($source, 1, $pos - 1);
+ // $filename = substr($source, $pos + 6);
+ //} else {
$uid = \OCP\User::getUser();
- }
+ //}
// rollback
if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
@@ -163,10 +165,11 @@ class Storage {
public static function isversioned($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions_fileview = \OCP\Files::getStorage("files_versions");
- if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
- $pos = strpos($source, '/files', 1);
- $filename = substr($source, $pos + 6);
- }
+ //FIXME OC_Share no longer exists
+ //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
+ // $pos = strpos($source, '/files', 1);
+ // $filename = substr($source, $pos + 6);
+ //}
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath('');
@@ -194,13 +197,14 @@ class Storage {
if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
- if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
- $pos = strpos($source, '/files', 1);
- $uid = substr($source, 1, $pos - 1);
- $filename = substr($source, $pos + 6);
- } else {
+ //FIXME OC_Share no longer exists
+ //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
+ // $pos = strpos($source, '/files', 1);
+ // $uid = substr($source, 1, $pos - 1);
+ // $filename = substr($source, $pos + 6);
+ //} else {
$uid = \OCP\User::getUser();
- }
+ //}
$versions_fileview = \OCP\Files::getStorage('files_versions');
$versionsFolderName = \OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath('');
$versions = array();
@@ -267,13 +271,14 @@ class Storage {
public static function expire($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
- $pos = strpos($source, '/files', 1);
- $uid = substr($source, 1, $pos - 1);
- $filename = substr($source, $pos + 6);
- } else {
+ //FIXME OC_Share no longer exists
+ //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) {
+ // $pos = strpos($source, '/files', 1);
+ // $uid = substr($source, 1, $pos - 1);
+ // $filename = substr($source, $pos + 6);
+ //} else {
$uid = \OCP\User::getUser();
- }
+ //}
$versions_fileview = \OCP\Files::getStorage("files_versions");
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath('');