调整 Etherpad 以对新参数做出反应
我尝试调整 etherpad,以便只有在随请求发送某些参数时才能访问它。 例如,如果提供了唯一的 id,我希望只显示某个 pad,例如
http://myetherpad.com/thepadid?myparam=blub
有人知道我可以在哪里解析参数吗?我搜索了所有 js 文件,但没有找到我正在寻找的内容。
我发现有某种请求对象。您可以像这样访问它
request.params.padId
,但我也不知道在哪里搜索该对象的实现。 我希望有人能帮助我。谢谢 :)
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 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 :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能可以在 https 上侵入代码: //github.com/ether/pad/blob/master/etherpad/src/etherpad/licensing.js#L153
但如果您需要的只是某种密码保护,还有更简单的方法。最简单的方法是使用 Web 服务器内置的功能,或者使用内置的专业功能 - 有关更多信息,请参见 http://etherpad.org/2010/10/14/241/
(您使用 URL 参数作为密码的想法可以简化;只需使用复杂的 pad 名称和只有那些具有URL 会找到它。拥有一个“好听的”pad 名称并在末尾添加复杂的密码根本无法保护 pad。)
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.)
来获取 GET 参数
对于遇到同样问题的任何人:您可以通过它返回用户调用的 URI 。但我仍然不知道如何正确执行(或获取 POST 参数)。
For anyone with the same problem: You can get the GET-parameters via
It returns the URI the user called. But I still don't know how to do it properly (or get the POST parameters).