#!/usr/bin/perl
#$Id: check_user_auth.pl,v 1.1 2021/02/05 07:10:59 sqko Exp $
use strict;
use warnings;
use RFC::RFCCGI;
use RFC::Main;
my $u = shift;
my $p = shift;
my $allow = 0;
my $authid = &get_cv('global','data_access_authorisationid');
if ($authid)
{
    $allow = &RFC::Main::passwd_client('safety_auth',$u,$authid);
    my $uid = &RFC::RFCCGI::user_ok($u,$p);
    $allow = 0 unless ($uid);
}
else
{
    $allow = 1;
}
print $allow;
