Changeset 351


Ignore:
Timestamp:
Mar 8, 2010, 7:10:11 PM (11 years ago)
Author:
zecrazytux
Message:

Instanciate the backend in Web.pm only

Location:
bearmail/lib/BearMail
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • bearmail/lib/BearMail/Backend.pm

    r350 r351  
    1 package Backend;
     1package BearMail::Backend;
    22
    33# Copyright (C) 2009 Bearstech - http://bearstech.com/
  • bearmail/lib/BearMail/Web.pm

    r350 r351  
    2424use BearMail::Backend;
    2525use Data::Dumper;
     26
    2627
    2728
  • bearmail/lib/BearMail/Web/Address/Edit.pm

    r314 r351  
    2727    my $address = $q->param('address');
    2828
    29     my $be = BearMail::Backend::backend();
    30     my $user = $be->get_user($address);
     29    my $user = $self->{b}->get_user($address);
    3130
    3231    my $type = '';
  • bearmail/lib/BearMail/Web/Address/List.pm

    r314 r351  
    2727    my $domain = $q->param('domain');
    2828
    29     my $be = BearMail::Backend::backend();
    30     my @users = $be->get_users($domain);
     29    my @users = $self->{b}->get_users($domain);
    3130
    3231    my $n = 0;
  • bearmail/lib/BearMail/Web/Domain/List.pm

    r316 r351  
    2424    my $self = shift;
    2525
    26     my $be = BearMail::Backend::backend();
    2726    my @domains = ($self->session->param('level') eq 'postmaster')
    28       ? $be->get_postmaster_domains($self->session->param('user'))
    29       : $be->get_domains();
     27      ? $self->{b}->get_postmaster_domains($self->session->param('user'))
     28      : $self->{b}->get_domains();
    3029
    3130    my $n = 0;
  • bearmail/lib/BearMail/Web/Login.pm

    r316 r351  
    2929    my $pass  = $q->param('password') || '';
    3030
    31     my $b = BearMail::Backend::backend();
    32 
    33     if(exists(%{$self->cfg('admins')}->{$email})
    34        and %{$self->cfg('admins')}->{$email} eq md5_hex($pass)) {
     31    if(($self->cfg('global_postmaster_login') eq $email)
     32        and ($self->cfg('global_postmaster_password') eq md5_hex($pass))) {
    3533
    3634        $self->session->param('user', $email);
     
    4038        return $self->redirect($self->url($intent));
    4139
    42     } elsif(exists(%{$b->get_postmasters()}->{$email})
    43             and %{$b->get_postmasters()}->{$email} eq md5_hex($pass)) {
     40    } elsif(exists(%{$self->{b}->get_postmasters()}->{$email})
     41            and %{$self->{b}->get_postmasters()}->{$email} eq md5_hex($pass)) {
    4442
    4543        $self->session->param('user', $email);
Note: See TracChangeset for help on using the changeset viewer.