summaryrefslogtreecommitdiff
path: root/pinyweb/cgi-bin/auth/pinyconfig.cgi
blob: 1bb03e93820d5b1c362b1e4724ace3ebf1d61100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl
$| = 1;

use warnings;

use CGI;

use IPC::Open2;

$q = CGI->new;

print( "Content-type: text/plain\n\n");

open(STDERR, ">&STDOUT");

if( defined( $q->param('r') ) && defined( $q->param('n') ) && defined( $q->param('v') ) ) {
  unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'pinyconfig', scalar( $q->param('r') ), scalar( $q->param('n') ), scalar( $q->param('v') ) ) == 0 ) {
    die( 'pinyconfig was unsuccessful.' );
  };
} elsif( defined( $q->param('r') ) ) {
  unless( system( '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'pinyconfig', scalar( $q->param('r') ) ) == 0 ) {
    die( 'pinyconfig was unsuccessful.' );
  };
} else {
  print 'Missing parameters.';
};