16122280bb7ad7fd860eef9052b99277b8baa33d
[www.jankratochvil.net.git] / project / postget / Index.pm
1 # $Id$
2 # Main page of 'My::Project::postget'
3 # Copyright (C) 2003-2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 package project::postget::Index;
20 require 5.6.0;  # at least 'use warnings;' but we need some 5.6.0+ modules anyway
21 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
22 our $CVS_ID=q$Id$;
23 use strict;
24 use warnings;
25
26 use My::Web;
27 Wuse 'project::Lib';
28
29
30 our @ListItem=(
31                 "name"=>"postget",
32                 "platform"=>"web",
33                 "trivia"=>1,
34                 "priority"=>380,
35                 # FIXME: 'http://cvs.jankratochvil.net/viewcvs/' -> $W->{"project_viewcvs"}
36                 "download"=>'http://cvs.jankratochvil.net/viewcvs/'."*checkout*/nethome/WWW/cgi-bin/postget.php?rev=HEAD",
37                 "summary"=>sub {
38                                 return "Bookmark ".a_href('http://www.w3.org/TR/html4/interact/forms.html#h-17.13.1','POST')
39                                                 .' forms, hide passwords';
40                                 },
41                 "license"=>"PD",
42                 "maintenance"=>"ready",
43                 "language"=>"PHP",
44                 "description"=>sub { return <<"HERE"; },
45 <p>You cannot bookmark pre-filled forms to your browser bookmarks. Although
46 browsers support storing of form data you still have to load the form page and
47 click its submit button. This script will allow you to:</p>
48 <ul>
49         <li>Store all @{[ a_href 'http://www.w3.org/TR/html4/interact/forms.html#h-17.13.1','POST' ]}ed
50                         form data as @{[ a_href 'http://www.w3.org/TR/html4/interact/forms.html#h-17.13.1','GET' ]} data
51                         (after '<b>?</b>' URL delimiter).</li>
52         <li>Replace all sensitive passwords by indirect references to your <b>priv</b> directory
53                         to allow you to make your bookmark file itself public.</li>
54 </ul>
55 HERE
56                 );
57
58 sub handler
59 {
60 project::Lib->init();
61
62
63 print <<"HERE";
64
65 <ul>
66         <li>
67                 <p>Store the
68                                 @{[ a_href $W->{"project_viewcvs"}."*checkout*/nethome/WWW/cgi-bin/postget.php?rev=HEAD",'downloaded file' ]}
69                 as <b>/home/lace/WWW/cgi-bin/postget.php</b>.</p>
70         </li>
71         <li>
72                 <p>Edit path to your <b>priv</b> directory in the stored
73                 <b>@{[ a_href $W->{"project_viewcvs"}."*checkout*/nethome/WWW/cgi-bin/postget.php?rev=HEAD",'postget.php' ]}</b>.</p>
74         </li>
75         <li>
76                 <p>Bookmark the following @{[ a_href 'http://freshmeat.net/','Freshmeat' ]} URL:
77                                 @{[ escapeHTML(q{http://localhost/~lace/cgi-bin/postget.php?_postget=http%3A%2F%2Ffreshmeat.net%2Flogin%2F&url=%2F&username=YOUR_USERNAME&password=_priv_postget.freshmeat.net.pwd&persistent=1}) ]}
78                 </p>
79                 <p>(Replace <b>YOUR_USERNAME</b> with your @{[ a_href 'http://freshmeat.net/','Freshmeat' ]}
80                 account name.</p>
81         </li>
82         <li>
83                 <p>Store your @{[ a_href 'http://freshmeat.net/','Freshmeat' ]} account password
84                 to: <b>~/priv/postget.freshmeat.net.pwd</b></p>
85                 <p>Protect it by '<i>chgrp nobody postget.freshmeat.net.pwd</i>' and
86                 '<i>chmod 640 postget.freshmeat.net.pwd</i>' (it is not secure as long as
87                 someone else can supply pages served by the same
88                 @{[ a_href 'http://httpd.apache.org/','Apache webserver' ]}.</p>
89         </li>
90 </ul>
91
92 HERE
93
94
95 exit;
96 }
97 1;