aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/app.php34
-rw-r--r--lib/base.php7
-rw-r--r--lib/connector/sabre/directory.php2
-rw-r--r--lib/connector/sabre/file.php8
-rw-r--r--lib/files/cache/scanner.php18
-rw-r--r--lib/files/filesystem.php4
-rw-r--r--lib/files/mapper.php12
-rw-r--r--lib/files/storage/common.php23
-rw-r--r--lib/files/storage/local.php2
-rw-r--r--lib/files/storage/temporary.php1
-rw-r--r--lib/filesystem.php4
-rw-r--r--lib/helper.php5
-rw-r--r--lib/l10n.php2
-rw-r--r--lib/l10n/bg_BG.php1
-rw-r--r--lib/l10n/ca.php2
-rw-r--r--lib/l10n/cs_CZ.php2
-rw-r--r--lib/l10n/es.php2
-rw-r--r--lib/l10n/fi_FI.php1
-rw-r--r--lib/l10n/fr.php2
-rw-r--r--lib/l10n/it.php2
-rw-r--r--lib/l10n/lv.php2
-rw-r--r--lib/l10n/pt_PT.php2
-rw-r--r--lib/l10n/vi.php1
-rw-r--r--lib/l10n/zh_TW.php2
-rw-r--r--lib/mimetypes.list.php2
-rw-r--r--lib/ocs/cloud.php2
-rw-r--r--lib/user.php12
-rwxr-xr-xlib/util.php15
28 files changed, 135 insertions, 37 deletions
diff --git a/lib/app.php b/lib/app.php
index 3a4e21e8cd1..bf7eeef0181 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -39,6 +39,15 @@ class OC_App{
static private $altLogin = array();
/**
+ * @brief clean the appid
+ * @param $app Appid that needs to be cleaned
+ * @return string
+ */
+ public static function cleanAppId($app) {
+ return str_replace(array('\0', '/', '\\', '..'), '', $app);
+ }
+
+ /**
* @brief loads all apps
* @param array $types
* @return bool
@@ -286,6 +295,23 @@ class OC_App{
}
/**
+ * @brief Get the navigation entries for the $app
+ * @param string $app app
+ * @return array of the $data added with addNavigationEntry
+ */
+ public static function getAppNavigationEntries($app) {
+ if(is_file(self::getAppPath($app).'/appinfo/app.php')) {
+ $save = self::$navigation;
+ self::$navigation = array();
+ require $app.'/appinfo/app.php';
+ $app_entries = self::$navigation;
+ self::$navigation = $save;
+ return $app_entries;
+ }
+ return array();
+ }
+
+ /**
* @brief gets the active Menu entry
* @return string id or empty string
*
@@ -645,7 +671,7 @@ class OC_App{
$info['update']=false;
} else {
$info['internal']=false;
- $info['internallabel']='3rd Party App';
+ $info['internallabel']='3rd Party';
$info['internalclass']='externalapp';
$info['update']=OC_Installer::isUpdateAvailable($app);
}
@@ -683,10 +709,10 @@ class OC_App{
* @return array, multi-dimensional array of apps. Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description
*/
public static function getAppstoreApps( $filter = 'approved' ) {
- $catagoryNames = OC_OCSClient::getCategories();
- if ( is_array( $catagoryNames ) ) {
+ $categoryNames = OC_OCSClient::getCategories();
+ if ( is_array( $categoryNames ) ) {
// Check that categories of apps were retrieved correctly
- if ( ! $categories = array_keys( $catagoryNames ) ) {
+ if ( ! $categories = array_keys( $categoryNames ) ) {
return false;
}
diff --git a/lib/base.php b/lib/base.php
index 84e9b0c2eeb..c60a97100f4 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -346,7 +346,7 @@ class OC {
public static function init() {
// register autoloader
spl_autoload_register(array('OC', 'autoload'));
- setlocale(LC_ALL, 'en_US.UTF-8');
+ OC_Util::issetlocaleworking();
// set some stuff
//ob_start();
@@ -468,7 +468,7 @@ class OC {
register_shutdown_function(array('OC_Helper', 'cleanTmp'));
//parse the given parameters
- self::$REQUESTEDAPP = (isset($_GET['app']) && trim($_GET['app']) != '' && !is_null($_GET['app']) ? str_replace(array('\0', '/', '\\', '..'), '', strip_tags($_GET['app'])) : OC_Config::getValue('defaultapp', 'files'));
+ self::$REQUESTEDAPP = (isset($_GET['app']) && trim($_GET['app']) != '' && !is_null($_GET['app']) ? OC_App::cleanAppId(strip_tags($_GET['app'])) : OC_Config::getValue('defaultapp', 'files'));
if (substr_count(self::$REQUESTEDAPP, '?') != 0) {
$app = substr(self::$REQUESTEDAPP, 0, strpos(self::$REQUESTEDAPP, '?'));
$param = substr($_GET['app'], strpos($_GET['app'], '?') + 1);
@@ -498,7 +498,7 @@ class OC {
// write error into log if locale can't be set
if (OC_Util::issetlocaleworking() == false) {
- OC_Log::write('core', 'setting locale to en_US.UTF-8 failed. Support is probably not installed on your system', OC_Log::ERROR);
+ OC_Log::write('core', 'setting locale to en_US.UTF-8/en_US.UTF8 failed. Support is probably not installed on your system', OC_Log::ERROR);
}
if (OC_Config::getValue('installed', false)) {
if (OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
@@ -557,6 +557,7 @@ class OC {
if (!self::$CLI) {
try {
+ OC_App::loadApps();
OC::getRouter()->match(OC_Request::getPathInfo());
return;
} catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php
index b210602bbf4..c4062170d5e 100644
--- a/lib/connector/sabre/directory.php
+++ b/lib/connector/sabre/directory.php
@@ -121,7 +121,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
$paths = array();
foreach($folder_content as $info) {
$paths[] = $this->path.'/'.$info['name'];
- $properties[$this->path.'/'.$info['name']][self::GETETAG_PROPERTYNAME] = $info['etag'];
+ $properties[$this->path.'/'.$info['name']][self::GETETAG_PROPERTYNAME] = '"' . $info['etag'] . '"';
}
if(count($paths)>0) {
//
diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php
index 1c18a391742..521c5f0571d 100644
--- a/lib/connector/sabre/file.php
+++ b/lib/connector/sabre/file.php
@@ -45,7 +45,13 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
*/
public function put($data) {
- \OC\Files\Filesystem::file_put_contents($this->path,$data);
+ // mark file as partial while uploading (ignored by the scanner)
+ $partpath = $this->path . '.part';
+
+ \OC\Files\Filesystem::file_put_contents($partpath, $data);
+
+ // rename to correct path
+ \OC\Files\Filesystem::rename($partpath, $this->path);
return OC_Connector_Sabre_Node::getETagPropertyForPath($this->path);
}
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index 9a5546dce3f..5a9a119458e 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -97,7 +97,7 @@ class Scanner {
if ($this->storage->is_dir($path) && ($dh = $this->storage->opendir($path))) {
\OC_DB::beginTransaction();
while ($file = readdir($dh)) {
- if ($file !== '.' and $file !== '..') {
+ if (!$this->isIgnoredFile($file)) {
$child = ($path) ? $path . '/' . $file : $file;
$data = $this->scanFile($child);
if ($data) {
@@ -133,6 +133,22 @@ class Scanner {
}
return $size;
}
+
+ /**
+ * @brief check if the file should be ignored when scanning
+ * NOTE: files with a '.part' extension are ignored as well!
+ * prevents unfinished put requests to be scanned
+ * @param String $file
+ * @return boolean
+ */
+ private function isIgnoredFile($file) {
+ if ($file === '.' || $file === '..'
+ || pathinfo($file,PATHINFO_EXTENSION) === 'part')
+ {
+ return true;
+ }
+ return false;
+ }
/**
* walk over any folders that are not fully scanned yet and scan them
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 71bf3d8708d..a0c3c4b9b75 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -190,14 +190,14 @@ class Filesystem {
}
}
- static public function init($root) {
+ static public function init($user, $root) {
if (self::$defaultInstance) {
return false;
}
self::$defaultInstance = new View($root);
//load custom mount config
- self::initMountPoints();
+ self::initMountPoints($user);
self::$loaded = true;
diff --git a/lib/files/mapper.php b/lib/files/mapper.php
index 90e4e1ca669..71b665e49bb 100644
--- a/lib/files/mapper.php
+++ b/lib/files/mapper.php
@@ -114,8 +114,8 @@ class Mapper
private function resolveLogicPath($logicPath) {
$logicPath = $this->stripLast($logicPath);
- $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `logic_path` = ?');
- $result = $query->execute(array($logicPath));
+ $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `logic_path_hash` = ?');
+ $result = $query->execute(array(md5($logicPath)));
$result = $result->fetchRow();
return $result['physic_path'];
@@ -123,8 +123,8 @@ class Mapper
private function resolvePhysicalPath($physicalPath) {
$physicalPath = $this->stripLast($physicalPath);
- $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `physic_path` = ?');
- $result = $query->execute(array($physicalPath));
+ $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*file_map` WHERE `physic_path_hash` = ?');
+ $result = $query->execute(array(md5($physicalPath)));
$result = $result->fetchRow();
return $result['logic_path'];
@@ -151,8 +151,8 @@ class Mapper
}
private function insert($logicPath, $physicalPath) {
- $query = \OC_DB::prepare('INSERT INTO `*PREFIX*file_map`(`logic_path`,`physic_path`) VALUES(?,?)');
- $query->execute(array($logicPath, $physicalPath));
+ $query = \OC_DB::prepare('INSERT INTO `*PREFIX*file_map`(`logic_path`, `physic_path`, `logic_path_hash`, `physic_path_hash`) VALUES(?, ?, ?, ?)');
+ $query->execute(array($logicPath, $physicalPath, md5($logicPath), md5($physicalPath)));
}
private function slugifyPath($path, $index=null) {
diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php
index 591803f0440..ce9e7ead6d1 100644
--- a/lib/files/storage/common.php
+++ b/lib/files/storage/common.php
@@ -277,4 +277,27 @@ abstract class Common implements \OC\Files\Storage\Storage {
return uniqid();
}
}
+
+ /**
+ * clean a path, i.e. remove all redundant '.' and '..'
+ * making sure that it can't point to higher than '/'
+ * @param $path The path to clean
+ * @return string cleaned path
+ */
+ public function cleanPath($path) {
+ if (strlen($path) == 0 or $path[0] != '/') {
+ $path = '/' . $path;
+ }
+
+ $output = array();
+ foreach (explode('/', $path) as $chunk) {
+ if ($chunk == '..') {
+ array_pop($output);
+ } else if ($chunk == '.') {
+ } else {
+ $output[] = $chunk;
+ }
+ }
+ return implode('/', $output);
+ }
}
diff --git a/lib/files/storage/local.php b/lib/files/storage/local.php
index d387a898320..9fe01135866 100644
--- a/lib/files/storage/local.php
+++ b/lib/files/storage/local.php
@@ -23,6 +23,8 @@ class Local extends \OC\Files\Storage\Common{
$this->datadir.='/';
}
}
+ public function __destruct() {
+ }
public function getId(){
return 'local::'.$this->datadir;
}
diff --git a/lib/files/storage/temporary.php b/lib/files/storage/temporary.php
index 542d2cd9f48..d84dbda2e39 100644
--- a/lib/files/storage/temporary.php
+++ b/lib/files/storage/temporary.php
@@ -21,6 +21,7 @@ class Temporary extends Local{
}
public function __destruct() {
+ parent::__destruct();
$this->cleanUp();
}
}
diff --git a/lib/filesystem.php b/lib/filesystem.php
index 57cca902303..e86bea6bff9 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -58,8 +58,8 @@ class OC_Filesystem {
/**
* @deprecated OC_Filesystem is replaced by \OC\Files\Filesystem
*/
- static public function init($root) {
- return \OC\Files\Filesystem::init($root);
+ static public function init($user, $root) {
+ return \OC\Files\Filesystem::init($user, $root);
}
/**
diff --git a/lib/helper.php b/lib/helper.php
index a0fbdd10394..2713ffed451 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -436,8 +436,9 @@ class OC_Helper {
//FIXME: should also check for value validation (i.e. the email is an email).
public static function init_var($s, $d="") {
$r = $d;
- if(isset($_REQUEST[$s]) && !empty($_REQUEST[$s]))
- $r = stripslashes(htmlspecialchars($_REQUEST[$s]));
+ if(isset($_REQUEST[$s]) && !empty($_REQUEST[$s])) {
+ $r = OC_Util::sanitizeHTML($_REQUEST[$s]);
+ }
return $r;
}
diff --git a/lib/l10n.php b/lib/l10n.php
index ee879009265..e272bcd79f3 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -97,7 +97,7 @@ class OC_L10N{
if ($this->app === true) {
return;
}
- $app = $this->app;
+ $app = OC_App::cleanAppId($this->app);
$lang = $this->lang;
$this->app = true;
// Find the right language
diff --git a/lib/l10n/bg_BG.php b/lib/l10n/bg_BG.php
index 31f37458b81..fed7f29cbb2 100644
--- a/lib/l10n/bg_BG.php
+++ b/lib/l10n/bg_BG.php
@@ -9,6 +9,7 @@
"Files need to be downloaded one by one." => "Файловете трябва да се изтеглят един по един.",
"Back to Files" => "Назад към файловете",
"Selected files too large to generate zip file." => "Избраните файлове са прекалено големи за генерирането на ZIP архив.",
+"couldn't be determined" => "не може да се определи",
"Application is not enabled" => "Приложението не е включено.",
"Authentication error" => "Възникна проблем с идентификацията",
"Token expired. Please reload page." => "Ключът е изтекъл, моля презаредете страницата",
diff --git a/lib/l10n/ca.php b/lib/l10n/ca.php
index f6401fa39b6..d34220f8f5c 100644
--- a/lib/l10n/ca.php
+++ b/lib/l10n/ca.php
@@ -16,6 +16,8 @@
"Files" => "Fitxers",
"Text" => "Text",
"Images" => "Imatges",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "El servidor web no està configurat correctament per permetre la sincronització de fitxers perquè la interfície WebDAV sembla no funcionar correctament.",
+"Please double check the <a href='%s'>installation guides</a>." => "Comproveu les <a href='%s'>guies d'instal·lació</a>.",
"seconds ago" => "segons enrere",
"1 minute ago" => "fa 1 minut",
"%d minutes ago" => "fa %d minuts",
diff --git a/lib/l10n/cs_CZ.php b/lib/l10n/cs_CZ.php
index 2c823194b96..f3fd1a24819 100644
--- a/lib/l10n/cs_CZ.php
+++ b/lib/l10n/cs_CZ.php
@@ -16,6 +16,8 @@
"Files" => "Soubory",
"Text" => "Text",
"Images" => "Obrázky",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server není správně nastaven pro umožnění synchronizace, protože rozhraní WebDAV je rozbité.",
+"Please double check the <a href='%s'>installation guides</a>." => "Zkonzultujte, prosím, <a href='%s'>průvodce instalací</a>.",
"seconds ago" => "před vteřinami",
"1 minute ago" => "před 1 minutou",
"%d minutes ago" => "před %d minutami",
diff --git a/lib/l10n/es.php b/lib/l10n/es.php
index 8bbc8a8f7b4..f3b03b56652 100644
--- a/lib/l10n/es.php
+++ b/lib/l10n/es.php
@@ -16,6 +16,8 @@
"Files" => "Archivos",
"Text" => "Texto",
"Images" => "Imágenes",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Su servidor web aún no está configurado adecuadamente para permitir sincronización de archivos ya que la interfaz WebDAV parece no estar funcionando.",
+"Please double check the <a href='%s'>installation guides</a>." => "Por favor, vuelva a comprobar las <a href='%s'>guías de instalación</a>.",
"seconds ago" => "hace segundos",
"1 minute ago" => "hace 1 minuto",
"%d minutes ago" => "hace %d minutos",
diff --git a/lib/l10n/fi_FI.php b/lib/l10n/fi_FI.php
index b8d4b137431..fb94dd8404c 100644
--- a/lib/l10n/fi_FI.php
+++ b/lib/l10n/fi_FI.php
@@ -16,6 +16,7 @@
"Files" => "Tiedostot",
"Text" => "Teksti",
"Images" => "Kuvat",
+"Please double check the <a href='%s'>installation guides</a>." => "Lue tarkasti <a href='%s'>asennusohjeet</a>.",
"seconds ago" => "sekuntia sitten",
"1 minute ago" => "1 minuutti sitten",
"%d minutes ago" => "%d minuuttia sitten",
diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php
index c6bf8f7f9c3..852fe1ddc4a 100644
--- a/lib/l10n/fr.php
+++ b/lib/l10n/fr.php
@@ -16,6 +16,8 @@
"Files" => "Fichiers",
"Text" => "Texte",
"Images" => "Images",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Votre serveur web, n'est pas correctement configuré pour permettre la synchronisation des fichiers, car l'interface WebDav ne fonctionne pas comme il faut.",
+"Please double check the <a href='%s'>installation guides</a>." => "Veuillez vous référer au <a href='%s'>guide d'installation</a>.",
"seconds ago" => "à l'instant",
"1 minute ago" => "il y a 1 minute",
"%d minutes ago" => "il y a %d minutes",
diff --git a/lib/l10n/it.php b/lib/l10n/it.php
index eb404db7fb5..d339bd5b1ca 100644
--- a/lib/l10n/it.php
+++ b/lib/l10n/it.php
@@ -16,6 +16,8 @@
"Files" => "File",
"Text" => "Testo",
"Images" => "Immagini",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Il tuo server web non è configurato correttamente per consentire la sincronizzazione dei file poiché l'interfaccia WebDAV sembra essere danneggiata.",
+"Please double check the <a href='%s'>installation guides</a>." => "Leggi attentamente le <a href='%s'>guide d'installazione</a>.",
"seconds ago" => "secondi fa",
"1 minute ago" => "1 minuto fa",
"%d minutes ago" => "%d minuti fa",
diff --git a/lib/l10n/lv.php b/lib/l10n/lv.php
index 9f2a0dea749..cc70f760a22 100644
--- a/lib/l10n/lv.php
+++ b/lib/l10n/lv.php
@@ -16,6 +16,8 @@
"Files" => "Datnes",
"Text" => "Teksts",
"Images" => "Attēli",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Jūsu serveris vēl nav pareizi iestatīts, lai ļautu sinhronizēt datnes, jo izskatās, ka WebDAV saskarne ir salauzta.",
+"Please double check the <a href='%s'>installation guides</a>." => "Lūdzu, vēlreiz pārbaudiet <a href='%s'>instalēšanas palīdzību</a>.",
"seconds ago" => "sekundes atpakaļ",
"1 minute ago" => "pirms 1 minūtes",
"%d minutes ago" => "pirms %d minūtēm",
diff --git a/lib/l10n/pt_PT.php b/lib/l10n/pt_PT.php
index e35bb489c49..67b8078ddfa 100644
--- a/lib/l10n/pt_PT.php
+++ b/lib/l10n/pt_PT.php
@@ -16,6 +16,8 @@
"Files" => "Ficheiros",
"Text" => "Texto",
"Images" => "Imagens",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "O seu servidor web não está configurado correctamente para autorizar sincronização de ficheiros, pois o interface WebDAV parece estar com problemas.",
+"Please double check the <a href='%s'>installation guides</a>." => "Por favor verifique <a href='%s'>installation guides</a>.",
"seconds ago" => "há alguns segundos",
"1 minute ago" => "há 1 minuto",
"%d minutes ago" => "há %d minutos",
diff --git a/lib/l10n/vi.php b/lib/l10n/vi.php
index 8b7242ae611..ea9660093ae 100644
--- a/lib/l10n/vi.php
+++ b/lib/l10n/vi.php
@@ -9,6 +9,7 @@
"Files need to be downloaded one by one." => "Tập tin cần phải được tải về từng người một.",
"Back to Files" => "Trở lại tập tin",
"Selected files too large to generate zip file." => "Tập tin được chọn quá lớn để tạo tập tin ZIP.",
+"couldn't be determined" => "không thể phát hiện được",
"Application is not enabled" => "Ứng dụng không được BẬT",
"Authentication error" => "Lỗi xác thực",
"Token expired. Please reload page." => "Mã Token đã hết hạn. Hãy tải lại trang.",
diff --git a/lib/l10n/zh_TW.php b/lib/l10n/zh_TW.php
index 62ab8fedd52..91b0329e246 100644
--- a/lib/l10n/zh_TW.php
+++ b/lib/l10n/zh_TW.php
@@ -16,6 +16,8 @@
"Files" => "檔案",
"Text" => "文字",
"Images" => "圖片",
+"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "您的網頁伺服器尚未被正確設定來進行檔案同步,因為您的 WebDAV 界面似乎無法使用。",
+"Please double check the <a href='%s'>installation guides</a>." => "請參考<a href='%s'>安裝指南</a>。",
"seconds ago" => "幾秒前",
"1 minute ago" => "1 分鐘前",
"%d minutes ago" => "%d 分鐘前",
diff --git a/lib/mimetypes.list.php b/lib/mimetypes.list.php
index fc87d011ecd..86ce9c6c237 100644
--- a/lib/mimetypes.list.php
+++ b/lib/mimetypes.list.php
@@ -97,4 +97,6 @@ return array(
'ai' => 'application/illustrator',
'epub' => 'application/epub+zip',
'mobi' => 'application/x-mobipocket-ebook',
+ 'exe' => 'application',
+ 'msi' => 'application'
);
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php
index 179ed8f3107..820d24a8e0c 100644
--- a/lib/ocs/cloud.php
+++ b/lib/ocs/cloud.php
@@ -45,7 +45,7 @@ class OC_OCS_Cloud {
if(OC_User::userExists($parameters['user'])) {
// calculate the disc space
$userDir = '/'.$parameters['user'].'/files';
- \OC\Files\Filesystem::init($useDir);
+ \OC\Files\Filesystem::init($parameters['user'], $userDir);
$rootInfo = \OC\Files\Filesystem::getFileInfo('');
$sharedInfo = \OC\Files\Filesystem::getFileInfo('/Shared');
$used = $rootInfo['size'] - $sharedInfo['size'];
diff --git a/lib/user.php b/lib/user.php
index 9dc8cca97a6..f58b6673f7f 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -445,10 +445,12 @@ class OC_User {
* Check whether a specified user can change his display name
*/
public static function canUserChangeDisplayName($uid) {
- foreach(self::$_usedBackends as $backend) {
- if($backend->implementsActions(OC_USER_BACKEND_SET_DISPLAYNAME)) {
- if($backend->userExists($uid)) {
- return true;
+ if (OC_Config::getValue('allow_user_to_change_display_name', true)) {
+ foreach(self::$_usedBackends as $backend) {
+ if($backend->implementsActions(OC_USER_BACKEND_SET_DISPLAYNAME)) {
+ if($backend->userExists($uid)) {
+ return true;
+ }
}
}
}
@@ -485,7 +487,7 @@ class OC_User {
*/
public static function getHome($uid) {
foreach(self::$_usedBackends as $backend) {
- if($backend->implementsActions(OC_USER_BACKEND_GET_HOME)) {
+ if($backend->implementsActions(OC_USER_BACKEND_GET_HOME) && $backend->userExists($uid)) {
$result=$backend->getHome($uid);
if($result) {
return $result;
diff --git a/lib/util.php b/lib/util.php
index 49d914e5fbd..81ad2df3ac6 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -51,7 +51,7 @@ class OC_Util {
mkdir( $userdirectory, 0755, true );
}
//jail the user into his "home" directory
- \OC\Files\Filesystem::init($user_dir);
+ \OC\Files\Filesystem::init($user, $user_dir);
$quotaProxy=new OC_FileProxy_Quota();
$fileOperationProxy = new OC_FileProxy_FileOperations();
@@ -74,7 +74,7 @@ class OC_Util {
*/
public static function getVersion() {
// hint: We only can count up. So the internal version number of ownCloud 4.5 will be 4.90.0. This is not visible to the user
- return array(4, 91, 9);
+ return array(4, 91, 10);
}
/**
@@ -560,12 +560,11 @@ class OC_Util {
return true;
}
- $result=setlocale(LC_ALL, 'en_US.UTF-8');
- if($result==false) {
- return(false);
- }else{
- return(true);
- }
+ $result = setlocale(LC_ALL, 'en_US.UTF-8', 'en_US.UTF8');
+ if($result == false) {
+ return false;
+ }
+ return true;
}
/**