Commit graph

5860 commits

Author SHA1 Message Date
Henry Castro
b9305d17ce wsd: enable option to remove About dialog elements
Change-Id: I33c351cbc7373255a22f44cb31e53f21a00869bf
2017-05-25 17:43:11 -04:00
Marco Cecchetti
1588d2fe12 loleflet - sc: header incorrectly shows selection sometimes
Problem:
- Select a whole row, let's say row 10.
- Select a whole column, let's say column I.

=> Columns headers right from I, (J, K etc.) are still highlighted.
Similarly if a column selected first, and a row next.

Change-Id: I13ad0e2a152ddbf96c4889a3aea5129885bc95b5
Reviewed-on: https://gerrit.libreoffice.org/38000
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-25 11:09:59 +02:00
Marco Cecchetti
061c720ee1 loleaflet: calc: styles are visible in fonts dropdown
Change-Id: Ia909ed9f35d6a1c80f6696abeddefe2d4ad2d6a0
Reviewed-on: https://gerrit.libreoffice.org/38001
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-25 11:05:21 +02:00
Pranav Kant
1a1ab5fd57 wsd: Only disable copying when DisableCopy is mentioned
Earlier, DisableCopy was a misnomer disabling both copy and paste. Now
it only disables copy from the document but allows pasting into the
document.

Change-Id: I8ddfdd493918331276f0656468d3b94c4283fa4d
2017-05-25 14:11:33 +05:30
Pranav Kant
7a4bc5b95a admin-console: Check the password against hashed value in config
The new password hash property is called secure_password in the config
file. `loolconfig` tool should be used to set the password hash in
appropriate format with desired salt length, password length, number of
iterations in PBKDF2.

To be backward compatible, plain-text password for admin-console in
config file is still accepted in case secure_password property is
missing from the config file.

Change-Id: If229999dac62856e368555c0242c4aa6f8061fba
2017-05-25 01:18:31 +05:30
Pranav Kant
9bd89e89c3 loolconfig: tool to generate admin password hash with PBKDF2
A normal usage to set the admin password would be like :

loolconfig set-admin-password --config-file ./loolwsd.xml

Other command line options can also be given, like --pwd-salt-length,
--pwd-hash-length, --pwd-iterations.

Change-Id: I2a6f8d25e068b53a3f945426f0779c8410b2c8ba
2017-05-25 01:18:31 +05:30
Henry Castro
c6b1d29578 loleaflet: simplify disable about dialog
CreateMenu is a recursive function

Change-Id: Ied1b076c1ff04a1d471af2360aa8f9fbbe3289ff
2017-05-24 15:25:36 -04:00
Henry Castro
5d22b274f8 loleaflet: add parameter to disable 'About' menu
Change-Id: I07fa655b8318f78d7e479a3dc34830ebe5f81a2e
2017-05-24 10:28:14 -04:00
Henry Castro
05deed08b4 loleaflet: fix undo repair document popup
UNDO_CONFLICT was intented to notify views, but
the constant value changed with latest patch upstream

Change-Id: I09062725539df3d974a47d89374d822d1d852770
2017-05-23 16:42:49 -04:00
Aditya Dewan
9db39ce741 tdf#107752 admin console: indicating whether a document is modified.
Change-Id: I6055a601c1dd3b5e9700ef75d7c07d7e0b13d663
2017-05-23 19:00:53 +05:30
Pranav Kant
c05aec945d Revert "wsd: Use hostname and port in doc key too"
This reverts commit e8ff268992.

To have support for both multitenancy - several WOPI hosts using same wsd -
and WOPI host aliases, using a ID unique across a WOPI host instance as
part of the WOPI URL is a better approach that handles both of above
mentioned issues cleanly.
2017-05-23 17:05:07 +05:30
Henry Castro
41c561233d loleaflet: prevent default context menu of the grab handles
Change-Id: I12ede87cb8207257470720c130913e3ab7e967dd
2017-05-22 21:08:30 -04:00
Henry Castro
0ebedb7efa loleaflet: prevent default context menu of the row/column resize area
Change-Id: I184a698fd63a0b3e83efb8c315ccca730d56112a
2017-05-22 20:40:55 -04:00
Ashod Nakashian
e877adc84b wsd: don't stop doc on unauthorized loading
When a client connects with expired/invalid
access_token, the document should remain
active for other/existing clients, if any.

However, if no clients exists (i.e. the
first client has invalid access_token),
then the document should be unloaded and
cleaned up.

Change-Id: Iaad95a4286325cc6ee130b37e3ad635993a71c72
Reviewed-on: https://gerrit.libreoffice.org/37916
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-22 21:07:03 +02:00
Pranav Kant
62680fffdb loleaflet: Change opacity manually
See inline comment

Change-Id: I62456dd300eabaa156f9673fe13c190421c22ca0
2017-05-22 16:53:50 +05:30
Miklos Vajna
43eabc09d1 Fix HTTPWSTest::testInsertDelete() failure
.uno:DeletePage deletes the "current" page, while the intent here is to
delete all slides except the first one. Be explicit about this.

Change-Id: Ia8a8a5bf907e3d79cc646d54803447525375ce72
Reviewed-on: https://gerrit.libreoffice.org/37833
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-05-22 09:28:42 +02:00
Pranav Kant
1ea87b627e wsd: Arrange exception handling a bit
Remove incorrect usage of std::uncaught_exception and handle
StorageConnectionException later.

Change-Id: I15ecd46b51e8ed33649fe876d46ce3d5fbae07cc
2017-05-22 11:04:26 +05:30
Ashod Nakashian
4e6fee5407 Hide connecting spinner on authorization failure
Also, fix regression resulting in "This is embarrassing..."
instead of "Unauthorized..." message.

Change-Id: If6219bfbc445b186bb4064b3f20a0ccd2854d617
Reviewed-on: https://gerrit.libreoffice.org/37893
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-22 07:06:50 +02:00
Ashod Nakashian
7bc5989aca loleaflet: correctly reload after server recycling
When the server recylces, the client should
transparently restore connection when the
server is back on. This was broken because
of the different times when moving in and out
of focus for dimming/inactivity purposes.

Here we track server recycling state
separately, and skip the dimming/inactivity
checks in that case.

Change-Id: I432b97b3278b5a6846c8d2c4fa964184f156d5f3
Reviewed-on: https://gerrit.libreoffice.org/37892
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-22 07:06:14 +02:00
Ashod Nakashian
407c538f04 Correctly send termination reason to clients
Fixes the case when the client reconnects on idle
disconnection (because it never got the 'close: idle'
message).

Also, show informative message to users in this case
instead of grey screen.

Change-Id: Ia2e1f2ffefe6d35dd1552e7cc44e490aab86c600
Reviewed-on: https://gerrit.libreoffice.org/37891
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-22 07:05:28 +02:00
Ashod Nakashian
bdd8b715dd wsd: include cleanup
Change-Id: I9f28ee329e318043c31c899d3a07cd3139d838f0
Reviewed-on: https://gerrit.libreoffice.org/37890
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-22 07:04:24 +02:00
Ashod Nakashian
873cbcbe91 wsd: logging corrections
Change-Id: I35c52494137ea174c218bf936bc2440634036e3e
Reviewed-on: https://gerrit.libreoffice.org/37889
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-22 07:03:47 +02:00
Pranav Kant
f47936a2da ENABLE_DEBUG has values either 0 or 1, otherwise its always defined.
Change-Id: I0253dc2d83c11888e79ddb991b065eb62bbbd805
2017-05-20 12:18:29 +05:30
Pranav Kant
aed840ea04 Didn't mean to truncate this string literal
Otherwise getStatus() returns an integer which increments the char*

Change-Id: I189addb60a02de14085b1501c75362b13dcb3ae2
2017-05-19 21:04:03 +05:30
Pranav Kant
bcf958c500 wsd: Fail gracefully when storage misbehaves
When WOPI's CheckFileInfo or GetFile responds with status code other
than HTTP 200, show a message to the user indicating some problem in the
storage.

Currently, we open an empty document if storage doesn't return a
document which surely is not correct.

Mention the storage server address when asking user to contact the
server administrator to be more friendly.

Change-Id: I15f0489f36db8689b43d42f6b691fdd21815e4fa
2017-05-19 20:53:42 +05:30
Pranav Kant
2e9e6a753d Bin unused Exception class
Change-Id: I961af47f6c112b6d9bb2e9d4ad184e162377506f
2017-05-19 16:14:41 +05:30
Jan Holesovsky
9db41725f4 Revert "wsd: use WOPI host instance ID to support hostname aliases"
Turns out this introduces two calls to the CheckFileInfo which is not really
what we should be doing; instead, let's do a kind of cannonicalization in the
WOPI host directly.

This reverts commit ec2fd0844f.

Change-Id: I311bf8a45b706ed9a4d8cd00db0a990ac6d461b4
2017-05-19 10:34:38 +02:00
Pranav Kant
4ef373ce5f wsd: Echo back port number in CSP too if found in Referer header
Otherwise, WOPI implementations that use non-standard ports get CSP
voilation errors in the browsers because Poco's URI::getHost() method
strips the port number from the host.

No harm in mentioning the port number always even if its a standard one,
so always use Poco::URI::getPort() to append the port to the frame
ancestor.

Change-Id: I9e7a7021b38f717e14af3d389e30f24ecaf6d122
2017-05-18 23:10:49 +05:30
Andras Timar
8cbcf9a41a loleaflet: updated translations
Change-Id: Ic25539b5a5800f9f77ed81697a59bc40ce3fb6da
2017-05-18 14:37:49 +02:00
Aditya Dewan
45b923cb2e tdf#107891 zoom does not reset on window resize
Change-Id: I799d2517496233e6ec04587c257eeada56769aca
Reviewed-on: https://gerrit.libreoffice.org/37747
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-18 11:41:34 +02:00
Pranav Kant
827d3f63cb loleaflet: Use safer text assignment method
Change-Id: Idb0e5454f5d795132c762e22c596710bfed75770
2017-05-17 23:31:26 +05:30
Pranav Kant
46acd74d83 Document LOOL_SERVE_FROM_FS
Change-Id: I10d71979366f61839f2aedaf6886fa5f03132004
2017-05-17 23:31:26 +05:30
Jan Holesovsky
02dbc82631 wsd: Don't set Content-Disposition for SVGs, the browser must handle them.
Otherwise the presesntation mode downloads them instead of showing.

Change-Id: If2c9785aa5ef6bbb65e911b834c77ea83da281e7
Reviewed-on: https://gerrit.libreoffice.org/37716
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-17 16:30:35 +02:00
Marco Cecchetti
afe8e9d245 loleaflet: broken shortcut for comments
Change-Id: I08eae6a1ba5c22f863f73a2625803f1b38e6e415
Reviewed-on: https://gerrit.libreoffice.org/37713
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-05-17 16:23:55 +02:00
Pranav Kant
1717bfbc0b Silence -Werror=unused-parameter in non-debug builds
Change-Id: Ib4c91e52d4ac78b3bafe3d078e41c79b50ca87a8
2017-05-17 16:43:31 +05:30
Pranav Kant
8a02e7a8fa wsd: Debugging environment vars to debug storages
Also, extend the LOOLProtocol::tokenize to accept a custom delimeter.

Change-Id: I7f789e703c5c8d2ad325b3dd149ba888c722f5f3
2017-05-17 16:30:33 +05:30
Pranav Kant
1449d81671 wsd: Don't filter out 'save' command
Fallback from 1cb75cbcb8

Change-Id: I47c8a470e5f4ab4d48859365d4435ae79c5fa82d
2017-05-17 10:29:53 +05:30
Ashod Nakashian
ec2fd0844f wsd: use WOPI host instance ID to support hostname aliases
The docKey creation moved to Storage where we first
invoke WOPI (if/when it's a WOPI-hosted doc and WOPI enabled)
and see if the user has access to the document at all.
If they do, we expect the server to give us a
unique ID to use for identifying the host regardless
of hostname aliases.

If a unique ID is not returned (i.e. empty or missing)
we use the hostname and port in its place as fallback.
This will break hostname aliases, but it will still work.

Change-Id: I407b0087395f9df6ad9cc6e037570487999be4a4
Reviewed-on: https://gerrit.libreoffice.org/37697
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-17 04:18:31 +02:00
Aditya Dewan
f94b42d9a8 tdf#107762 admin-console: memory graph in 'Analytics' tab now working
Change-Id: I6a0ee82e813e80344eaf6ddb7d46eebed98ca5bb
Reviewed-on: https://gerrit.libreoffice.org/37672
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-16 17:52:53 +02:00
Marco Cecchetti
2b8fc61dde loleaflet: impress: comments that are being modified are shown twice
Reworked handling of annotation layout. Now it behaves more like
writer annotations.

Now scrolling up annotations leads to scrolling the current slide too
when it is required in order to show not visible annotations.

Moreover the top visible annotation is now remembered for each slide,
and when the top annotation is not the first one, a bit of the bottom
of the previous annotation is showed so that the user gets aware that
there are more annotations above.

Change-Id: I3d087a8db35143a5e3abcd3e95e5e612d7638891
Reviewed-on: https://gerrit.libreoffice.org/37628
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
2017-05-16 16:12:54 +02:00
Marco Cecchetti
ef5376197e Loleaflet: Fix for row/col headers and annotation marks on tab switching
Change-Id: Id0f52603af7eaa49979f68d222c9c94e79cf65b1
Reviewed-on: https://gerrit.libreoffice.org/37251
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-16 13:21:22 +02:00
Marco Cecchetti
647556b442 loleaflet: misplaced comment mark on inserting/deleting/resizing row/col
Change-Id: Ib95870905d1bfc613ba454c7126501b3533e4ba5
Reviewed-on: https://gerrit.libreoffice.org/36982
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-05-16 13:20:47 +02:00
Pranav Kant
1cb75cbcb8 wsd: Save wrapper over .uno:Save
Document broker needs to know when the save request is sent and when the
save finished. It uses these parameters to avoid shutting down document,
in the document broker main polling loop, if save is already going on.
But direct .uno:Save commands issued from
loleaflet precludes document broker to keep track of it - in this case a
.uno:Save command issued from loleaflet followed by closing the
session will prevent saving the document to storage, if document is huge
enough and LO core takes a bit of time to save it. A save wrapper
command, 'save', ensures that document broker is aware of all such save
requests (_saveRequestTime member variable) and doesn't close the
document until we completely save it (to storage and other cleanups).

Change-Id: I5ec73d45adff23b2e7543e93dfd0624a5e5af46d
2017-05-15 11:41:52 +05:30
Ashod Nakashian
47c01440ba wsd: logs
Change-Id: I286c4c7415b114f51f3258bd6d50f8e103ea6c75
Reviewed-on: https://gerrit.libreoffice.org/37611
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:14:55 +02:00
Ashod Nakashian
6e63c80763 wsd: handle WOPI access failure
Show the user that authorization failed.

Change-Id: Iad63c11ac2033eee80062ecd43dff76f776924c3
Reviewed-on: https://gerrit.libreoffice.org/37610
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:14:30 +02:00
Ashod Nakashian
484fcd63a5 wsd: corrections to replace and unittests
Change-Id: I0e03deaa710ba722a97c9f857b514f8ecb0e1682
Reviewed-on: https://gerrit.libreoffice.org/37609
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:13:21 +02:00
Ashod Nakashian
7cff4fb08a wsd: fix server shutdown
Thread-affinity checks must be inhibited
not just on Socket, but on the SocketPoll as well,
before destroying DocumentBroker instances.

Also, properly initialize the inhibit statics.

Change-Id: I2ced1554d477f0c3faf09bda74034cbae99e4ce1
Reviewed-on: https://gerrit.libreoffice.org/37608
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:10:31 +02:00
Ashod Nakashian
d267b86bbd wsd: include version in http agent strings
And move the WOPI agent string to Common.hpp.

Change-Id: Ife679705bcd6914ddd45ad50446e690fb22dd317
Reviewed-on: https://gerrit.libreoffice.org/37607
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-15 05:10:06 +02:00
Jan Holesovsky
95e892168c wsd: When connecting new sessions, always use the original URI...
...but in combination with the appropriate session's access_token to always
authenticate against the same instance of the WOPI host.

Change-Id: Ic94dfa8fcb226a2d134272b22edc1f8f76c24e34
2017-05-12 18:07:23 +02:00
Ashod Nakashian
a15e32137f extend discovery.xml with pdf and image formats
Change-Id: I201eb276b4de29239c7dd99954abcc39e6027aff
Reviewed-on: https://gerrit.libreoffice.org/37430
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-12 06:49:33 +02:00