summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-06-01 04:34:39 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-06-01 04:34:39 -0700
commit1c50f124afd170e3feaea3163d15c2ece731d67a (patch)
treeb0e0784fcc19e207e019db5e541721da3be6e63b
parent28c9853a2cb8b789eaecf76ed18b4230eee45ca4 (diff)
downloadpiny-code-1c50f124afd170e3feaea3163d15c2ece731d67a.tar.gz
piny-code-1c50f124afd170e3feaea3163d15c2ece731d67a.zip
newrepo.cgi: adding support for --enable/disable-ikiwiki
-rwxr-xr-xpinyweb/cgi-bin/auth/newrepo.cgi16
1 files changed, 14 insertions, 2 deletions
diff --git a/pinyweb/cgi-bin/auth/newrepo.cgi b/pinyweb/cgi-bin/auth/newrepo.cgi
index aa42732..691387d 100755
--- a/pinyweb/cgi-bin/auth/newrepo.cgi
+++ b/pinyweb/cgi-bin/auth/newrepo.cgi
@@ -14,8 +14,20 @@ $q = CGI->new;
print( "Content-type: text/plain\n\n");
if( defined( $q->param('r') ) && defined( $q->param('d') ) ) {
- unless( open2( OUT, IN, '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'newrepo', '--batch', $q->param('r') ) ) {
- die 'could not execute newrepo';
+ if( defined( $q->param('i') && $q->param('i') ~= /0|1/ ) {
+ if( $q->param('i') eq "0" ) {
+ unless( open2( OUT, IN, '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'newrepo', '--batch', '--disable-ikiwiki', $q->param('r') ) ) {
+ die 'could not execute newrepo';
+ };
+ } elsif( $q->param('i') eq "1" ) {
+ unless( open2( OUT, IN, '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'newrepo', '--batch', '--enable-ikiwiki', $q->param('r') ) ) {
+ die 'could not execute newrepo';
+ };
+ };
+ } else {
+ unless( open2( OUT, IN, '/usr/sbin/piny-suid', $ENV{'REMOTE_USER'}, 'newrepo', '--batch', $q->param('r') ) ) {
+ die 'could not execute newrepo';
+ };
};
# make things flushier
select( (select(IN), $| = 1)[0] );