diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/l10n/ast.php | 7 | ||||
-rw-r--r-- | lib/private/db.php | 10 | ||||
-rw-r--r-- | lib/private/db/mdb2schemamanager.php | 6 | ||||
-rw-r--r-- | lib/private/log.php | 2 | ||||
-rw-r--r-- | lib/private/search/result/file.php | 55 | ||||
-rw-r--r-- | lib/private/server.php | 2 | ||||
-rw-r--r-- | lib/private/share/share.php | 2 | ||||
-rw-r--r-- | lib/public/iusersession.php | 4 |
8 files changed, 48 insertions, 40 deletions
diff --git a/lib/l10n/ast.php b/lib/l10n/ast.php index 1ec3d8e28d3..644bd4e5b40 100644 --- a/lib/l10n/ast.php +++ b/lib/l10n/ast.php @@ -1,7 +1,9 @@ <?php $TRANSLATIONS = array( "Cannot write into \"config\" directory!" => "¡Nun pue escribise nel direutoriu \"config\"!", +"This can usually be fixed by giving the webserver write access to the config directory" => "Davezu esto pue iguase dándo-y al sirvidor web accesu d'escritura al direutoriu de configuración", "See %s" => "Mira %s", +"This can usually be fixed by %sgiving the webserver write access to the config directory%s." => "Davezu esto pue iguase %sdándo-y al sirvidor web accesu d'escritura al direutoriu de configuración%s.", "You are accessing the server from an untrusted domain." => "Tas accediendo al sirvidor dende un dominiu non confiáu.", "Please contact your administrator. If you are an administrator of this instance, configure the \"trusted_domain\" setting in config/config.php. An example configuration is provided in config/config.sample.php." => "Por favor, contauta col alministrador. Si yes l'alministrador, configura l'axuste \"trusted_domain\" en config/config.php. Hai un exemplu en config/config.sample.php.", "Help" => "Ayuda", @@ -89,6 +91,7 @@ $TRANSLATIONS = array( "A valid password must be provided" => "Tien d'apurrise una contraseña válida", "The username is already being used" => "El nome d'usuariu yá ta usándose", "No database drivers (sqlite, mysql, or postgresql) installed." => "Nun hai controladores de bases de datos (sqlite, mysql, o postgresql)", +"Permissions can usually be fixed by %sgiving the webserver write access to the root directory%s." => "Davezu los permisos puen iguase %sdándo-y al sirvidor web accesu d'escritura al direutoriu raigañu%s.", "Cannot write into \"config\" directory" => "Nun pue escribise nel direutoriu \"config\"", "Cannot write into \"apps\" directory" => "Nun pue escribise nel direutoriu \"apps\"", "Cannot create \"data\" directory (%s)" => "Nun pue crease'l direutoriu \"data\" (%s)", @@ -97,11 +100,15 @@ $TRANSLATIONS = array( "Please ask your server administrator to install the module." => "Por favor, entrúga-y al to alministrador del sirvidor pa instalar el módulu.", "PHP module %s not installed." => "Nun ta instaláu'l módulu PHP %s", "PHP %s or higher is required." => "Necesítase PHP %s o superior", +"Please ask your server administrator to update PHP to the latest version. Your PHP version is no longer supported by ownCloud and the PHP community." => "Por favor, entrúga-y al to alministrador del sirvidor p'anovar PHP a la cabera versión. La to versión PHP nun ta sofitada por ownCloud y la comunidá PHP.", "PHP Safe Mode is enabled. ownCloud requires that it is disabled to work properly." => "Ta habilitáu'l mou seguru de PHP. ownCloud requier que tea deshabilitáu pa furrular afayadízamente", +"Magic Quotes is enabled. ownCloud requires that it is disabled to work properly." => "Tán habilitaes les Magic Quotes. ownCloud requier que les deshabilites pa furrular afayadizamente.", +"PHP modules have been installed, but they are still listed as missing?" => "Instaláronse los módulos PHP, ¿pero tán entá llistaos cómo faltantes?", "Please ask your server administrator to restart the web server." => "Por favor, entruga al to alministrador pa reaniciar el sirvidor web.", "PostgreSQL >= 9 required" => "PostgreSQL >= 9 requeríu", "Please upgrade your database version" => "Por favor, anueva la versión de la to base de datos", "Error occurred while checking PostgreSQL version" => "Asocedió un fallu mientres se comprobaba la versión de PostgreSQL", +"Please make sure you have PostgreSQL >= 9 or check the logs for more information about the error" => "Por favor, asegúrate que tienes PostgreSQL >= 9 o comprueba los rexistros pa más información tocante al fallu", "Please change the permissions to 0770 so that the directory cannot be listed by other users." => "Por favor, camuda los permisos a 0770 pa que'l direutoriu nun pueda llistase por otros usuarios.", "Data directory (%s) is readable by other users" => "El direutoriu de datos (%s) ye llexible por otros usuarios", "Data directory (%s) is invalid" => "Ye inválidu'l direutoriu de datos (%s)", diff --git a/lib/private/db.php b/lib/private/db.php index 6aaf31a30cd..221a369cad2 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -106,6 +106,16 @@ class OC_DB { } /** + * The existing database connection is closed and connected again + */ + public static function reconnect() { + if(self::$connection) { + self::$connection->close(); + self::$connection->connect(); + } + } + + /** * @return \OC\DB\Connection */ static public function getConnection() { diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php index a6d9e30cf80..d3e379c9417 100644 --- a/lib/private/db/mdb2schemamanager.php +++ b/lib/private/db/mdb2schemamanager.php @@ -24,8 +24,6 @@ class MDB2SchemaManager { */ public function __construct($conn) { $this->conn = $conn; - $this->conn->close(); - $this->conn->connect(); } /** @@ -150,6 +148,10 @@ class MDB2SchemaManager { $this->conn->query($sql); } $this->conn->commit(); + + if ($this->conn->getDatabasePlatform() instanceof SqlitePlatform) { + \OC_DB::reconnect(); + } return true; } } diff --git a/lib/private/log.php b/lib/private/log.php index 98465ec40ea..021cc1578a7 100644 --- a/lib/private/log.php +++ b/lib/private/log.php @@ -154,6 +154,6 @@ class Log implements ILogger { $message = strtr($message, $replace); $logger = $this->logger; - $logger::write($app, $message, $level); + call_user_func(array($logger, 'write'), $app, $message, $level); } } diff --git a/lib/private/search/result/file.php b/lib/private/search/result/file.php index da5fa64ef45..331fdaa383a 100644 --- a/lib/private/search/result/file.php +++ b/lib/private/search/result/file.php @@ -18,7 +18,9 @@ */ namespace OC\Search\Result; -use \OC\Files\Filesystem; +use OC\Files\Filesystem; +use OCP\Files\FileInfo; + /** * A found file */ @@ -63,49 +65,36 @@ class File extends \OCP\Search\Result { /** * Create a new file search result - * @param array $data file data given by provider + * @param FileInfo $data file data given by provider */ - public function __construct(array $data = null) { - $info = pathinfo($data['path']); - $this->id = $data['fileid']; + public function __construct(FileInfo $data) { + + $path = $this->getRelativePath($data->getPath()); + + $info = pathinfo($path); + $this->id = $data->getId(); $this->name = $info['basename']; $this->link = \OCP\Util::linkTo( 'files', 'index.php', array('dir' => $info['dirname'], 'file' => $info['basename']) ); - $this->permissions = self::get_permissions($data['path']); - $this->path = (strpos($data['path'], 'files') === 0) ? substr($data['path'], 5) : $data['path']; - $this->size = $data['size']; - $this->modified = $data['mtime']; - $this->mime_type = $data['mimetype']; + $this->permissions = $data->getPermissions(); + $this->path = $path; + $this->size = $data->getSize(); + $this->modified = $data->getMtime(); + $this->mime_type = $data->getMimetype(); } /** - * Determine permissions for a given file path + * converts a path relative to the users files folder + * eg /user/files/foo.txt -> /foo.txt * @param string $path - * @return int + * @return string relative path */ - function get_permissions($path) { - // add read permissions - $permissions = \OCP\PERMISSION_READ; - // get directory - $fileinfo = pathinfo($path); - $dir = $fileinfo['dirname'] . '/'; - // add update permissions - if (Filesystem::isUpdatable($dir)) { - $permissions |= \OCP\PERMISSION_UPDATE; - } - // add delete permissions - if (Filesystem::isDeletable($dir)) { - $permissions |= \OCP\PERMISSION_DELETE; - } - // add share permissions - if (Filesystem::isSharable($dir)) { - $permissions |= \OCP\PERMISSION_SHARE; - } - // return - return $permissions; + protected function getRelativePath ($path) { + $root = \OC::$server->getUserFolder(); + return $root->getRelativePath($path); } - + } diff --git a/lib/private/server.php b/lib/private/server.php index da705863078..3237ce30ccf 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -255,7 +255,7 @@ class Server extends SimpleContainer implements IServerContainer { * @return \OCP\Files\Folder */ function getUserFolder() { - $dir = '/' . \OCP\User::getUser(); + $dir = '/' . $this->getUserSession()->getUser()->getUID(); $root = $this->getRootFolder(); $folder = null; diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 691a2053a82..673c0dc383a 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -1905,7 +1905,7 @@ class Share extends \OC\Share\Constants { } else if (!isset($statuses[$item[$column]])) { $statuses[$item[$column]]['link'] = false; } - if ($item['file_target']) { + if (!empty($item['file_target'])) { $statuses[$item[$column]]['path'] = $item['path']; } } diff --git a/lib/public/iusersession.php b/lib/public/iusersession.php index e9d417c1ace..db4abe150d2 100644 --- a/lib/public/iusersession.php +++ b/lib/public/iusersession.php @@ -52,14 +52,14 @@ interface IUserSession { /** * set the currently active user * - * @param \OCP\User|null $user + * @param \OCP\IUser|null $user */ public function setUser($user); /** * get the current active user * - * @return \OCP\User + * @return \OCP\IUser */ public function getUser(); } |