Projects
Kolab:Winterfell
chwala
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 22
View file
chwala.spec
Changed
@@ -37,7 +37,7 @@ %global _ap_sysconfdir %{_sysconfdir}/%{httpd_name} Name: chwala -Version: 0.5.1 +Version: 0.5.2 Release: 1%{?dist} Summary: Glorified WebDAV, done right @@ -160,6 +160,9 @@ %attr(0750,%{httpd_user},%{httpd_group}) %{_localstatedir}/log/%{name} %changelog +* Wed Dec 20 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.5.2-1 +- Release 0.5.2 + * Mon Jul 24 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.5.1-1 - Release 0.5.1
View file
chwala-0.5.1.tar.gz/config/config.inc.php.dist -> chwala-0.5.2.tar.gz/config/config.inc.php.dist
Changed
@@ -36,6 +36,22 @@ ); */ +// Default values for sources configuration dialog. +// Note: use driver names as the array keys. +// Note: %u variable will be resolved to the current username. +/* +$config['fileapi_presets'] = array( + 'seafile' => array( + 'host' => 'seacloud.cc', + 'username' => '%u', + ), + 'webdav' => array( + 'baseuri' => 'https://some.host.tld/Files', + 'username' => '%u', + ), +); +*/ + // Manticore service URL. Enables use of WebODF collaborative editor. // Note: this URL should be accessible from Chwala host and Roundcube host as well. $config['fileapi_manticore'] = null; @@ -87,6 +103,12 @@ $config['fileapi_seafile_ssl_verify_host'] = false; $config['fileapi_seafile_ssl_verify_peer'] = false; +// To support various Seafile configurations when fetching a file +// from Seafile server we proxy it via Chwala server. +// Enable this option to allow direct downloading of files +// from Seafile server to user browser. +$config['fileapi_seafile_allow_redirects'] = false; + // ------------------------------------------------ // WebDAV driver settings // ------------------------------------------------
View file
chwala-0.5.1.tar.gz/lib/api/folder_types.php -> chwala-0.5.2.tar.gz/lib/api/folder_types.php
Changed
@@ -32,6 +32,7 @@ parent::handle(); $drivers = $this->rc->config->get('fileapi_drivers'); + $presets = (array) $this->rc->config->get('fileapi_presets'); $result = array(); if (!empty($drivers)) { @@ -39,20 +40,22 @@ if ($driver_name != 'kolab' && !isset($result[$driver_name])) { $driver = $this->api->load_driver_object($driver_name); $meta = $driver->driver_metadata(); + $meta = $this->parse_metadata($meta); - $result[$driver_name] = $this->parse_metadata($meta); + if (!empty($presets[$driver_name]) && empty($meta['form_values'])) { + $meta['form_values'] = (array) $presets[$driver_name]; + $user = $this->rc->get_user_name(); + + foreach ($meta['form_values'] as $key => $val) { + $meta['form_values'][$key] = str_replace('%u', $user, $val); + } + } + + $result[$driver_name] = $meta; } } } -/* - // add local storage to the list - if (!empty($result)) { - $backend = $this->api->get_backend(); - $meta = $backend->driver_metadata(); - $result = array_merge(array('default' => $this->parse_metadata($meta, true)), $result); - } -*/ return $result; } }
View file
chwala-0.5.1.tar.gz/lib/drivers/seafile/seafile_api.php -> chwala-0.5.2.tar.gz/lib/drivers/seafile/seafile_api.php
Changed
@@ -77,6 +77,13 @@ */ protected $token; + /** + * API URL prefix (schema and host[:port]) + * + * @var string + */ + protected $url_prefix; + public function __construct($config = array()) { @@ -92,6 +99,8 @@ if (!preg_match('|/api2$|', $this->url)) { $this->url .= '/api2/'; } + + $this->url_prefix = preg_replace('|^(https?://[^/]+).*$|i', '\\1', $this->url); } /** @@ -148,6 +157,11 @@ // Note: It didn't work for me without the last backslash $url = rtrim($url, '/') . '/'; } + // If Seafile is behind a proxy and different port, it will return + // wrong URL for file uploads. We force the original URL prefix here + else if (stripos($url, $this->url_prefix) !== 0) { + $url = $this->url_prefix . preg_replace('|^(https?://[^/]+)|i', '', $url); + } if (!$this->request) { $this->config['store_body'] = true;
View file
chwala-0.5.1.tar.gz/lib/drivers/seafile/seafile_file_storage.php -> chwala-0.5.2.tar.gz/lib/drivers/seafile/seafile_file_storage.php
Changed
@@ -507,19 +507,18 @@ // just send redirect to SeaFile server if ($file['size'] && empty($params['head'])) { + $allow_redirects = $this->rc->config->get('fileapi_seafile_allow_redirects'); // In view-mode we can't redirect to SeaFile server because: // - it responds with Content-Disposition: attachment, which causes that // e.g. previewing images is not possible // - pdf/odf viewers can't follow redirects for some reason (#4590) - if (empty($params['force-download'])) { - if ($fp = fopen('php://output', 'wb')) { - $this->save_file_content($link, $fp); - fclose($fp); - die; - } + if ($allow_redirects && !empty($params['force-download'])) { + header("Location: $link"); + } + else if ($fp = fopen('php://output', 'wb')) { + $this->save_file_content($link, $fp); + fclose($fp); } - - header("Location: $link"); } }
View file
chwala-0.5.1.tar.gz/lib/file_document.php -> chwala-0.5.2.tar.gz/lib/file_document.php
Changed
@@ -399,25 +399,28 @@ // - get list of all folder URIs and find sessions for files in these locations // @FIXME: in corner cases (user has many folders) this may produce a big query, // maybe fetching all sessions and then comparing with list of locations would be faster? - $uris = $this->all_folder_locations(); - $where = array_map(function($uri) use ($db) { - return 's.`uri` LIKE ' . $db->quote(str_replace('%', '_', $uri) . '/%'); - }, $uris); + $uris = $this->all_folder_locations(); - $result = $db->query("SELECT * FROM `{$this->sessions_table}` s" - . " WHERE s.`readonly` = 0 AND (" . join(' OR ', $where) . ")"); + if (!empty($uris)) { + $where = array_map(function($uri) use ($db) { + return 's.`uri` LIKE ' . $db->quote(str_replace('%', '_', $uri) . '/%'); + }, $uris); - if ($db->is_error($result)) { - throw new Exception("Internal error.", file_api_core::ERROR_CODE); - } + $result = $db->query("SELECT * FROM `{$this->sessions_table}` s" + . " WHERE s.`readonly` = 0 AND (" . join(' OR ', $where) . ")"); - while ($row = $db->fetch_assoc($result)) { - if (empty($sessions[$row['id']])) { - // remove filename (and anything after it) so we have the folder URI - // to check if it's on the folders list we have - $uri = substr($row['uri'], 0, strrpos($row['uri'], '/')); - if (in_array($uri, $uris) && ($path = $this->uri2path($row['uri'], true))) { - $sessions[$row['id']] = $this->session_info_parse($row, $path); + if ($db->is_error($result)) { + throw new Exception("Internal error.", file_api_core::ERROR_CODE); + } + + while ($row = $db->fetch_assoc($result)) { + if (empty($sessions[$row['id']])) { + // remove filename (and anything after it) so we have the folder URI + // to check if it's on the folders list we have + $uri = substr($row['uri'], 0, strrpos($row['uri'], '/')); + if (in_array($uri, $uris) && ($path = $this->uri2path($row['uri'], true))) { + $sessions[$row['id']] = $this->session_info_parse($row, $path); + } } } }
View file
chwala-0.5.1.tar.gz/lib/file_wopi.php -> chwala-0.5.2.tar.gz/lib/file_wopi.php
Changed
@@ -37,6 +37,14 @@ // Mimetypes supported by other Chwala viewers or ones we don't want to be editable protected $mimetype_exceptions = array( 'text/plain', + 'image/bmp', + 'image/png', + 'image/jpeg', + 'image/jpg', + 'image/pjpeg', + 'image/gif', + 'image/tiff', + 'image/x-tiff', ); /**
View file
chwala.dsc
Changed
@@ -2,7 +2,7 @@ Source: chwala Binary: chwala Architecture: all -Version: 0.5.1-0~kolab1 +Version: 0.5.2-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>, Paul Klos <kolab@klos2day.nl> Homepage: http://kolab.org/about/chwala/ @@ -11,5 +11,5 @@ Package-List: roundcubemail deb web extra Files: - 00000000000000000000000000000000 0 chwala-0.5.1.tar.gz + 00000000000000000000000000000000 0 chwala-0.5.2.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +chwala (0.5.2-0~kolab1) unsable; urgency=low + + * Release version 0.5.2 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabys.com> Wed, 20 Dec 2017 12:12:12 +0100 + chwala (0.5.1-0~kolab1) unsable; urgency=low * Release version 0.5.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.