Changeset 185
- Timestamp:
- 12/24/10 21:20:04 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Admin.pm
r104 r185 77 77 } 78 78 79 sub remove_media :XMLRPC { 80 my ( $self, $c, $distribspec, $medianame) = @_; 81 82 my $med = $c->model('Base::Medias')->find( 83 { 84 label => $medianame, 85 d_arch => $c->model('Base')->resultset('Distribution') 86 ->search(name => $distribspec->{distribution}) 87 ->search_related('Release', version => $distribspec->{release}) 88 ->search_related('Arch', arch => 89 $distribspec->{arch})->next->d_arch_key, 90 } 91 ); 92 93 if ($med->delete) { 94 $c->stash->{xmlrpc} = 'OK'; 95 $c->model('Base')->storage->dbh->commit; 96 } else { 97 $c->stash->{xmlrpc} = "Cannot delete $medianame"; 98 } 99 } 100 79 101 sub list_path :XMLRPC { 80 102 my ($self, $c, $distribution, $version, $arch, $media) = @_; … … 197 219 } 198 220 221 sub remove_path : XMLRPC { 222 my ($self, $c, $path) = @_; 223 224 my $dpath = $c->model('Base::Paths')->find({ 225 path => $path, 226 }) or do { 227 return $c->stash->{xmlrpc} = 'Path not found'; 228 }; 229 230 231 $dpath->delete and $c->model('Base')->storage->dbh->commit; 232 return $c->stash->{xmlrpc} = 'OK'; 233 } 234 235 199 236 sub dump_distrib : XMLRPC { 200 237 my ($self, $c, $distribution, $version, $arch) = @_;
Note: See TracChangeset
for help on using the changeset viewer.