/[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

Annotation of /lib/Arh/CurrentUser.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 23 - (hide annotations)
Fri Nov 30 23:23:14 2007 UTC (12 years ago) by dpavlin
File size: 847 byte(s)
another huge code dump:
- rename database columns to prevent conficts with standards
- added editing accessor to user which returns edit mode
- ToggleEdit action to change editing state (broken)
- tweaks all over templates to make units entry a breeze
- version bump [0.03]
1 dpavlin 10 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 dpavlin 11 #warn "## _init",dump(@_);
20    
21 dpavlin 10 if ( delete $args{'_bootstrap'} ) {
22     $self->is_bootstrap_user(1);
23 dpavlin 11 }
24    
25 dpavlin 23 my $u = Arh::Model::User->new;
26    
27 dpavlin 11 if ( keys %args ) {
28 dpavlin 10 $u->load_by_cols( %args );
29     if ( $u->id ) {
30     Jifty->log->info("loaded user ",dump( \%args ));
31     } else {
32     Jifty->log->error("Can't load user ",dump( \%args ));
33     }
34     }
35    
36 dpavlin 23 $self->user_object( $u );
37    
38 dpavlin 10 # be superuser
39     #$self->is_superuser(1);
40    
41 dpavlin 11 #warn "## user_object = ",dump( $self->user_object );
42    
43 dpavlin 10 }
44    
45 dpavlin 23 sub editing {
46     my $self = shift;
47     die unless $self->current_user->user_object;
48     return $self->current_user->user_object->editing;
49     }
50    
51 dpavlin 10 1;

  ViewVC Help
Powered by ViewVC 1.1.26