]> git.sesse.net Git - pr0n/blob - perl/Sesse/pr0n/Registry.pm
Fix a few can_use_qscale-issues.
[pr0n] / perl / Sesse / pr0n / Registry.pm
1 # Not related to Apache2::Registry; generates a .reg file for Windows XP to import.
2
3 package Sesse::pr0n::Registry;
4 use strict;
5 use warnings;
6
7 use Sesse::pr0n::Common qw(error dberror);
8 use Apache2::Request;
9
10 sub handler {
11         my $r = shift;
12         my $dbh = Sesse::pr0n::Common::get_dbh();
13         my $vhost = $r->get_server_name;
14         chomp (my $desc = Sesse::pr0n::Templates::fetch_template($r, 'wizard-description'));
15
16         $r->content_type("application/octet-stream");
17         $r->headers_out->add('Content-disposition' => 'attachment; filename="' . $vhost . '.reg"');
18
19         $r->print("Windows Registry Editor Version 5.00\r\n\r\n");
20         $r->print("[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Currentversion\\Explorer\\PublishingWizard\\PublishingWizard\\Providers\\$vhost]\r\n");
21         $r->print("\"Icon\"=\"http://$vhost/pr0n.ico\"\r\n");
22         $r->print("\"DisplayName\"=\"$vhost\"\r\n");
23         $r->print("\"Description\"=\"$desc\"\r\n");
24         $r->print("\"HREF\"=\"http://$vhost/wizard\"\r\n");
25
26         return Apache2::Const::OK;
27 }
28         
29 1;
30
31