2012-02-13 Vanessa Gil <vanessa.gil@artica.es>

* util/pandora_manage.pl: Changed Event validate given id.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5571 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2012-02-13 14:07:02 +00:00
parent bf4c0f1553
commit da7091204b
2 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2012-02-13 Vanessa Gil <vanessa.gil@artica.es>
* util/pandora_manage.pl: Changed Event validate given id.
2012-02-13 Junichi Satoh <junichi@rworks.jp> 2012-02-13 Junichi Satoh <junichi@rworks.jp>
* FreeBSD/pandora_server.conf: Changed the plugin_exec to 'gtimeout'. * FreeBSD/pandora_server.conf: Changed the plugin_exec to 'gtimeout'.

View File

@ -2358,6 +2358,9 @@ sub cli_validate_event() {
sub cli_validate_event_id() { sub cli_validate_event_id() {
my $id_event = @ARGV[2]; my $id_event = @ARGV[2];
my $event_name = pandora_get_event_name($dbh, $id_event);
exist_check($event_name,'event',$id_event);
print "[INFO] Validating event '$id_event'\n\n"; print "[INFO] Validating event '$id_event'\n\n";
my $result = pandora_validate_event_id ($conf, $id_event, $dbh); my $result = pandora_validate_event_id ($conf, $id_event, $dbh);
@ -3052,6 +3055,18 @@ sub cli_module_get_data () {
exit; exit;
} }
##############################################################################
# Return event name given a event id
##############################################################################
sub pandora_get_event_name($$) {
my ($dbh,$id_event) = @_;
my $event_name = get_db_value($dbh, 'SELECT evento FROM tevento WHERE id_evento = ?',$id_event);
return defined ($event_name) ? $event_name : -1;
}
############################################################################### ###############################################################################
############################################################################### ###############################################################################
# MAIN # MAIN