summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/ajax/email.php4
-rw-r--r--apps/files_sharing/ajax/getitem.php2
-rw-r--r--apps/files_sharing/ajax/getstatuses.php2
-rw-r--r--apps/files_sharing/ajax/setpermissions.php2
-rw-r--r--apps/files_sharing/ajax/share.php2
-rw-r--r--apps/files_sharing/ajax/toggleresharing.php2
-rw-r--r--apps/files_sharing/ajax/unshare.php2
-rw-r--r--apps/files_sharing/ajax/userautocomplete.php2
-rw-r--r--apps/files_sharing/appinfo/version2
-rw-r--r--apps/files_sharing/get.php1
-rw-r--r--apps/files_sharing/lib_share.php2
-rw-r--r--apps/files_sharing/list.php2
-rw-r--r--apps/files_sharing/sharedstorage.php68
13 files changed, 5 insertions, 88 deletions
diff --git a/apps/files_sharing/ajax/email.php b/apps/files_sharing/ajax/email.php
index e1dccb7d0fa..3026eb74675 100644
--- a/apps/files_sharing/ajax/email.php
+++ b/apps/files_sharing/ajax/email.php
@@ -10,6 +10,4 @@ $subject = $user.' shared a '.$type.' with you';
$link = $_POST['link'];
$text = $user.' shared the '.$type.' '.$_POST['file'].' with you. It is available for download here: '.$link;
$fromaddress = OCP\Config::getUserValue($user, 'settings', 'email', 'sharing-noreply@'.OCP\Util::getServerHost());
-OC_Mail::send($_POST['toaddress'], $_POST['toaddress'], $subject, $text, $fromaddress, $user);
-
-?>
+OCP\Util::sendMail($_POST['toaddress'], $_POST['toaddress'], $subject, $text, $fromaddress, $user);
diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php
index 94f0890d706..ff6c29b6a0a 100644
--- a/apps/files_sharing/ajax/getitem.php
+++ b/apps/files_sharing/ajax/getitem.php
@@ -64,5 +64,3 @@ while ($path != $userDirectory) {
}
OCP\JSON::success(array('data' => $item));
-
-?>
diff --git a/apps/files_sharing/ajax/getstatuses.php b/apps/files_sharing/ajax/getstatuses.php
index 488cab13bc9..1be4d9a0d9c 100644
--- a/apps/files_sharing/ajax/getstatuses.php
+++ b/apps/files_sharing/ajax/getstatuses.php
@@ -20,5 +20,3 @@ if ($rows = OC_Share::getMySharedItems()) {
}
OCP\JSON::success(array('data' => $items));
-
-?>
diff --git a/apps/files_sharing/ajax/setpermissions.php b/apps/files_sharing/ajax/setpermissions.php
index 31b7a3878ef..0a2cf78f765 100644
--- a/apps/files_sharing/ajax/setpermissions.php
+++ b/apps/files_sharing/ajax/setpermissions.php
@@ -10,5 +10,3 @@ $permissions = $_POST['permissions'];
OC_Share::setPermissions($source, $uid_shared_with, $permissions);
OCP\JSON::success();
-
-?>
diff --git a/apps/files_sharing/ajax/share.php b/apps/files_sharing/ajax/share.php
index f4f2172d251..3f224d1b67b 100644
--- a/apps/files_sharing/ajax/share.php
+++ b/apps/files_sharing/ajax/share.php
@@ -35,5 +35,3 @@ foreach ($sources as $source) {
}
}
}
-
-?>
diff --git a/apps/files_sharing/ajax/toggleresharing.php b/apps/files_sharing/ajax/toggleresharing.php
index 673f00c5d18..7da4fdfeea8 100644
--- a/apps/files_sharing/ajax/toggleresharing.php
+++ b/apps/files_sharing/ajax/toggleresharing.php
@@ -7,5 +7,3 @@ if ($_POST['resharing'] == true) {
} else {
OCP\Config::setAppValue('files_sharing', 'resharing', 'no');
}
-
-?>
diff --git a/apps/files_sharing/ajax/unshare.php b/apps/files_sharing/ajax/unshare.php
index 44ffdb1a5bc..02a59c4016b 100644
--- a/apps/files_sharing/ajax/unshare.php
+++ b/apps/files_sharing/ajax/unshare.php
@@ -9,5 +9,3 @@ $uid_shared_with = $_POST['uid_shared_with'];
OC_Share::unshare($source, $uid_shared_with);
OCP\JSON::success();
-
-?>
diff --git a/apps/files_sharing/ajax/userautocomplete.php b/apps/files_sharing/ajax/userautocomplete.php
index 0e1bf6d588e..388a4844b95 100644
--- a/apps/files_sharing/ajax/userautocomplete.php
+++ b/apps/files_sharing/ajax/userautocomplete.php
@@ -28,5 +28,3 @@ $users[] = "</optgroup>";
$groups[] = "</optgroup>";
$users = array_merge($users, $groups);
OCP\JSON::encodedPrint($users);
-
-?>
diff --git a/apps/files_sharing/appinfo/version b/apps/files_sharing/appinfo/version
index 7dff5b89211..f4778493c50 100644
--- a/apps/files_sharing/appinfo/version
+++ b/apps/files_sharing/appinfo/version
@@ -1 +1 @@
-0.2.1 \ No newline at end of file
+0.2.2 \ No newline at end of file
diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php
index 40a90a1530c..70a5162d382 100644
--- a/apps/files_sharing/get.php
+++ b/apps/files_sharing/get.php
@@ -86,4 +86,3 @@ if (isset($_GET['token']) && $source = OC_Share::getSource($_GET['token'])) {
$tmpl->printPage();
die();
}
-?>
diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php
index 6e092269250..0237acfc1ac 100644
--- a/apps/files_sharing/lib_share.php
+++ b/apps/files_sharing/lib_share.php
@@ -513,5 +513,3 @@ class OC_Share {
}
}
-
-?>
diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php
index 2fd24840d36..54704c942fd 100644
--- a/apps/files_sharing/list.php
+++ b/apps/files_sharing/list.php
@@ -33,5 +33,3 @@ OCP\Util::addscript("files_sharing", "list");
$tmpl = new OCP\Template("files_sharing", "list", "user");
$tmpl->assign("shared_items", OC_Share::getMySharedItems());
$tmpl->printPage();
-
-?>
diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php
index 4138fc2b399..fc0d272b54e 100644
--- a/apps/files_sharing/sharedstorage.php
+++ b/apps/files_sharing/sharedstorage.php
@@ -67,7 +67,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
public function rmdir($path) {
// The folder will be removed from the database, but won't be deleted from the owner's filesystem
OC_Share::unshareFromMySelf($this->datadir.$path);
- $this->clearFolderSizeCache($path);
}
public function opendir($path) {
@@ -190,7 +189,7 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
public function filesize($path) {
if ($path == "" || $path == "/" || $this->is_dir($path)) {
- return $this->getFolderSize($path);
+ return 0;
} else {
$source = $this->getSource($path);
if ($source) {
@@ -200,55 +199,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
}
}
- public function getFolderSize($path) {
- return 0; //depricated
- }
-
- private function calculateFolderSize($path) {
- if ($this->is_file($path)) {
- $path = dirname($path);
- }
- $size = 0;
- if ($dh = $this->opendir($path)) {
- while (($filename = readdir($dh)) !== false) {
- if ($filename != "." && $filename != "..") {
- $subFile = $path."/".$filename;
- if ($this->is_file($subFile)) {
- $size += $this->filesize($subFile);
- } else {
- $size += $this->getFolderSize($subFile);
- }
- }
- }
- if ($size > 0) {
- $dbpath = rtrim($this->datadir.$path, "/");
-// $query = OCP\DB::prepare("INSERT INTO *PREFIX*foldersize VALUES(?,?)");
-// $result = $query->execute(array($dbpath, $size));
- }
- }
- return $size;
- }
-
- private function clearFolderSizeCache($path) {
- $path = rtrim($path, "/");
- $path = preg_replace('{(/)\1+}', "/", $path);
- if ($this->is_file($path)) {
- $path = dirname($path);
- }
- $dbpath = rtrim($this->datadir.$path, "/");
-// $query = OCP\DB::prepare("DELETE FROM *PREFIX*/*foldersize*/ WHERE path = ?");
-// $result = $query->execute(array($dbpath));
- if ($path != "/" && $path != "") {
- $parts = explode("/", $path);
- $part = array_pop($parts);
- if (empty($part)) {
- array_pop($parts);
- }
- $parent = implode("/", $parts);
- $this->clearFolderSizeCache($parent);
- }
- }
-
public function is_readable($path) {
return true;
}
@@ -341,9 +291,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
OCP\Util::emitHook('OC_Filestorage_Shared', 'file_put_contents', $info);
$storage = OC_Filesystem::getStorage($source);
$result = $storage->file_put_contents($this->getInternalPath($source), $data);
- if ($result) {
- $this->clearFolderSizeCache($path);
- }
return $result;
}
}
@@ -365,7 +312,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
} else {
OC_Share::unshareFromMySelf($target);
}
- $this->clearFolderSizeCache($this->getInternalPath($target));
return true;
}
@@ -401,8 +347,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
} else {
OC_Share::setTarget($oldTarget, $newTarget);
}
- $this->clearFolderSizeCache($this->getInternalPath($oldTarget));
- $this->clearFolderSizeCache($this->getInternalPath($newTarget));
return true;
}
@@ -413,9 +357,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
if ($this->is_writable($path2)) {
$tmpFile = $this->toTmpFile($path1);
$result = $this->fromTmpFile($tmpFile, $path2);
- if ($result) {
- $this->clearFolderSizeCache($path2);
- }
return $result;
} else {
return false;
@@ -451,9 +392,6 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
if ($source) {
$storage = OC_Filesystem::getStorage($source);
$result = $storage->fromTmpFile($tmpFile, $this->getInternalPath($source));
- if ($result) {
- $this->clearFolderSizeCache($path);
- }
return $result;
}
} else {
@@ -472,7 +410,7 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
}
}
- public function hash($type, $path, $raw) {
+ public function hash($type, $path, $raw = false) {
$source = $this->getSource($path);
if ($source) {
$storage = OC_Filesystem::getStorage($source);
@@ -520,7 +458,7 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
$source = $this->getSource($path);
if ($source) {
$storage = OC_Filesystem::getStorage($source);
- return $storage->touch($this->getInternalPath($source),$time);
+ return $storage->touch($this->getInternalPath($source),$mtime);
}
}