0247a3 | 1998-03-11 | David Hedbor | | |
2b004e | 1997-01-25 | Peter Bortas | | *
* Adds some java script that will prevent others from putting
* your page in a frame.
*
|
afbad2 | 1997-06-09 | Peter Bortas | | * Will also remove occuranses of "index.html" at the end of the URL.
|
2b004e | 1997-01-25 | Peter Bortas | | *
|
0247a3 | 1998-03-11 | David Hedbor | | * made by Peter Bortas <peter@idonex.se> Januari -97
|
aa899c | 1997-11-14 | Peter Bortas | | *
* Thanks to
|
2b004e | 1997-01-25 | Peter Bortas | | */
|
0247a3 | 1998-03-11 | David Hedbor | | constant cvs_version = "$Id: killframe.pike,v 1.14 1998/03/11 19:42:43 neotron Exp $";
|
07bf51 | 1997-08-31 | Peter Bortas | | constant thread_safe=1;
|
6677ac | 1997-08-31 | Peter Bortas | |
|
2b004e | 1997-01-25 | Peter Bortas | | #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"
|
aa899c | 1997-11-14 | Peter Bortas | |
|
2b004e | 1997-01-25 | Peter Bortas | | "</pre>"
), ({}), 1,
});
}
string tag_killframe( string tag, mapping m, object id )
{
|
07bf51 | 1997-08-31 | Peter Bortas | |
|
8756ae | 1998-03-08 | Per Hedbor | | if(m->help) return register_module()[2];
|
a211d9 | 1997-08-10 | Henrik Grubbström (Grubba) | | string my_url = id->conf->query("MyWorldLocation") + id->raw_url[1..];
|
0cbd1a | 1997-08-12 | Peter Bortas | | int l=strlen(my_url);
|
07bf51 | 1997-08-31 | Peter Bortas | | if( my_url[l-11..] == "/index.html" )
|
0cbd1a | 1997-08-12 | Peter Bortas | | my_url = my_url[..l-11];
|
07bf51 | 1997-08-31 | Peter Bortas | |
|
2b004e | 1997-01-25 | Peter Bortas | | if (id->supports->javascript)
|
1e8435 | 1997-08-27 | Henrik Grubbström (Grubba) | | return("<script language=javascript>\n"
"<!--\n"
|
aa899c | 1997-11-14 | Peter Bortas | | " if(top.location != \""+ my_url +"\")\n"
" top.location = \""+ my_url +"\";\n"
|
1e8435 | 1997-08-27 | Henrik Grubbström (Grubba) | | "//-->"
"</script>\n");
return "";
|
2b004e | 1997-01-25 | Peter Bortas | | }
mapping query_tag_callers()
{
return ([ "killframe" : tag_killframe ]);
}
|