Commit graph

5755 commits

Author SHA1 Message Date
Henry Castro
5ab255c957 loleaflet: prevent default context menu of the corner column header
Change-Id: I27d78e0ef9946776e1311da12ac0116a16a861f7
2017-06-06 17:50:39 -04:00
Pranav Kant
5e9ed0c8cb Allow links in comments
Change-Id: I033ab7fe09ece8da10bc61fc2102cce80c1e24b0
2017-06-06 18:21:24 +05:30
Pranav Kant
2d0ec13249 CSP - allow WOPI host as image sources
This is needed to avoid CSP error when loading the avatar image URL from
the WOPI hosts.

Change-Id: I6bd8bd846f81bc799192e7fbc16b2d7ecc9f555e
2017-06-06 17:36:47 +05:30
Aditya Dewan
3c121dad37 tdf#97020 follow up - Adding find&replace functionality
added option for calc and impress
draggable operation now smoother

Change-Id: I46210689a1592478827271385da48a854aece766
Reviewed-on: https://gerrit.libreoffice.org/38405
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-06-06 13:22:54 +02:00
Andras Timar
1859bad328 loleaflet: Updated loleaflet-ui.pot
Change-Id: I8eafebdc991f64852bee79e210d845f28b44c86b
2017-06-06 13:13:12 +02:00
Andras Timar
865cd4a79d loolnb was killed earlier
Change-Id: Ie4b1f3c890c59a8b9204af5a25842c74929ecad8
Reviewed-on: https://gerrit.libreoffice.org/38314
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-06-06 13:11:10 +02:00
László Németh
51840fcb36 wsd: add test.hpp to dist tarball
Change-Id: I378fb4ac6db79f5ef661cfb8ecef2a7e5c10dfc5
2017-06-06 12:14:43 +02:00
Michael Meeks
5e2166bfd7 Add missing UnitClient.cpp
Change-Id: I267c5538faac695be7105ce4c81f1d247eb07595
2017-06-06 08:53:57 +01:00
Jan Holesovsky
c1a302a182 loleaflet: Advise the user what to do.
Change-Id: I1ecd0a981bd8e277a53e6af9dc2f7ab1e2ee2099
2017-06-05 19:30:00 +02:00
Pranav Kant
71387065e8 This should be obsolete after PostMessage API and WOPI
In richdocuments, it was added in aa0a8f666ada8f1d1edae17b906089cc03ba473d
and then removed in 87f7720d12e130bd1c3cd9306ad1b1f4d784f9e6

It was added firstly way before WOPI was even there. But now since we
have WOPI, we wouldn't need it.

Change-Id: I786a3f7b2103a43995a70b53438d88a829d13265
2017-06-05 15:41:05 +05:30
Aditya Dewan
ccca292d7d tdf#97020 Adding find&replace functionality
Change-Id: I4d8d22368e6f8ee85873c86f9e80fbdffc2ad17a
Reviewed-on: https://gerrit.libreoffice.org/38287
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-06-05 11:54:59 +02:00
Ashod Nakashian
80b6e97824 Set EverModified on saving the document
When saving while editing a cell, the
document is saved with the new cell contents
(as the cell editing is interrupted and applied),
but the modified status is not published to the
client (loleaflet).

This has the unfortunate side-effect that the
EverModified flag is not set in this scenario.

To avoid this, this patch sets the EverModified
upon successful saving. This is easier than
forcing LO Core to emit ModifiedStatus=true
in the scenario above. Though it suffers from
the false-positive result when the user forces
a save. Although this is probably defensible,
since technically the document changes upon
saving (though not the content if there was
nothing new to save). On the other hand,
it's less harmful to signal modification
due to save than to ignore genuine
modification to the document.

Change-Id: I7ccba62731f534b69819f7924eeb9231d874c111
Reviewed-on: https://gerrit.libreoffice.org/38398
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-05 06:52:24 +02:00
Michael Meeks
eeaf436d53 Admin: show cumulative bandwidth sent / recv'd over all time.
Change-Id: I3f9f398d1de19d54e0aa4c51bc44c597019dc839
2017-06-03 22:53:57 +01:00
Michael Meeks
3101fa510d Accumulate I/O stats per document.
Change-Id: Ie2f5647e65070ddd828f048820efd38b600f9133
2017-06-02 20:41:25 +01:00
Michael Meeks
097cc58d53 Run old-style unit tests as a new-style unit test.
This moves the code into the same process, for easier logging & debugging.

Disabled initially.

Change-Id: Id48b5649ba14deb0a2159ca59e321c7d0ae66dad
2017-06-02 18:33:26 +01:00
Ashod Nakashian
d4b2badd4e loleaflet: click to reload idle document
Change-Id: I29275e71d8ca7ef9aa25ef4697ba5c6f414aa0bb
Reviewed-on: https://gerrit.libreoffice.org/38336
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-02 05:07:54 +02:00
Jan Holesovsky
0033607f01 loleaflet: Many of the WOPI impls. do not provide avatars yet.
Change-Id: If72a6be9102cb96fe1a6b31f85c0e47bb0622558
2017-06-01 22:07:08 +02:00
Pranav Kant
a0710c9613 Inform the current session about document change too
Change-Id: I9947eb8b23e5a698cc2cbf39bfde4e1941aae0f0
2017-06-01 22:07:25 +05:30
Pranav Kant
f4b22bbb3c Broadcast command result back to clients
This is required to tell the clients if the command they issued was
successfull or not. In this case 'savetostorage' is the command that we
are interested in knowing the success status of.

With this, now if the user commands to overwrite the document, dialog
boxes of all other users are automatically closed.

Can easily more commands in future for this kind of thing. Its similar
to unocommandresult, except its not a uno command, but our internal
command.

Change-Id: I2e7e1fd5edbd55c13ee4bf9bce24284483d6507f
2017-06-01 21:42:29 +05:30
Pranav Kant
dce714efb8 Toggle this flag after a successfull save
Change-Id: Id1bf5bc5e32e24f68094f3020f4a7c4c4117f18a
2017-06-01 21:07:52 +05:30
Pranav Kant
9f535580a6 Close the dialog before showing a confirmation dialog
Change-Id: If7220c37f8456627181500d7428caf3657816a16
2017-06-01 21:07:21 +05:30
Pranav Kant
41234773e3 If user permits, save to storage force-fully in case of doc conflict
There is one known problem still - after any user decides to overwrite
the file to storage, other users are not informed, so their dialog keeps
hanging on the screen until they press the cancel or reload button.

Change-Id: I6dad1585e4c53eeed79cd38316892a7f239d44ef
2017-06-01 19:53:10 +05:30
Pranav Kant
4d61cae4c8 If user commands, refresh the document for all in case of doc conflict
Change-Id: I42c61fb8099b0bcc60f942e602561cc97486a918
2017-06-01 19:46:38 +05:30
Pranav Kant
d6ef241cf5 Don't be so rude
If we are rude, then we don't tell the reason behind closing the
document to our clients.

This method earlier was used to do 'ownertermination', but without this
patch, ownertermination is not going to work. We regressed somewhere in
the past.

Change-Id: I7a2513e567f72b1adf00d5a74b118e116d6d99d3
2017-06-01 18:17:39 +05:30
Pranav Kant
ba4e75cfae Inform all clients when document changed behind our back
Introduce a new header X-LOOL-WOPI-Timestamp

This is a WOPI header extension to detect any external document change. For
example, when the file that is already opened by LOOL is changed
in storage.

The WOPI host sends LastModifiedTime field (in WOPI specs) as part
of the CheckFileInfo response. It also expects wsd to send the
same timestamp in X-LOOL-WOPI-Timestamp header during WOPI::PutFile. If
this header is present, then WOPI host checks, before saving the
document, if the timestamp in the header is equal to the timestamp of
the file in its storage. Only upon meeting this condition, it saves the
file back to storage, otherwise it informs us about some change
to the document.

We are supposed to inform the user accordingly. If user is okay
with over-writing the document, then we can omit sending
X-LOOL-WOPI-Timestamp header, in which case, no check as mentioned above
would be performed while saving the file and document will be
overwritten.

Also, use a separate list of LOOL status codes to denote such a change.
It would be wrong to use HTTP_CONFLICT status code for denoting doc
changed in storage scenario. WOPI specs reserves that for WOPI locks
which are not yet implemented. Better to use a separate LOOL specific
status codes synced across WOPI hosts and us to denote scenario that we
expect and are not covered in WOPI specs.

Change-Id: I61539dfae672bc104b8008f030f96e90f9ff48a5
2017-06-01 16:17:07 +05:30
Pranav Kant
15a4474572 Remove superfluous WOPI calls to getFileInfo to check timestamp
One can add the timetamp information in the PutFile call itself. This
way we can avoid making an extra CheckFileInfo call here.

Change-Id: Iae180262e648c36b9cfeb6d5fabdf5d243b93afb
2017-06-01 16:17:07 +05:30
Pranav Kant
cf968e6768 Factor out iso8601 to Poco::Timestamp parsing
Change-Id: I627a7b6b72899371e880e461685f99a86a858232
2017-06-01 16:17:07 +05:30
Ashod Nakashian
935abfacd9 loleaflet: user avatar-specific css for the user list
Change-Id: I5540c3267efcb23513d7df25427af8a8ff0d8909
Reviewed-on: https://gerrit.libreoffice.org/38293
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-06-01 12:40:53 +02:00
Ashod Nakashian
402c2ce2ad loleaflet: show avatar in comments
Change-Id: I97a781a2faf626c2ac6f4b178127aaa77c7775d0
Reviewed-on: https://gerrit.libreoffice.org/38292
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-06-01 12:39:33 +02:00
Ashod Nakashian
a59f78b656 wsd: UserExtraInfo is a map, not array
Change-Id: I64ef04c96223ee74099697cb2276307d834db329
Reviewed-on: https://gerrit.libreoffice.org/38291
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-01 07:48:15 +02:00
Pranav Kant
073b58269b tdf#103673 - Use hex color value in API
Change-Id: I51e2431e9253a625fb590af276d991a34e720141
2017-05-31 14:20:58 +05:30
Pranav Kant
d840e8720a Handle WOPI PutFile unauthorized access token
Change-Id: I29ee8cc0c9f3ea42f70628eca6f74d161d1a38f9
2017-05-31 12:08:31 +05:30
Pranav Kant
ac8e458bda User save should terminate edit in calc; and save if unmodified
Only autosave should do the opposite which it already does in
DocumentBroker.

Change-Id: Ibb86e0b29fc058318de96d2684c326dbe958e6fb
2017-05-31 11:27:14 +05:30
Henry Castro
d31e0e3aac wsd: test: undo conflict
Change-Id: Iafdcf3e206a425b7e55cca7818beb620e9d06f85
2017-05-30 22:26:05 -04:00
Henry Castro
143afd674a loleaflet: merge comments and redlines items
Comments and Redlines were mutually exclusive, but a document
can contain both.

Change-Id: Idb13f0c0e1216edc6bed3291c0c486b45ad74b56
2017-05-30 15:59:00 -04:00
Andras Timar
87b009c59c --enable-silent-rules for package building
Change-Id: I81ad7624b447b6c5f60e1f6e37e2b93896abe792
2017-05-30 13:34:39 +02:00
Andras Timar
cbafebc58a package loolconfig to rpm
Change-Id: I04b8204fde23bd3c674ec622c959ff5ab7714d98
Reviewed-on: https://gerrit.libreoffice.org/38152
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
2017-05-30 11:55:28 +02:00
Ashod Nakashian
8a2c60e5b6 wsd: avoid race during viewinfo notification
Change-Id: If2d8adc67337a5529cb6898808a84727ff1df38e
Reviewed-on: https://gerrit.libreoffice.org/38123
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-29 06:47:42 +02:00
Ashod Nakashian
d76ce9169c loleaflet: suppress docunloading error
This is a soft-error and reconnection
is done transparently, so no need to
show the user unhelpful message.

Change-Id: Ie240897fec1ecdc29a9fc1c1482a416a89ca5323
Reviewed-on: https://gerrit.libreoffice.org/38122
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-29 06:46:42 +02:00
Ashod Nakashian
d0ac8a4b96 loleaflet: add user avatar to useritem
Change-Id: I0b366ab4b92fb9b1d5f7aa0ea6fe51ac9897bdce
Reviewed-on: https://gerrit.libreoffice.org/38121
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-29 06:45:58 +02:00
Ashod Nakashian
da2d3cbc92 wsd: support per-user links and commands
userextrainfo is a json array that contains
extra user-specific links.

Currently 'avatar' is assumed to hold the
image url for the user's avatar.

'mail' and other links can also be added.

Change-Id: I37c4c68bfa0b7ee659e017b4867dcb8cf5c2ca2f
Reviewed-on: https://gerrit.libreoffice.org/38120
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-29 06:45:18 +02:00
Aditya Dewan
66a3e1c273 tdf#106449 Admin console: adding user list
Change-Id: I41b15c6a73fa61c21ef5ab79de149b445014c99a
Reviewed-on: https://gerrit.libreoffice.org/38017
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-27 07:08:25 +02:00
Michael Meeks
c224413a9d Track bytes recv'd and sent on StreamSockets.
Dump on USR1 as part of our state.

Change-Id: I4c6b87c19bca768402c9b0b8e26f16336e007749
2017-05-26 15:54:58 +01:00
Jan Holesovsky
82704ed777 loleaflet: Let's not use a 'disableabout' param.
Instead, just disable the Help -> About choice if the 'about-dialog' div was
removed from loleaflet.html.

Change-Id: I997aa5489bcfbd02f56feb79bea14e92d3666bf2
2017-05-26 10:18:05 +02:00
Jan Holesovsky
9aecf428f6 Revert "wsd: enable option to remove About dialog elements"
The request was meant the other way around; let's just not present "About" in
the menu when there is no element with "about-dialog" id.

This reverts commit b9305d17ce.
2017-05-26 10:03:33 +02:00
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