Roxen.git/
server/
modules/
tags/
killframe.pike
Branch:
Tag:
Non-build tags
All tags
No tags
1997-01-25
1997-01-25 11:39:33 by Peter Bortas <zino@lysator.liu.se>
2b004ee571d4112691b0e5a4a03831c06e2bf993 (
56
lines) (+
56
/-
0
)
[
Show
|
Annotate
]
Branch:
5.2
New antiframesmodule.
Rev: server/modules/tags/killframe.pike:1.1
1:
+
/* This is a roxen module. (c) Informationsvävarna AB 1997.
+
*
+
* Adds some java script that will prevent others from putting
+
* your page in a frame.
+
*
+
* Will also strip any occurences of the string 'index.html'
+
* from the URL. Currently this is done a bit clumsy, making
+
* URLs like http://www.roxen.com/index.html/foo.html break,
+
* this should be fixed.
+
*
+
* made by Peter Bortas <peter@infovav.se> Januari -97
+
*/
-
+
#include <module.h>
+
inherit "module";
+
+
void create() { }
+
+
mixed *register_module()
+
{
+
return ({
+
MODULE_PARSER,
+
"Killframe tag",
+
("Makes pages frameproof."
+
"<br>This module defines a tag,"
+
"<pre>"
+
"<killframe>: Adds some java script that will prevent others\n"
+
" from putting your page in a frame.\n\n"
+
" Will also strip any occurences of the string\n"
+
" 'index.html' from the URL."
+
"</pre>"
+
), ({}), 1,
+
});
+
}
+
+
string tag_killframe( string tag, mapping m, object id )
+
{
+
//Det är fult med länkar till index.html
+
string my_url = roxen->query("MyWorldLocation") + id->raw_url[1..] -
+
"index.html";
+
+
if (id->supports->javascript)
+
string head = "<script language=javascript>\n"
+
"<!--\n"
+
" if(top.location.href != \""+ my_url +"\")\n"
+
" top.location.href = \""+ my_url +"\";\n"
+
"//-->"
+
"</script>\n";
+
+
return head;
+
}
+
+
mapping query_tag_callers()
+
{
+
return ([ "killframe" : tag_killframe ]);
+
}
Newline at end of file added.