[Bio] / FigWebServices / SetPassword.cgi Repository:
ViewVC logotype

Annotation of /FigWebServices/SetPassword.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (view) (download)

1 : parrello 1.1 #!/usr/bin/perl -w
2 : olson 1.4 #
3 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
4 :     # for Interpretations of Genomes. All Rights Reserved.
5 :     #
6 :     # This file is part of the SEED Toolkit.
7 : parrello 1.11 #
8 : olson 1.4 # The SEED Toolkit is free software. You can redistribute
9 :     # it and/or modify it under the terms of the SEED Toolkit
10 : parrello 1.11 # Public License.
11 : olson 1.4 #
12 :     # You should have received a copy of the SEED Toolkit Public License
13 :     # along with this program; if not write to the University of Chicago
14 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15 :     # Genomes at veronika@thefig.info or download a copy from
16 :     # http://www.theseed.org/LICENSE.TXT.
17 :     #
18 :    
19 : parrello 1.1
20 :     =head1 Set Password
21 :    
22 :     This script sets a password cookie that can be used to invoke debug mode
23 :     for FIG web sites.
24 :    
25 :     For debugging purposes, you can specify the B<Trace> parameter to
26 :     set the tracing level. For example,
27 :    
28 : parrello 1.11 http://myseedurl/CGI/SetPassword.cgi?Trace=3
29 : parrello 1.1
30 :     runs the standard processing script at a trace level of 3. Normally, only the
31 :     script itself and B<Tracer> tracing are active; however, you can activate other tracing modules
32 :     by appending them to the trace level. Thus,
33 :    
34 : parrello 1.11 http://myseedurl/CGI/SetPassword.cgi?Trace=3%20SimBlocks%20ERDBObject
35 : parrello 1.1
36 :     activates tracing for the similarity block module (C<SimBlocks.pm>) and the data
37 : parrello 1.9 base object (C<ERDBObject.pm>).
38 : parrello 1.1
39 :     =cut
40 :    
41 :     use strict;
42 :     use CGI;
43 :     use Tracer;
44 :    
45 :     # Get the CGI parameters.
46 : parrello 1.5 my $cgi = new CGI;
47 :     my $traceLevel = $cgi->param("Trace");
48 : parrello 1.1 if (!defined $traceLevel) {
49 :     $traceLevel = 0;
50 :     }
51 :     TSetup("$traceLevel Tracer", "HTML");
52 : parrello 1.8 # Compute the cookie domain. Note for NMPDR we want to strip off the subdomain.
53 : parrello 1.6 my $url = $cgi->url(-base => 1);
54 : parrello 1.8 if ($url =~ /(\.nmpdr\.org)/i) {
55 :     $url = ".nmpdr.org";
56 :     } else {
57 : parrello 1.7 $url = undef;
58 :     }
59 : parrello 1.8
60 : parrello 1.7 # Compute the tracing key.
61 :     my $traceKey = $cgi->param('TraceKey');
62 : parrello 1.5 # Create the cookies. The debug mode cookie uses the password, and the IP address cookie
63 :     # is computed using the standard session ID code.
64 :     my $newCookie1 = CGI::cookie(-name => 'DebugMode', -value => $cgi->param("Password"));
65 : parrello 1.7 my $newCookie2 = CGI::cookie(-name => 'IP', -value => $traceKey,
66 : parrello 1.6 -domain => $url);
67 : parrello 1.3 # Get the documentation URL
68 : parrello 1.5 my $docURL = $cgi->param("DocURL");
69 :     # Set the cookies and start SetObject.
70 : parrello 1.1
71 : parrello 1.5 print CGI::redirect(-cookie => [$newCookie1, $newCookie2], -location => "SetObject.cgi?Docs=$docURL");
72 : parrello 1.1
73 : parrello 1.11 1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3