Skip to content
Snippets Groups Projects
Select Git revision
1 result Searching

WebSocket.pmod

Blame
  • editversions.cgi 14.91 KiB
    #!/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.1 (the "License"); you may not use this file
    # except in compliance with the License. You may obtain a copy of
    # the License at http://www.mozilla.org/MPL/
    #
    # Software distributed under the License is distributed on an "AS
    # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
    # implied. See the License for the specific language governing
    # rights and limitations under the License.
    #
    # The Original Code is mozilla.org code.
    #
    # The Initial Developer of the Original Code is Holger
    # Schurig. Portions created by Holger Schurig are
    # Copyright (C) 1999 Holger Schurig. All
    # Rights Reserved.
    #
    # Contributor(s): Holger Schurig <holgerschurig@nikocity.de>
    #               Terry Weissman <terry@mozilla.org>
    #
    #
    # Direct any questions on this source code to
    #
    # Holger Schurig <holgerschurig@nikocity.de>
    
    use diagnostics;
    use strict;
    
    require "CGI.pl";
    require "globals.pl";
    
    
    
    
    # TestProduct:  just returns if the specified product does exists
    # CheckProduct: same check, optionally  emit an error text
    # TestVersion:  just returns if the specified product/version combination exists
    # CheckVersion: same check, optionally emit an error text
    
    sub TestProduct ($)
    {
        my $prod = shift;
    
        # does the product exist?
        SendSQL("SELECT product
                 FROM products
                 WHERE product=" . SqlQuote($prod));
        return FetchOneColumn();
    }
    
    sub CheckProduct ($)
    {
        my $prod = shift;
    
        # do we have a product?
        unless ($prod) {
            print "Sorry, you haven't specified a product.";
            PutTrailer();
            exit;
        }
    
        unless (TestProduct $prod) {
            print "Sorry, product '$prod' does not exist.";
            PutTrailer();
            exit;
        }
    }