ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.73k stars 2.86k forks source link

Unable to export group pads #156

Closed ozkatz closed 12 years ago

ozkatz commented 13 years ago

Hi,

First of all - Etherpad Lite is AWEOSME. so thanks very much for that :) I am having one issue though, where I can view group pads by getting a session ID and setting it as a cookie (i.e. after setting the sessionID cookie, doing GET /p/<pad id>/ works fine and I have access).

problem happens when I try to do a GET /p/<pad id>/export/txt or GET /p/<pad id>/export/html - in both cases i'm getting a "403 - can't touch this" message displayed. the same HTTP call for a public pad works just fine..

Thanks again for the awesomeness that is Etherpad Lite. Oz

ozkatz commented 13 years ago

Oh, just checked it, the same 403 response happens when I try and import a file (POST /p/<pad id>/import).

Pita commented 13 years ago

I think there is a problem with your sessionID cookie, it might be not avaiable at the import/export urls. Can you please check that?

ozkatz commented 13 years ago

How can I make sure that it does? I set the sessionID cookie once, when entering the pad, and it should be available to all URLs. this cookie is only removed when the user logs out. it is available when watching the pad itself and when replaying the pad's history, so i guess it should also be available at export\import. unless i'm missing something..?

Thanks again! :)

marcelklehr commented 12 years ago

What about this? @ozkatz Is this still an issue? Can someone reproduce this?

ozkatz commented 12 years ago

I'm pretty sure it was an error on my part (unfortunately I can't reproduce now since I'm no longer involved with the project where etherpad-lite is used). Also, it has been a year since I opened this and no one else complained about this - I guess this can be safely closed..

webspeaks commented 12 years ago

I am having the same issue. When performing the export function, I get "403 - Can't touch this" error. I have set the sessionId cookie which is available to all group pads. Is there any solution to this?

marcelklehr commented 12 years ago

@arvind07 Which git revision?

webspeaks commented 12 years ago

@marcelklehr I am not really sure about GIT version. I downloaded it from etherpad.org few days back. How can I check the git version.

marcelklehr commented 12 years ago

the server tells you on startup

webspeaks commented 12 years ago

@marcelklehr It is 2954824 However I can get the pad data through PHP API, but not through jQuery plugin export.

marcelklehr commented 12 years ago

What do you mean? The bug, described in this issue is: "Unable to GET /p/<pad id>/export/txt for group pads"

webspeaks commented 12 years ago

I am trying to export the data of group pad manually using the jQuery plugin for etherpad lite. But while accessing the export URL as /p//export/txt gives '403 - can't touch this; error. But I can get the same group pad contents using the PHP API. Only JavaScript code not working.

marcelklehr commented 12 years ago

The php API client uses the Etherpad-lite http api, which is documented here. This has nothing to do with export urls.

marcelklehr commented 12 years ago

What happens, if you click on the export links in the pad UI?

webspeaks commented 12 years ago

I do not export by clicking on the export links in the pad UI. But I have written a custom function in jQuery that performs the export as

var epframeId = 'epframe'+ 'myPad';
var frameUrl = $('#'+ epframeId).attr('src').split('?')[0];
var contentsUrl = frameUrl + "/export/html";

//It gives 403 error
jQuery.get(contentsUrl, function(data) {
    processResponse(data);
});
marcelklehr commented 12 years ago

I believe, users are authenticated (in this case) using the session cookie. Maybe this isn't sent along the ajax request.

marcelklehr commented 12 years ago

So, it would still be interesting, whether clicking on the export links in the pad UI works.

webspeaks commented 12 years ago

I checked the request in the Node.js console, cookie is being sent. Still 403 error!

marcelklehr commented 12 years ago

@arvind07 You know what? Your git revision is 8 months old...

Update and come back... ;)

tjwelde commented 12 years ago

I am having the same issue on the origin/developer branch https://github.com/Pita/etherpad-lite/commit/3944517aff7e2712abe8c1a6ebee588e2017f4e1 I am getting a 403 error when I try to import or export

The request sends the session cookie to the server and nodejs gets the request (as i can see in the log):

[2012-11-06 19:32:59.161] [DEBUG] ueberDB - GET - pad:g.AUCl7Azb6XIydjLS$beckettmoodle2 - {"atext":{"text":"Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nHallo, cool Firefox geht :)\naber leider noch nicht der Import :(\n\nhmm und was machen wir da????\nich weiß auch nicht genau\n\nund wer ist da?\n\n\nICH!\n\n","attribs":"|4+52_0|1+s_0+10|1+1_1|2+v_1+p|1+1_0|2+h_1|2+2*1+4|2+2"},"pool":{"numToAttrib":{"0":["author","a.Kys9O0uInUEtyvP2"],"1":["author","a.gIqq6GZGXIqaL38t"],"2":["insertorder","first"],"3":["list","bullet1"],"4":["lmkr","1"],"5":["start","1"],"6":["start","2"],"7":["list","indent1"],"8":["list","indent2"],"9":["list","indent3"]},"nextNum":10},"head":87,"chatHead":2,"publicStatus":false,"passwordHash":null,"savedRevisions":[]} - from database [2012-11-06 19:32:59.161] [INFO] http - 403, POST /p/g.AUCl7Azb6XIydjLS$beckettmoodle2/import

Any ideas?

tjwelde commented 12 years ago

This only happens to pads, which were created with the API! Even, if i set the settings to: 'requireSession: false && editonly: false', the API created pads can't import/export. The pads, which I created with these settings are importing/exporting quite good (little things->later)

SebastianZiegler commented 11 years ago

Bugs still present in 1.2 with pads created through the API!

marcelklehr commented 11 years ago

We've had trouble fixing it admittedly, but you won't encounter this bug in the next release anymore, I promise ;) -- see #1176

ja67 commented 10 years ago

Has it been solved already? I am using the develop version and still can't access to export html page of grouppad even if I have a valid session and can use that pad. Thanks!

JohnMcLear commented 9 years ago

This was fixed. Please provide steps to replicate if you have a bug.