~ubuntu-branches/debian/sid/bugzilla/sid

« back to all changes in this revision

Viewing changes to Bugzilla/Auth/Login/WWW.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Patrick Davies
  • Date: 2008-05-29 17:20:32 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080529172032-tddh964ztksxayjm
Tags: 3.0.4-0ubuntu1
* New upstream release (LP: #138886, #235701).
* Removed "CVS" directories and ".cvsignore" files from upstream tarball.
* Added patches/ubuntu_01_bugzilla_libpath.dpatch - newly updated as necessary
  version of old 01_libpath.dpatch patch.
* Added patches/01_debian_package_version.dpatch - replaces old patch
  01_VERSION.dpatch, simply changes the version of Bugzilla to show the
  Debian packaging's versioning.
* Added patches/ubuntu_05_makefile_install.dpatch - Use a Makefile to
  install Bugzilla to the correct locations. Based on Makefile in old
  package but in patch form.
* Removed 02_checksetup.dpatch - fixed upstream.
* Removed 101_Config.diff - upstream has changed codebase.
* Renamed 06_contrib.dpatch to ubuntu_02_contrib_shebang_fixes.dpatch -
  corrects 'shebangs' which point to /usr/local/bin/ to /usr/bin/.
* Renamed 08_showdependencygraph.dpatch to
  ubuntu_03_showdependencygraph_url_fixes.dpatch and updated code as
  necessary - fixes graph URL to make the webdot generation possible.
* Removed CVE-2007-0791.dpatch - applied to upstream code.
* Removed CVE-2007-4543.dpatch - applied to upstream code.
* Renamed 09_homelink.dpatch to ubuntu_04_fixed_homepage_linked.dpatch -
  upstream now has links in
  'template/en/default/global/common-links.html.tmpl' instead of
  'useful-links.html.tmpl'.
* Removed 03_webpath.dpatch - upstream has changed stylesheet layout.
* Updated 10_perl_scripts_shebang.dpatch and removed part on "globals.pl" -
  no longer in source.
* Removed Debian vhost support patches (see docs/html/multiple-bz-dbs.html
  for how to run multiple Bugzilla instances):
  - Removed 04_Config.pm.dpatch - duplicate patch and unable to adapt it to
    new upstream code.
  - Removed 07_virtualhosting.dpatch - duplicate patch of
    04_Config.pm.dpatch.
  - Removed 'debian/examples' - contained Apache VHost example setup files
    for Bugzilla.
  - Removed section about vhosts from README.Debian.
* debian/rules:
  - Removed rules for "vhost conf dir", "examples" and "101_Config.diff"
    installation rules.
  - Removed part about bugzilla-fr package.
  - Remved part about "whine.pl" - now in Makefile.
  - Added rules to check the setup with upstream's "checksetup.pl" script.
* debian/control:
  - Updated Standards-Version to 3.7.3.
  - Updated compatibity level and debhelper build dependency version to 6.
  - Added Homepage field to source package stanza.
  - Added part about seeing 'bugzilla' package for more info to
    'bugzilla-docs'.
  - Added libapache2-mod-perl2, libtemplate-perl, libmime-perl,
    libappconfig-perl, libdbd-mysql-perl, libtimedate-perl, libgd-gd2-perl,
    libgd-text-perl, libxml-twig-perl, perlmagick, libemail-send-perl,
    libemail-mime-modifier-perl, libchart-perl, libgd-graph-perl,
    libhtml-scrubber-perl, libdbi-perl, libfile-spec-perl, libgd-graph-perl,
    libgd-text-perl, libnet-ldap-perl, libxml-parser-perl: to build
    dependencies with the necessary versions as stated by upstream in
    docs/html/installation.html - in order to check packaging correctly with
    'checksetup.pl' in rules. Also updated the 'bugzilla' dependencies with
    the above (LP: #235461).
  - Removed dependencies on old "apache" packages as they are no longer in
    the archives.
  - Moved mail transport agents on 'bugzilla' from Depends to
    Suggests (LP: #156405).
* debian/copyright: Updated the downloaded from link.
* debian/bugzilla.docs: Added "QUICKSTART", "rel_notes.txt" and "UPGRADING"
  documentation from source tarball for inclusion in package.
* debian/bugzilla-doc.doc-base: Corrected some spelling mistakes.
* debian/bugzilla.postinst: Removed sections about 101_Config.diff.
* Changed 'X_BUGZILLA_SITE' in bugzilla.cron.daily and bugzilla.postinst to
  'PROJECT'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- Mode: perl; indent-tabs-mode: nil -*-
2
 
#
3
 
# The contents of this file are subject to the Mozilla Public
4
 
# License Version 1.1 (the "License"); you may not use this file
5
 
# except in compliance with the License. You may obtain a copy of
6
 
# the License at http://www.mozilla.org/MPL/
7
 
#
8
 
# Software distributed under the License is distributed on an "AS
9
 
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
 
# implied. See the License for the specific language governing
11
 
# rights and limitations under the License.
12
 
#
13
 
# The Original Code is the Bugzilla Bug Tracking System.
14
 
#
15
 
# The Initial Developer of the Original Code is Netscape Communications
16
 
# Corporation. Portions created by Netscape are
17
 
# Copyright (C) 1998 Netscape Communications Corporation. All
18
 
# Rights Reserved.
19
 
#
20
 
# Contributor(s): Erik Stambaugh <erik@dasbistro.com>
21
 
 
22
 
package Bugzilla::Auth::Login::WWW;
23
 
 
24
 
use strict;
25
 
 
26
 
use Bugzilla::Constants;
27
 
use Bugzilla::Config;
28
 
 
29
 
# $current_login_class stores the name of the login style that succeeded.
30
 
my $current_login_class = undef;
31
 
sub login_class {
32
 
    my ($class, $type) = @_;
33
 
    if ($type) {
34
 
        $current_login_class = $type;
35
 
    }
36
 
    return $current_login_class;
37
 
}
38
 
 
39
 
# can_logout determines if a user may log out
40
 
sub can_logout {
41
 
    return 1 if (login_class && login_class->can_logout);
42
 
    return 0;
43
 
}
44
 
 
45
 
sub login {
46
 
    my ($class, $type) = @_;
47
 
 
48
 
    my $user = Bugzilla->user;
49
 
 
50
 
    # Avoid double-logins, which may confuse the auth code
51
 
    # (double cookies, odd compat code settings, etc)
52
 
    return $user if $user->id;
53
 
 
54
 
    $type = LOGIN_REQUIRED if Bugzilla->cgi->param('GoAheadAndLogIn');
55
 
    $type = LOGIN_NORMAL unless defined $type;
56
 
 
57
 
    # Log in using whatever methods are defined in user_info_class.
58
 
    # Please note the particularly strange way require() and the function
59
 
    # calls are being done, because we're calling a module that's named in
60
 
    # a string. I assure you it works, and it avoids the need for an eval().
61
 
    my $userid;
62
 
    for my $login_class (split(/,\s*/, Param('user_info_class'))) {
63
 
        require "Bugzilla/Auth/Login/WWW/" . $login_class . ".pm";
64
 
        $userid = "Bugzilla::Auth::Login::WWW::$login_class"->login($type);
65
 
        if ($userid) {
66
 
            $class->login_class("Bugzilla::Auth::Login::WWW::$login_class");
67
 
            last;
68
 
        }
69
 
    }
70
 
 
71
 
    if ($userid) {
72
 
        $user = new Bugzilla::User($userid);
73
 
 
74
 
        # Redirect to SSL if required
75
 
        if (Param('sslbase') ne '' and Param('ssl') ne 'never') {
76
 
            Bugzilla->cgi->require_https(Param('sslbase'));
77
 
        }
78
 
        $user->set_flags('can_logout' => $class->can_logout);
79
 
    } else {
80
 
        Bugzilla->logout_request();
81
 
    }
82
 
    return $user;
83
 
}
84
 
 
85
 
sub logout {
86
 
    my ($class, $user, $option) = @_;
87
 
    if (can_logout) {
88
 
        $class->login_class->logout($user, $option);
89
 
    }
90
 
}
91
 
 
92
 
1;
93
 
 
94
 
 
95
 
__END__
96
 
 
97
 
=head1 NAME
98
 
 
99
 
Bugzilla::Auth::Login::WWW - WWW login information gathering module
100
 
 
101
 
=head1 METHODS
102
 
 
103
 
=over
104
 
 
105
 
=item C<login>
106
 
 
107
 
Passes C<login> calls to each class defined in the param C<user_info_class>
108
 
and returns a C<Bugzilla::User> object from the first one that successfully
109
 
gathers user login information.
110
 
 
111
 
=back