summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rwxr-xr-xapps/files_external/lib/config.php37
-rw-r--r--apps/files_sharing/lib/cache.php6
-rw-r--r--apps/files_sharing/lib/helper.php4
-rw-r--r--apps/files_sharing/lib/share/file.php7
-rw-r--r--apps/files_sharing/lib/sharedstorage.php26
-rw-r--r--apps/files_sharing/lib/updater.php5
-rw-r--r--apps/user_ldap/l10n/ast.php2
7 files changed, 42 insertions, 45 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 99eca2f38cf..15fbda927e0 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -132,7 +132,7 @@ class OC_Mount_Config {
}
// Load system mount points
- $mountConfig = self::readData(false);
+ $mountConfig = self::readData();
if (isset($mountConfig[self::MOUNT_TYPE_GLOBAL])) {
foreach ($mountConfig[self::MOUNT_TYPE_GLOBAL] as $mountPoint => $options) {
$options['options'] = self::decryptPasswords($options['options']);
@@ -169,7 +169,7 @@ class OC_Mount_Config {
}
// Load personal mount points
- $mountConfig = self::readData(true);
+ $mountConfig = self::readData($user);
if (isset($mountConfig[self::MOUNT_TYPE_USER][$user])) {
foreach ($mountConfig[self::MOUNT_TYPE_USER][$user] as $mountPoint => $options) {
$options['options'] = self::decryptPasswords($options['options']);
@@ -233,7 +233,7 @@ class OC_Mount_Config {
* @return array
*/
public static function getSystemMountPoints() {
- $mountPoints = self::readData(false);
+ $mountPoints = self::readData();
$backends = self::getBackends();
$system = array();
if (isset($mountPoints[self::MOUNT_TYPE_GROUP])) {
@@ -306,7 +306,7 @@ class OC_Mount_Config {
* @return array
*/
public static function getPersonalMountPoints() {
- $mountPoints = self::readData(true);
+ $mountPoints = self::readData(OCP\User::getUser());
$backEnds = self::getBackends();
$uid = OCP\User::getUser();
$personal = array();
@@ -400,7 +400,7 @@ class OC_Mount_Config {
'options' => self::encryptPasswords($classOptions))
)
);
- $mountPoints = self::readData($isPersonal);
+ $mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL);
// Merge the new mount point into the current mount points
if (isset($mountPoints[$mountType])) {
if (isset($mountPoints[$mountType][$applicable])) {
@@ -412,7 +412,7 @@ class OC_Mount_Config {
} else {
$mountPoints[$mountType] = $mount;
}
- self::writeData($isPersonal, $mountPoints);
+ self::writeData($isPersonal ? OCP\User::getUser() : NULL, $mountPoints);
return self::getBackendStatus($class, $classOptions, $isPersonal);
}
@@ -434,7 +434,7 @@ class OC_Mount_Config {
} else {
$mountPoint = '/$user/files/'.ltrim($mountPoint, '/');
}
- $mountPoints = self::readData($isPersonal);
+ $mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL);
// Remove mount point
unset($mountPoints[$mountType][$applicable][$mountPoint]);
// Unset parent arrays if empty
@@ -444,20 +444,20 @@ class OC_Mount_Config {
unset($mountPoints[$mountType]);
}
}
- self::writeData($isPersonal, $mountPoints);
+ self::writeData($isPersonal ? OCP\User::getUser() : NULL, $mountPoints);
return true;
}
/**
* Read the mount points in the config file into an array
- * @param boolean $isPersonal Personal or system config file
+ * @param string|null $user If not null, personal for $user, otherwise system
* @return array
*/
- private static function readData($isPersonal) {
+ private static function readData($user = NULL) {
$parser = new \OC\ArrayParser();
- if ($isPersonal) {
- $phpFile = OC_User::getHome(OCP\User::getUser()).'/mount.php';
- $jsonFile = OC_User::getHome(OCP\User::getUser()).'/mount.json';
+ if (isset($user)) {
+ $phpFile = OC_User::getHome($user).'/mount.php';
+ $jsonFile = OC_User::getHome($user).'/mount.json';
} else {
$phpFile = OC::$SERVERROOT.'/config/mount.php';
$datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
@@ -479,13 +479,12 @@ class OC_Mount_Config {
/**
* Write the mount points to the config file
- * @param bool Personal or system config file
- * @param array Mount points
- * @param boolean $isPersonal
+ * @param string|null $user If not null, personal for $user, otherwise system
+ * @param array $data Mount points
*/
- private static function writeData($isPersonal, $data) {
- if ($isPersonal) {
- $file = OC_User::getHome(OCP\User::getUser()).'/mount.json';
+ private static function writeData($user, $data) {
+ if (isset($user)) {
+ $file = OC_User::getHome($user).'/mount.json';
} else {
$datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
$file = \OC_Config::getValue('mount_file', $datadir . '/mount.json');
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 1f316301c47..f74315c85f9 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -442,6 +442,9 @@ class Shared_Cache extends Cache {
}
}
+ /**
+ * @param integer $id
+ */
private function getShareById($id) {
$item = \OCP\Share::getItemSharedWithBySource('file', $id);
if ($item) {
@@ -454,6 +457,9 @@ class Shared_Cache extends Cache {
return null;
}
+ /**
+ * @param integer $id
+ */
private function getParentInfo($id) {
$sql = 'SELECT `parent`, `name` FROM `*PREFIX*filecache` WHERE `fileid` = ?';
$query = \OC_DB::prepare($sql);
diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/helper.php
index c7347539fcc..dd4056b48f1 100644
--- a/apps/files_sharing/lib/helper.php
+++ b/apps/files_sharing/lib/helper.php
@@ -79,7 +79,7 @@ class Helper {
* @param array $linkItem link item array
* @param string $password optional password
*
- * @return true if authorized, false otherwise
+ * @return boolean true if authorized, false otherwise
*/
public static function authenticate($linkItem, $password) {
if ($password !== null) {
@@ -125,7 +125,7 @@ class Helper {
$ids = array();
- while ($path !== '' && $path !== '.' && $path !== '/') {
+ while ($path !== dirname($path)) {
$info = $ownerView->getFileInfo($path);
if ($info instanceof \OC\Files\FileInfo) {
$ids[] = $info['fileid'];
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index a18137e65ba..9950b4d61fd 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -183,8 +183,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
return $source;
}
+ /**
+ * @param string $target
+ * @param string $mountPoint
+ * @param string $itemType
+ * @return array|false source item
+ */
public static function getSource($target, $mountPoint, $itemType) {
-
if ($itemType === 'folder') {
$source = \OCP\Share::getItemSharedWith('folder', $mountPoint, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
if ($source && $target !== '') {
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 4733dff3d14..d4a817fca34 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -102,14 +102,15 @@ class Shared extends \OC\Files\Storage\Common {
/**
* @brief Get the permissions granted for a shared file
* @param string Shared target file path
- * @return int CRUDS permissions granted or false if not found
+ * @return int CRUDS permissions granted
*/
public function getPermissions($target) {
- $source = $this->getFile($target);
- if ($source) {
- return $source['permissions'];
+ $permissions = $this->share['permissions'];
+ // part file are always have delete permissions
+ if (pathinfo($target, PATHINFO_EXTENSION) === 'part') {
+ $permissions |= \OCP\PERMISSION_DELETE;
}
- return false;
+ return $permissions;
}
public function mkdir($path) {
@@ -183,9 +184,6 @@ class Shared extends \OC\Files\Storage\Common {
}
public function isCreatable($path) {
- if ($path == '') {
- $path = $this->getMountPoint();
- }
return ($this->getPermissions($path) & \OCP\PERMISSION_CREATE);
}
@@ -194,23 +192,14 @@ class Shared extends \OC\Files\Storage\Common {
}
public function isUpdatable($path) {
- if ($path == '') {
- $path = $this->getMountPoint();
- }
return ($this->getPermissions($path) & \OCP\PERMISSION_UPDATE);
}
public function isDeletable($path) {
- if ($path == '') {
- $path = $this->getMountPoint();
- }
return ($this->getPermissions($path) & \OCP\PERMISSION_DELETE);
}
public function isSharable($path) {
- if ($path == '') {
- $path = $this->getMountPoint();
- }
return ($this->getPermissions($path) & \OCP\PERMISSION_SHARE);
}
@@ -454,9 +443,6 @@ class Shared extends \OC\Files\Storage\Common {
}
public function free_space($path) {
- if ($path == '') {
- $path = $this->getMountPoint();
- }
$source = $this->getSourcePath($path);
if ($source) {
list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source);
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php
index 249211c306d..49044383df5 100644
--- a/apps/files_sharing/lib/updater.php
+++ b/apps/files_sharing/lib/updater.php
@@ -38,14 +38,13 @@ class Shared_Updater {
\OC\Files\Filesystem::initMountPoints($user);
$view = new \OC\Files\View('/' . $user);
if ($view->file_exists($path)) {
- while ($path !== '/') {
+ while ($path !== dirname($path)) {
$etag = $view->getETag($path);
$view->putFileInfo($path, array('etag' => $etag));
$path = dirname($path);
}
} else {
- error_log("error!" . 'can not update etags on ' . $path . ' for user ' . $user);
- \OCP\Util::writeLog('files_sharing', 'can not update etags on ' . $path . ' for user ' . $user, \OCP\Util::ERROR);
+ \OCP\Util::writeLog('files_sharing', 'can not update etags on ' . $path . ' for user ' . $user . '. Path does not exists', \OCP\Util::DEBUG);
}
}
diff --git a/apps/user_ldap/l10n/ast.php b/apps/user_ldap/l10n/ast.php
index ceda5a9326d..ad37405ca70 100644
--- a/apps/user_ldap/l10n/ast.php
+++ b/apps/user_ldap/l10n/ast.php
@@ -17,6 +17,8 @@ $TRANSLATIONS = array(
"Configuration incomplete" => "Configuración incompleta",
"Select groups" => "Esbillar grupos",
"Select attributes" => "Esbillar atributos",
+"Connection test succeeded" => "Test de conexón esitosu",
+"Connection test failed" => "Falló'l test de conexón",
"_%s group found_::_%s groups found_" => array("%s grupu alcontráu","%s grupos alcontraos"),
"_%s user found_::_%s users found_" => array("%s usuariu alcontráu","%s usuarios alcontraos"),
"Could not find the desired feature" => "Nun pudo alcontrase la carauterística deseyada",