/[Arh]/lib/Arh/CurrentUser.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/Arh/CurrentUser.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (show annotations)
Thu Nov 29 19:04:56 2007 UTC (16 years, 4 months ago) by dpavlin
File size: 715 byte(s)
fine-tune permissions for anonymous users
1 use strict;
2 use warnings;
3
4 package Arh::CurrentUser;
5 use base qw/Jifty::CurrentUser Arh::Model::User/;
6
7 use Data::Dump qw/dump/;
8
9 =head2 _init
10
11 This function will load user data from database
12
13 =cut
14
15 sub _init {
16 my $self = shift;
17 my %args = (@_);
18
19 #warn "## _init",dump(@_);
20
21 if ( delete $args{'_bootstrap'} ) {
22 $self->is_bootstrap_user(1);
23 }
24
25 if ( keys %args ) {
26 my $u = Arh::Model::User->new;
27 $u->load_by_cols( %args );
28 if ( $u->id ) {
29 Jifty->log->info("loaded user ",dump( \%args ));
30 $self->user_object( $u );
31 } else {
32 Jifty->log->error("Can't load user ",dump( \%args ));
33 }
34 }
35
36 # be superuser
37 #$self->is_superuser(1);
38
39 #warn "## user_object = ",dump( $self->user_object );
40
41 }
42
43 1;

  ViewVC Help
Powered by ViewVC 1.1.26