57 lines
1 KiB
Perl
57 lines
1 KiB
Perl
#! /usr/bin/env perl
|
|
|
|
use v5.10.1;
|
|
use strict;
|
|
use warnings;
|
|
use Carp;
|
|
use Pod::Usage;
|
|
|
|
use ACU::Config;
|
|
use ACU::Log;
|
|
use ACU::LDAP;
|
|
use ACU::Grading;
|
|
use ACU::Process;
|
|
use ACU::Trace;
|
|
|
|
use intradata_get::defense;
|
|
use intradata_get::grades;
|
|
use intradata_get::project;
|
|
|
|
our $intradata;
|
|
|
|
my %actions = (
|
|
"defense" => {
|
|
"update" => \&update_defense,
|
|
},
|
|
"grades" => {
|
|
"new_bonus" => \&grades_new_bonus,
|
|
"generate" => \&grades_generate,
|
|
},
|
|
"project" => {
|
|
"create" => \&update_project,
|
|
"update" => \&update_project,
|
|
"delete" => \&delete_project,
|
|
},
|
|
"traces" => {
|
|
"update" => \&update_trace,
|
|
}
|
|
);
|
|
|
|
|
|
|
|
sub process_get
|
|
{
|
|
my ($given_args, $args) = @_;
|
|
|
|
my $type = $args->{param}{type};
|
|
my $action = $args->{param}{action} // "update";
|
|
|
|
if (! exists $actions{$type}{$action}) {
|
|
log WARN, "Unknown action '$action' for $type.";
|
|
return "Unknown action '$action' for $type.";
|
|
}
|
|
|
|
return $actions{$type}{$action}($args);
|
|
}
|
|
|
|
Process::register("intradata_get", \&process_get);
|