diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/l10n/sq.js | 1 | ||||
-rw-r--r-- | lib/l10n/sq.json | 1 | ||||
-rw-r--r-- | lib/private/files/cache/updater.php | 16 | ||||
-rw-r--r-- | lib/private/files/objectstore/objectstorestorage.php | 4 | ||||
-rw-r--r-- | lib/private/files/view.php | 2 | ||||
-rw-r--r-- | lib/private/ocs/cloud.php | 46 | ||||
-rw-r--r-- | lib/private/setup/oci.php | 32 | ||||
-rw-r--r-- | lib/private/share/share.php | 4 |
8 files changed, 34 insertions, 72 deletions
diff --git a/lib/l10n/sq.js b/lib/l10n/sq.js index 39f17cb1e38..cd2cb4bff97 100644 --- a/lib/l10n/sq.js +++ b/lib/l10n/sq.js @@ -103,6 +103,7 @@ OC.L10N.register( "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "S’caktohet dot data e skadimit. Ndarjet s’mund të skadojnë më vonë se %s pasi të jenë ofruar", "Cannot set expiration date. Expiration date is in the past" : "S’caktohet dot data e skadimit. Data e skadimit bie në të kaluarën", "Cannot clear expiration date. Shares are required to have an expiration date." : "S’hiqet dot data e skadimit. Ndarjet lypse të kenë një datë skadimi.", + "Sharing failed, because the user %s is the original sharer" : "Ndarja dështoi, ngaqë përdoruesi %s është ai që e ndau fillimisht", "Sharing %s failed, because the permissions exceed permissions granted to %s" : "Ndarja e %s me të tjerët dështoi, ngaqë lejet tejkalojnë lejet e akorduara për %s", "Sharing %s failed, because resharing is not allowed" : "Ndarja e %s me të tjerët dështoi, ngaqë nuk lejohen rindarje", "Sharing %s failed, because the file could not be found in the file cache" : "Ndarja e %s me të tjerët dështoi, ngaqë kartela s’u gjet dot te fshehtina e kartelave", diff --git a/lib/l10n/sq.json b/lib/l10n/sq.json index a2cc01fb0ee..bd5cbf5d81a 100644 --- a/lib/l10n/sq.json +++ b/lib/l10n/sq.json @@ -101,6 +101,7 @@ "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "S’caktohet dot data e skadimit. Ndarjet s’mund të skadojnë më vonë se %s pasi të jenë ofruar", "Cannot set expiration date. Expiration date is in the past" : "S’caktohet dot data e skadimit. Data e skadimit bie në të kaluarën", "Cannot clear expiration date. Shares are required to have an expiration date." : "S’hiqet dot data e skadimit. Ndarjet lypse të kenë një datë skadimi.", + "Sharing failed, because the user %s is the original sharer" : "Ndarja dështoi, ngaqë përdoruesi %s është ai që e ndau fillimisht", "Sharing %s failed, because the permissions exceed permissions granted to %s" : "Ndarja e %s me të tjerët dështoi, ngaqë lejet tejkalojnë lejet e akorduara për %s", "Sharing %s failed, because resharing is not allowed" : "Ndarja e %s me të tjerët dështoi, ngaqë nuk lejohen rindarje", "Sharing %s failed, because the file could not be found in the file cache" : "Ndarja e %s me të tjerët dështoi, ngaqë kartela s’u gjet dot te fshehtina e kartelave", diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index 1e180e7993a..2de0c8fe067 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -171,13 +171,15 @@ class Updater { if ($sourceStorage && $targetStorage) { $targetCache = $targetStorage->getCache($sourceInternalPath); - if ($targetCache->inCache($targetInternalPath)) { - $targetCache->remove($targetInternalPath); - } - if ($sourceStorage === $targetStorage) { - $targetCache->move($sourceInternalPath, $targetInternalPath); - } else { - $targetCache->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath); + if ($sourceStorage->getCache($sourceInternalPath)->inCache($sourceInternalPath)) { + if ($targetCache->inCache($targetInternalPath)) { + $targetCache->remove($targetInternalPath); + } + if ($sourceStorage === $targetStorage) { + $targetCache->move($sourceInternalPath, $targetInternalPath); + } else { + $targetCache->moveFromCache($sourceStorage->getCache(), $sourceInternalPath, $targetInternalPath); + } } if (pathinfo($sourceInternalPath, PATHINFO_EXTENSION) !== pathinfo($targetInternalPath, PATHINFO_EXTENSION)) { diff --git a/lib/private/files/objectstore/objectstorestorage.php b/lib/private/files/objectstore/objectstorestorage.php index 40d52feb893..e108d7662d4 100644 --- a/lib/private/files/objectstore/objectstorestorage.php +++ b/lib/private/files/objectstore/objectstorestorage.php @@ -337,7 +337,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { 'size' => 0, 'mtime' => $mtime, 'storage_mtime' => $mtime, - 'permissions' => \OCP\Constants::PERMISSION_ALL, + 'permissions' => \OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, ); $fileId = $this->getCache()->put($path, $stat); try { @@ -362,7 +362,7 @@ class ObjectStoreStorage extends \OC\Files\Storage\Common { if (empty($stat)) { // create new file $stat = array( - 'permissions' => \OCP\Constants::PERMISSION_ALL, + 'permissions' => \OCP\Constants::PERMISSION_ALL - \OCP\Constants::PERMISSION_CREATE, ); } // update stat with new data diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 1353fac51ff..04932d69384 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -290,7 +290,7 @@ class View { $absolutePath = $this->getAbsolutePath($path); $mount = Filesystem::getMountManager()->find($absolutePath); if ($mount->getInternalPath($absolutePath) === '') { - return $this->removeMount($mount, $path); + return $this->removeMount($mount, $absolutePath); } if ($this->is_dir($path)) { return $this->basicOperation('rmdir', $path, array('delete')); diff --git a/lib/private/ocs/cloud.php b/lib/private/ocs/cloud.php index 8f4f1769e9c..441e53400a3 100644 --- a/lib/private/ocs/cloud.php +++ b/lib/private/ocs/cloud.php @@ -42,52 +42,6 @@ class OC_OCS_Cloud { return new OC_OCS_Result($result); } - /** - * gets user info - * - * exposes the quota of an user: - * <data> - * <quota> - * <free>1234</free> - * <used>4321</used> - * <total>5555</total> - * <ralative>0.78</ralative> - * </quota> - * </data> - * - * @param array $parameters should contain parameter 'userid' which identifies - * the user from whom the information will be returned - */ - public static function getUser($parameters) { - $return = array(); - // Check if they are viewing information on themselves - if($parameters['userid'] === OC_User::getUser()) { - // Self lookup - $storage = OC_Helper::getStorageInfo('/'); - $return['quota'] = array( - 'free' => $storage['free'], - 'used' => $storage['used'], - 'total' => $storage['total'], - 'relative' => $storage['relative'], - ); - } - if(OC_User::isAdminUser(OC_User::getUser()) - || OC_Subadmin::isUserAccessible(OC_User::getUser(), $parameters['userid'])) { - if(OC_User::userExists($parameters['userid'])) { - // Is an admin/subadmin so can see display name - $return['displayname'] = OC_User::getDisplayName($parameters['userid']); - } else { - return new OC_OCS_Result(null, 101); - } - } - if(count($return)) { - return new OC_OCS_Result($return); - } else { - // No permission to view this user data - return new OC_OCS_Result(null, 997); - } - } - public static function getCurrentUser() { $email=\OC::$server->getConfig()->getUserValue(OC_User::getUser(), 'settings', 'email', ''); $data = array( diff --git a/lib/private/setup/oci.php b/lib/private/setup/oci.php index 1e1eb1ff54e..c3f03567165 100644 --- a/lib/private/setup/oci.php +++ b/lib/private/setup/oci.php @@ -40,7 +40,7 @@ class OCI extends AbstractDatabase { // allow empty hostname for oracle $this->dbHost = $config['dbhost']; - \OC_Config::setValues([ + $this->config->setSystemValues([ 'dbhost' => $this->dbHost, 'dbtablespace' => $this->dbtablespace, ]); @@ -66,7 +66,7 @@ class OCI extends AbstractDatabase { } else { $easy_connect_string = '//'.$e_host.'/'.$e_dbname; } - \OCP\Util::writeLog('setup oracle', 'connect string: ' . $easy_connect_string, \OCP\Util::DEBUG); + $this->logger->debug('connect string: ' . $easy_connect_string, ['app' => 'setup.oci']); $connection = @oci_connect($this->dbUser, $this->dbPassword, $easy_connect_string); if(!$connection) { $errorMessage = $this->getLastError(); @@ -93,7 +93,7 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); } $result = oci_execute($stmt); if($result) { @@ -116,7 +116,7 @@ class OCI extends AbstractDatabase { } } - \OC_Config::setValues([ + $this->config->setSystemValues([ 'dbuser' => $this->dbUser, 'dbname' => $this->dbName, 'dbpassword' => $this->dbPassword, @@ -131,9 +131,9 @@ class OCI extends AbstractDatabase { oci_close($connection); // connect to the oracle database (schema=$this->dbuser) an check if the schema needs to be filled - $this->dbUser = \OC_Config::getValue('dbuser'); + $this->dbUser = $this->config->getSystemValue('dbuser'); //$this->dbname = \OC_Config::getValue('dbname'); - $this->dbPassword = \OC_Config::getValue('dbpassword'); + $this->dbPassword = $this->config->getSystemValue('dbpassword'); $e_host = addslashes($this->dbHost); $e_dbname = addslashes($this->dbName); @@ -155,7 +155,7 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning( $entry, ['app' => 'setup.oci']); } $result = oci_execute($stmt); @@ -178,14 +178,14 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); } oci_bind_by_name($stmt, ':un', $name); $result = oci_execute($stmt); if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); } if(! oci_fetch_row($stmt)) { @@ -196,7 +196,8 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); + } //oci_bind_by_name($stmt, ':un', $name); $result = oci_execute($stmt); @@ -204,7 +205,8 @@ class OCI extends AbstractDatabase { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s", name: %s, password: %s', array($query, $name, $password)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); + } } else { // change password of the existing role $query = "ALTER USER :un IDENTIFIED BY :pw"; @@ -212,7 +214,7 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); } oci_bind_by_name($stmt, ':un', $name); oci_bind_by_name($stmt, ':pw', $password); @@ -220,7 +222,7 @@ class OCI extends AbstractDatabase { if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); } } // grant necessary roles @@ -229,14 +231,14 @@ class OCI extends AbstractDatabase { if (!$stmt) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); } $result = oci_execute($stmt); if(!$result) { $entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />'; $entry .= $this->trans->t('Offending command was: "%s", name: %s, password: %s', array($query, $name, $password)) . '<br />'; - \OCP\Util::writeLog('setup.oci', $entry, \OCP\Util::WARN); + $this->logger->warning($entry, ['app' => 'setup.oci']); } } diff --git a/lib/private/share/share.php b/lib/private/share/share.php index f2ba33bd16b..b015d7738b5 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -2636,7 +2636,9 @@ class Share extends Constants { */ private static function isFileReachable($path, $ownerStorageId) { // if outside the home storage, file is always considered reachable - if (!(substr($ownerStorageId, 0, 6) === 'home::')) { + if (!(substr($ownerStorageId, 0, 6) === 'home::' || + substr($ownerStorageId, 0, 13) === 'object::user:' + )) { return true; } |