/[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 23 - (show annotations)
Fri Nov 30 23:23:14 2007 UTC (11 years, 11 months 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 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 my $u = Arh::Model::User->new;
26
27 if ( keys %args ) {
28 $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 $self->user_object( $u );
37
38 # be superuser
39 #$self->is_superuser(1);
40
41 #warn "## user_object = ",dump( $self->user_object );
42
43 }
44
45 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 1;

  ViewVC Help
Powered by ViewVC 1.1.26