diff --git a/src/Hydra/lib/Hydra/Controller/Root.pm b/src/Hydra/lib/Hydra/Controller/Root.pm index 156088ea..f7dba4cd 100644 --- a/src/Hydra/lib/Hydra/Controller/Root.pm +++ b/src/Hydra/lib/Hydra/Controller/Root.pm @@ -310,7 +310,7 @@ sub releases :Local { return requireLogin($c) if !$c->user_exists; return error($c, "Only the project owner or the administrator can perform this operation.") - unless $c->check_user_roles('admin') || $c->user->username eq $project->owner; + unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username; if ($subcommand eq "edit") { $c->stash->{template} = 'edit-releaseset.tt'; @@ -359,7 +359,7 @@ sub create_releaseset :Local { return requireLogin($c) if !$c->user_exists; return error($c, "Only the project owner or the administrator can perform this operation.") - unless $c->check_user_roles('admin') || $c->user->username eq $project->owner; + unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username; if (defined $subcommand && $subcommand eq "submit") { eval { @@ -552,7 +552,7 @@ sub project :Local { return requireLogin($c) if !$c->user_exists; return error($c, "Only the project owner or the administrator can perform this operation.") - unless $c->check_user_roles('admin') || $c->user->username eq $project->owner; + unless $c->check_user_roles('admin') || $c->user->username eq $project->owner->username; if ($subcommand eq "edit") { $c->stash->{edit} = 1; @@ -594,12 +594,13 @@ sub createproject :Local { if (defined $subcommand && $subcommand eq "submit") { eval { - my $projectName = $c->request->params->{name}; + my $projectName = trim $c->request->params->{name}; $c->model('DB')->schema->txn_do(sub { # Note: $projectName is validated in updateProject, # which will abort the transaction if the name isn't - # valid. - my $project = $c->model('DB::Projects')->create({name => $projectName, displayname => ""}); + # valid. Idem for the owner. + my $project = $c->model('DB::Projects')->create( + {name => $projectName, displayname => "", owner => trim $c->request->params->{owner}}); updateProject($c, $project); }); return $c->res->redirect($c->uri_for("/project", $projectName)); diff --git a/src/Hydra/lib/Hydra/Schema.pm b/src/Hydra/lib/Hydra/Schema.pm index abd1e599..b4568467 100644 --- a/src/Hydra/lib/Hydra/Schema.pm +++ b/src/Hydra/lib/Hydra/Schema.pm @@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema'; __PACKAGE__->load_classes; -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jJnmW70e1RDsSt5ClahomQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RmC02q4hhhk/Vs/2O97L5w # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Buildinputs.pm b/src/Hydra/lib/Hydra/Schema/Buildinputs.pm index 917c3a69..b128cc02 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildinputs.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildinputs.pm @@ -36,8 +36,8 @@ __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:R1F2JbVygktvK55xmY8mcg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ysEtYtg8L5z3W6dyFzXy9A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Buildproducts.pm b/src/Hydra/lib/Hydra/Schema/Buildproducts.pm index 2cf8cd89..26e51229 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildproducts.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildproducts.pm @@ -33,8 +33,8 @@ __PACKAGE__->set_primary_key("build", "productnr"); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aZuZd+oUAO1c8GvSbgn7Fw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/OlaD8I5rojLRBbAL+C/qw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm b/src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm index 09544b03..44857e2e 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm @@ -24,13 +24,15 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0, size => undef }, "releasename", { data_type => "text", is_nullable => 0, size => undef }, + "keep", + { data_type => "integer", is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QahlwGdZKC7mL7fvwNxWjA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cl2tJxeh476i1qzp28BB4g # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Builds.pm b/src/Hydra/lib/Hydra/Schema/Builds.pm index 32261994..9d6fda34 100644 --- a/src/Hydra/lib/Hydra/Schema/Builds.pm +++ b/src/Hydra/lib/Hydra/Schema/Builds.pm @@ -70,8 +70,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uRSa4YkaRG0K6vK/qhGI9w +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UX6GChi62wrJdc3eYRtCyQ __PACKAGE__->has_many(dependents => 'Hydra::Schema::Buildinputs', 'dependency'); diff --git a/src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm b/src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm index 1b896310..6b4a5492 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm @@ -18,6 +18,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0, size => undef }, "logfile", { data_type => "text", is_nullable => 0, size => undef }, + "disabled", + { data_type => "integer", is_nullable => 0, size => undef }, "starttime", { data_type => "integer", is_nullable => 0, size => undef }, ); @@ -25,8 +27,8 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xBocoeipFdRsWDhvtoXImA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M45MbodAbVDwSiQDsw3erA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Buildsteps.pm b/src/Hydra/lib/Hydra/Schema/Buildsteps.pm index 5ac2afc1..aaf6fde4 100644 --- a/src/Hydra/lib/Hydra/Schema/Buildsteps.pm +++ b/src/Hydra/lib/Hydra/Schema/Buildsteps.pm @@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr"); __PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:04BankpQ6xo6T/ioMTdWkQ +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZAv//9TF7lfoaKCDdCLFNw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Cachedpathinputs.pm b/src/Hydra/lib/Hydra/Schema/Cachedpathinputs.pm index ada7c572..68823a5c 100644 --- a/src/Hydra/lib/Hydra/Schema/Cachedpathinputs.pm +++ b/src/Hydra/lib/Hydra/Schema/Cachedpathinputs.pm @@ -22,8 +22,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("srcpath", "sha256hash"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Nq3TpcRmpSRWNL4Q1hGGrA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FJxFwR19zFl2zEcAchDCLg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Cachedsubversioninputs.pm b/src/Hydra/lib/Hydra/Schema/Cachedsubversioninputs.pm index 776ace25..846432a2 100644 --- a/src/Hydra/lib/Hydra/Schema/Cachedsubversioninputs.pm +++ b/src/Hydra/lib/Hydra/Schema/Cachedsubversioninputs.pm @@ -20,8 +20,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("uri", "revision"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CCbHomM+8BTBqHBeGOGcuA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dOpp84bWlqOwiHPe8bsZhQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm b/src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm index 1c2dddaa..c13f0263 100644 --- a/src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm +++ b/src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm @@ -22,8 +22,6 @@ __PACKAGE__->add_columns( { data_type => "integer", is_nullable => 0, size => undef }, "tag", { data_type => "text", is_nullable => 0, size => undef }, - "boolean", - { data_type => "integer", is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("project", "jobset", "input", "altnr"); __PACKAGE__->belongs_to( @@ -33,8 +31,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JPf4ozBKK6NQPJT2few40g +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SXp0Jc4rBeGfm2RajVLJmw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm b/src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm index 53abdc06..edcb83d0 100644 --- a/src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm +++ b/src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm @@ -43,8 +43,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:S8z1W0kjUX9VN5HPjyGAzA +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:miVk9N1PJ3HxZVBlMVgxFA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Jobsets.pm b/src/Hydra/lib/Hydra/Schema/Jobsets.pm index 1573305d..56cda308 100644 --- a/src/Hydra/lib/Hydra/Schema/Jobsets.pm +++ b/src/Hydra/lib/Hydra/Schema/Jobsets.pm @@ -50,8 +50,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ebblUCTW7I1wGhVlPfNd3Q +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QTfecLOgMWmoaFLt5Yh2Uw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Projects.pm b/src/Hydra/lib/Hydra/Schema/Projects.pm index 450d30a1..fefb6a7d 100644 --- a/src/Hydra/lib/Hydra/Schema/Projects.pm +++ b/src/Hydra/lib/Hydra/Schema/Projects.pm @@ -25,6 +25,7 @@ __PACKAGE__->has_many( "Hydra::Schema::Builds", { "foreign.project" => "self.name" }, ); +__PACKAGE__->belongs_to("owner", "Hydra::Schema::Users", { username => "owner" }); __PACKAGE__->has_many( "jobsets", "Hydra::Schema::Jobsets", @@ -42,8 +43,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:70/Br6966ZZ+p8n6lF1hcw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:I8vNdExrfd/eGfHeZRQ21A # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Releasesetjobs.pm b/src/Hydra/lib/Hydra/Schema/Releasesetjobs.pm index 875ff915..be055d42 100644 --- a/src/Hydra/lib/Hydra/Schema/Releasesetjobs.pm +++ b/src/Hydra/lib/Hydra/Schema/Releasesetjobs.pm @@ -32,8 +32,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t2ZI1kBn/GsKlY0e4+Wspg +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:m3ADAo2XKQ1Mu5JdNa3FFw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Releasesets.pm b/src/Hydra/lib/Hydra/Schema/Releasesets.pm index cd6876f8..8eeb656b 100644 --- a/src/Hydra/lib/Hydra/Schema/Releasesets.pm +++ b/src/Hydra/lib/Hydra/Schema/Releasesets.pm @@ -29,8 +29,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pNqwNlXuENM/SsZ/utKhWw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2SXTc8MC9KG9VM0uRHUwig # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Systemtypes.pm b/src/Hydra/lib/Hydra/Schema/Systemtypes.pm index fc122ed0..b9670d64 100644 --- a/src/Hydra/lib/Hydra/Schema/Systemtypes.pm +++ b/src/Hydra/lib/Hydra/Schema/Systemtypes.pm @@ -16,8 +16,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("system"); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WeoKp84cptljEdtD+5l7Ug +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AyTEOJr+JjRxJpI1ITG1Tw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Userroles.pm b/src/Hydra/lib/Hydra/Schema/Userroles.pm index 3fab2beb..76147b5d 100644 --- a/src/Hydra/lib/Hydra/Schema/Userroles.pm +++ b/src/Hydra/lib/Hydra/Schema/Userroles.pm @@ -17,8 +17,8 @@ __PACKAGE__->set_primary_key("username", "role"); __PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" }); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WxjgPLWPvXpQ3nmxmlU7Dw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5dAhmCyy7/B75rfHAhvNLw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/lib/Hydra/Schema/Users.pm b/src/Hydra/lib/Hydra/Schema/Users.pm index 366409a5..2ff9aff8 100644 --- a/src/Hydra/lib/Hydra/Schema/Users.pm +++ b/src/Hydra/lib/Hydra/Schema/Users.pm @@ -18,6 +18,11 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0, size => undef }, ); __PACKAGE__->set_primary_key("username"); +__PACKAGE__->has_many( + "projects", + "Hydra::Schema::Projects", + { "foreign.owner" => "self.username" }, +); __PACKAGE__->has_many( "userroles", "Hydra::Schema::Userroles", @@ -25,8 +30,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-27 14:48:09 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:s+M14nuDVIMoRSgXodj3dw +# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-28 18:56:45 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xAAXMAwZYAD5ICFz1dEpKQ # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/src/Hydra/root/project.tt b/src/Hydra/root/project.tt index 3fd2d69f..268ff83b 100644 --- a/src/Hydra/root/project.tt +++ b/src/Hydra/root/project.tt @@ -169,7 +169,7 @@ Owner: - [% INCLUDE maybeEditString param="owner" value=curProject.owner edit=(edit && c.check_user_roles('admin')) %] + [% INCLUDE maybeEditString param="owner" value=curProject.owner.username edit=(edit && c.check_user_roles('admin')) %] Enabled: