Archived
1
0
Fork 0
This repository has been archived on 2021-10-08. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
ACU/process/files/intradata_get.pl
2013-10-12 03:05:11 +02:00

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);