From 4727e6c09f88e63f02e6c8f359862d0c0942ed36 Mon Sep 17 00:00:00 2001 From: "terry%netscape.com" <> Date: Wed, 16 Sep 1998 04:49:23 +0000 Subject: Everything has been ported to now run under Perl. --- editparams.cgi | 117 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 51 deletions(-) (limited to 'editparams.cgi') diff --git a/editparams.cgi b/editparams.cgi index a95fe8d92..c1c885b63 100755 --- a/editparams.cgi +++ b/editparams.cgi @@ -1,5 +1,5 @@ -#! /usr/bonsaitools/bin/mysqltcl -# -*- Mode: tcl; indent-tabs-mode: nil -*- +#!/usr/bonsaitools/bin/perl -w +# -*- Mode: perl; indent-tabs-mode: nil -*- # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in @@ -20,66 +20,81 @@ # Contributor(s): Terry Weissman -source "CGI.tcl" -source "defparams.tcl" +use diagnostics; +use strict; -confirm_login +require "CGI.pl"; +require "defparams.pl"; -puts "Content-type: text/html\n" +# Shut up misguided -w warnings about "used only once": +use vars @::param_desc, + @::param_list, + %::COOKIE; -if {![cequal [Param "maintainer"] $COOKIE(Bugzilla_login)]} { - puts "

Sorry, you aren't the maintainer of this system.

" - puts "And so, you aren't allowed to edit the parameters of it." - exit +confirm_login(); + +print "Content-type: text/html\n\n"; + +if (Param("maintainer") ne $::COOKIE{Bugzilla_login}) { + print "

Sorry, you aren't the maintainer of this system.

\n"; + print "And so, you aren't allowed to edit the parameters of it.\n"; + exit; } -PutHeader "Edit parameters" "Edit parameters" - -puts "This lets you edit the basic operating parameters of bugzilla. Be careful!" -puts "

" -puts "Any item you check Reset on will get reset to its default value." - -puts "

" - -set rowbreak "" -puts $rowbreak - -foreach i $param_list { - puts "" - puts "

$i:$param_desc($i)
Reset" - set value [Param $i] - switch $param_type($i) { - t { - puts "" - } - l { - puts "" - } - b { - if {$value} { - set on "checked" - set off "" +PutHeader("Edit parameters"); + +print "This lets you edit the basic operating parameters of bugzilla.\n"; +print "Be careful!\n"; +print "

\n"; +print "Any item you check Reset on will get reset to its default value.\n"; + +print "\n"; + +my $rowbreak = ""; +print $rowbreak; + +foreach my $i (@::param_list) { + print "\n"; + print "" - puts $rowbreak + print "\n"; + print $rowbreak; } -puts "

$i:$::param_desc{$i}
Reset\n"; + my $value = Param($i); + SWITCH: for ($::param_type{$i}) { + /^t$/ && do { + print "\n'; + last SWITCH; + }; + /^l$/ && do { + print "\n"; + last SWITCH; + }; + /^b$/ && do { + my $on; + my $off; + if ($value) { + $on = "checked"; + $off = ""; } else { - set on "" - set off "checked" + $on = ""; + $off = "checked"; } - puts "On " - puts "Off" - } - default { - puts "Unknown param type $param_type($i)!!!" - } + print "On\n"; + print "Off\n"; + last SWITCH; + }; + # DEFAULT + print "Unknown param type $::param_type{$i}!!!\n"; } - puts "
" +print "

\n"; -puts "
" -puts "" +print "
\n"; +print "\n"; -puts "
" +print "\n"; -puts "

Skip all this, and go back to the query page" +print "

Skip all this, and go back to the query page\n"; -- cgit v1.2.3-24-g4f1b