Changeset 5501 for trunk/Nebulous-Server/lib/Nebulous/Server.pm
- Timestamp:
- Nov 10, 2005, 11:51:06 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/lib/Nebulous/Server.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r5498 r5501 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: Server.pm,v 1.1 4 2005-11-10 21:31:26 jhoblitt Exp $3 # $Id: Server.pm,v 1.15 2005-11-10 21:51:06 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server; … … 82 82 { 83 83 type => SCALAR, 84 callbacks => { 85 # check that the volume requested is valid 86 'is valid volume name' => sub { _is_valid_volume_name($_[0]) }, 87 }, 84 88 optional => 1, 85 89 }, … … 97 101 98 102 # check that the comment isn't too long 99 # check that the volume requested is valid100 103 101 104 my $uri; … … 702 705 } 703 706 707 sub _is_valid_volume_name { 708 my $vol_name = shift; 709 710 my $volume; 711 eval { 712 my $query = $db->prepare_cached( $sql->get_volume_by_name ); 713 $query->execute( $vol_name ); 714 ( $volume ) = $query->fetchrow_array; 715 716 $query->finish; 717 }; 718 if ( $@ ) { 719 $db->rollback; 720 $log->logdie( "database error: $@" ); 721 } 722 723 return ( defined $volume ) ? 1 : undef; 724 } 725 704 726 1; 705 727
Note:
See TracChangeset
for help on using the changeset viewer.
