summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/lib/updater.php20
-rw-r--r--apps/files_trashbin/lib/trash.php18
-rw-r--r--apps/files_versions/lib/versions.php6
-rw-r--r--apps/user_ldap/group_ldap.php4
-rw-r--r--settings/js/apps.js8
5 files changed, 33 insertions, 23 deletions
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php
index 73e7808f24a..503aef68483 100644
--- a/apps/files_sharing/lib/updater.php
+++ b/apps/files_sharing/lib/updater.php
@@ -38,10 +38,12 @@ class Shared_Updater {
while (!empty($users)) {
$reshareUsers = array();
foreach ($users as $user) {
- $etag = \OC\Files\Filesystem::getETag('');
- \OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
- // Look for reshares
- $reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $info['fileid'], $user, true));
+ if ( $user !== $uidOwner ) {
+ $etag = \OC\Files\Filesystem::getETag('');
+ \OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
+ // Look for reshares
+ $reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $info['fileid'], $user, true));
+ }
}
$users = $reshareUsers;
}
@@ -88,10 +90,12 @@ class Shared_Updater {
while (!empty($users)) {
$reshareUsers = array();
foreach ($users as $user) {
- $etag = \OC\Files\Filesystem::getETag('');
- \OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
- // Look for reshares
- $reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $params['fileSource'], $user, true));
+ if ($user !== $uidOwner) {
+ $etag = \OC\Files\Filesystem::getETag('');
+ \OCP\Config::setUserValue($user, 'files_sharing', 'etag', $etag);
+ // Look for reshares
+ $reshareUsers = array_merge($reshareUsers, \OCP\Share::getUsersItemShared('file', $params['fileSource'], $user, true));
+ }
}
$users = $reshareUsers;
}
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 33abe608d8f..d68d157158b 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -64,7 +64,7 @@ class Trashbin {
$trashbinSize += self::copy_recursive($file_path, 'files_trashbin/files/'.$deleted.'.d'.$timestamp, $view);
if ( $view->file_exists('files_trashbin/files/'.$deleted.'.d'.$timestamp) ) {
- $query = \OC_DB::prepare("INSERT INTO *PREFIX*files_trash (`id`,`timestamp`,`location`,`type`,`mime`,`user`) VALUES (?,?,?,?,?,?)");
+ $query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`type`,`mime`,`user`) VALUES (?,?,?,?,?,?)");
$result = $query->execute(array($deleted, $timestamp, $location, $type, $mime, $user));
if ( !$result ) { // if file couldn't be added to the database than also don't store it in the trash bin.
$view->deleteAll('files_trashbin/files/'.$deleted.'.d'.$timestamp);
@@ -144,7 +144,7 @@ class Trashbin {
$trashbinSize = self::calculateSize(new \OC\Files\View('/'. $user.'/files_trashbin'));
}
if ( $timestamp ) {
- $query = \OC_DB::prepare('SELECT `location`,`type` FROM *PREFIX*files_trash'
+ $query = \OC_DB::prepare('SELECT `location`,`type` FROM `*PREFIX*files_trash`'
.' WHERE `user`=? AND `id`=? AND `timestamp`=?');
$result = $query->execute(array($user,$filename,$timestamp))->fetchAll();
if ( count($result) != 1 ) {
@@ -228,7 +228,7 @@ class Trashbin {
}
if ( $timestamp ) {
- $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE `user`=? AND `id`=? AND `timestamp`=?');
+ $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=? AND `id`=? AND `timestamp`=?');
$query->execute(array($user,$filename,$timestamp));
}
@@ -259,7 +259,7 @@ class Trashbin {
}
if ( $timestamp ) {
- $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE `user`=? AND `id`=? AND `timestamp`=?');
+ $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=? AND `id`=? AND `timestamp`=?');
$query->execute(array($user,$filename,$timestamp));
$file = $filename.'.d'.$timestamp;
} else {
@@ -344,7 +344,7 @@ class Trashbin {
$view = new \OC\Files\View('/'.$user);
$size = 0;
- $query = \OC_DB::prepare('SELECT `location`,`type`,`id`,`timestamp` FROM *PREFIX*files_trash WHERE `user`=?');
+ $query = \OC_DB::prepare('SELECT `location`,`type`,`id`,`timestamp` FROM `*PREFIX*files_trash` WHERE `user`=?');
$result = $query->execute(array($user))->fetchAll();
$retention_obligation = \OC_Config::getValue('trashbin_retention_obligation',
@@ -362,7 +362,7 @@ class Trashbin {
$availableSpace = $availableSpace + $size;
// if size limit for trash bin reached, delete oldest files in trash bin
if ($availableSpace < 0) {
- $query = \OC_DB::prepare('SELECT `location`,`type`,`id`,`timestamp` FROM *PREFIX*files_trash'
+ $query = \OC_DB::prepare('SELECT `location`,`type`,`id`,`timestamp` FROM `*PREFIX*files_trash`'
.' WHERE `user`=? ORDER BY `timestamp` ASC');
$result = $query->execute(array($user))->fetchAll();
$length = count($result);
@@ -490,7 +490,7 @@ class Trashbin {
* @return mixed trash bin size or false if no trash bin size is stored
*/
private static function getTrashbinSize($user) {
- $query = \OC_DB::prepare('SELECT `size` FROM *PREFIX*files_trashsize WHERE `user`=?');
+ $query = \OC_DB::prepare('SELECT `size` FROM `*PREFIX*files_trashsize` WHERE `user`=?');
$result = $query->execute(array($user))->fetchAll();
if ($result) {
@@ -507,9 +507,9 @@ class Trashbin {
*/
private static function setTrashbinSize($user, $size) {
if ( self::getTrashbinSize($user) === false) {
- $query = \OC_DB::prepare('INSERT INTO *PREFIX*files_trashsize (`size`, `user`) VALUES (?, ?)');
+ $query = \OC_DB::prepare('INSERT INTO `*PREFIX*files_trashsize` (`size`, `user`) VALUES (?, ?)');
}else {
- $query = \OC_DB::prepare('UPDATE *PREFIX*files_trashsize SET `size`=? WHERE `user`=?');
+ $query = \OC_DB::prepare('UPDATE `*PREFIX*files_trashsize` SET `size`=? WHERE `user`=?');
}
$query->execute(array($size, $user));
}
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 6da0e434541..5fc26fd090e 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -53,7 +53,7 @@ class Storage {
* @return mixed versions size or false if no versions size is stored
*/
private static function getVersionsSize($user) {
- $query = \OC_DB::prepare('SELECT `size` FROM *PREFIX*files_versions WHERE `user`=?');
+ $query = \OC_DB::prepare('SELECT `size` FROM `*PREFIX*files_versions` WHERE `user`=?');
$result = $query->execute(array($user))->fetchAll();
if ($result) {
@@ -70,9 +70,9 @@ class Storage {
*/
private static function setVersionsSize($user, $size) {
if ( self::getVersionsSize($user) === false) {
- $query = \OC_DB::prepare('INSERT INTO *PREFIX*files_versions (`size`, `user`) VALUES (?, ?)');
+ $query = \OC_DB::prepare('INSERT INTO `*PREFIX*files_versions` (`size`, `user`) VALUES (?, ?)');
}else {
- $query = \OC_DB::prepare('UPDATE *PREFIX*files_versions SET `size`=? WHERE `user`=?');
+ $query = \OC_DB::prepare('UPDATE `*PREFIX*files_versions` SET `size`=? WHERE `user`=?');
}
$query->execute(array($size, $user));
}
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php
index 3dbc5e7d895..ca5b3a35e5a 100644
--- a/apps/user_ldap/group_ldap.php
+++ b/apps/user_ldap/group_ldap.php
@@ -140,7 +140,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
return array();
}
if(!$this->groupExists($gid)) {
- return false;
+ return array();
}
$cachekey = 'usersInGroup-'.$gid.'-'.$search.'-'.$limit.'-'.$offset;
// check for cache of the exact query
@@ -221,7 +221,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
return array();
}
if(!$this->groupExists($gid)) {
- return false;
+ return array();
}
$users = $this->usersInGroup($gid, $search, $limit, $offset);
$displayNames = array();
diff --git a/settings/js/apps.js b/settings/js/apps.js
index 43013a9e1ec..dd20bc0a9c5 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -75,7 +75,13 @@ OC.Settings.Apps = OC.Settings.Apps || {
element.data('active',true);
element.val(t('settings','Disable'));
}
- },'json');
+ },'json')
+ .fail(function() {
+ OC.dialogs.alert('Error while enabling app','Error');
+ element.data('active',false);
+ OC.Settings.Apps.removeNavigation(appid);
+ element.val(t('settings','Enable'));
+ });
$('#leftcontent li[data-id="'+appid+'"]').addClass('active');
}
},