/[Arh]/lib/Arh/Bootstrap.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

Diff of /lib/Arh/Bootstrap.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10 by dpavlin, Thu Nov 29 17:17:16 2007 UTC revision 11 by dpavlin, Thu Nov 29 19:04:56 2007 UTC
# Line 4  use strict; Line 4  use strict;
4  package Arh::Bootstrap;  package Arh::Bootstrap;
5  use base qw(Jifty::Bootstrap);  use base qw(Jifty::Bootstrap);
6    
7    use Data::Dump qw/dump/;
8    
9  =head1 Bootstrap application data  =head1 Bootstrap application data
10    
11  Create initial data  Create initial data
# Line 11  Create initial data Line 13  Create initial data
13  =cut  =cut
14    
15  sub run {  sub run {
16            warn "## run",dump(@_);
17      my $self = shift;      my $self = shift;
18    
19          my $system_user = Arh::CurrentUser->superuser( _bootstrap => 1 );          my $system_user = Arh::CurrentUser->superuser( _bootstrap => 1 );
20    
         my $user = Arh::Model::User->new;  
21    
22          $user->create(          my $u = Arh::Model::User->new(current_user => $system_user);
23    
24            $u->create(
25                  name => 'Admin',                  name => 'Admin',
26                  lastname => 'User',                  lastname => 'User',
27                  email => 'admin@example.com',                  email => 'admin@example.com',
28                  email_confirmed => 1,                  email_confirmed => 1,
29                  password => 'siteadmin',                  password => 'password',
30                  administrator => 1,                  administrator => 1,
31                  organization => 'Site administrator',                  organization => 'Site administrator',
32          );          );
33    
34            $u->create(
35                    name => 'Anonymous',
36                    lastname => 'User',
37                    email => 'anonymous@example.com',
38                    email_confirmed => 1,
39                    password => 'password',
40                    administrator => 0,
41                    organization => 'Part of anonymous user crowd',
42            );
43    
44          my $pt = Arh::Model::PictureType->new(current_user => $system_user);          my $pt = Arh::Model::PictureType->new(current_user => $system_user);
45                    
46          $pt->create( name => $_ ) foreach ( qw/          $pt->create( name => $_ ) foreach ( qw/
# Line 41  namještaj Line 55  namještaj
55          my $chronology = Arh::Model::Chronology->new(current_user => $system_user);          my $chronology = Arh::Model::Chronology->new(current_user => $system_user);
56          $chronology->create(          $chronology->create(
57                  name => 'kraj 8. stoljeća',                  name => 'kraj 8. stoljeća',
58                    from_year => 760,
59                    to_year => 800,
60          );          );
61    
62          my $material = Arh::Model::Material->new;          my $material = Arh::Model::Material->new;

Legend:
Removed from v.10  
changed lines
  Added in v.11

  ViewVC Help
Powered by ViewVC 1.1.26