开发者

Adapting Etherpad to react on new params

I try to adapt etherpad so it is only accessible if certain params are sent with the request. For example I want a certain pad just to be displayed if there is a unique id provided like

http://myetherpad.com/thepadid?myparam=blub

Does anyone know where exactly I can parse 开发者_C百科the params? I searched all the js-files but didn't find exactly what I am looking for.

I found out that there is some kind of request object. You can access it like

request.params.padId

But I also don't know where to search for the implementation of this object. I hope somebody can help me. Thanks :)


You could probably hack something into the code at https://github.com/ether/pad/blob/master/etherpad/src/etherpad/licensing.js#L153

But if all you need is some kind of password protection, there are easier ways. The easiest would be to use something that is built in to your web server, or to use the built-in pro functionality -- more on that on http://etherpad.org/2010/10/14/241/

(Your idea with using URL-parameters for password could be simplified; just use a complicated pad name and only those with the URL will find it. Having a "nice" pad name and adding a complicated password at the end doesn't protect the pad at all.)


For anyone with the same problem: You can get the GET-parameters via

request.headers['Referer']

It returns the URI the user called. But I still don't know how to do it properly (or get the POST parameters).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜