Skip to content

Commit

Permalink
Initial import from CMU NetReg 1.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
fsweetser committed Jan 4, 2012
0 parents commit 3f8e4ed
Show file tree
Hide file tree
Showing 662 changed files with 128,799 additions and 0 deletions.
13,071 changes: 13,071 additions & 0 deletions ChangeLog

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
For installation and configuration instructions, please see the
NetReg Adminstrator's Manual section of the NetReg Wiki.

The Wiki is available at:
http://netreg-wiki.andrew.cmu.edu/twiki/bin/view/Netreg

And the administrator's manual is at:
http://netreg-wiki.andrew.cmu.edu/twiki/bin/view/Netreg/NetRegManual

6 changes: 6 additions & 0 deletions bin/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AuthType KWeb
AuthName kweb
<LIMIT GET POST>
#require valid-user
require user *@ANDREW.CMU.EDU
</LIMIT>
6 changes: 6 additions & 0 deletions bin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<body bgcolor=white>
This does not exist.
</body>
</html>
153 changes: 153 additions & 0 deletions bin/nc.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
#! /usr/bin/perl
#
# Copyright (c) 2000-2002 Carnegie Mellon University. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. The name "Carnegie Mellon University" must not be used to endorse or
# promote products derived from this software without prior written
# permission. For permission or any legal details, please contact:
# Office of Technology Transfer
# Carnegie Mellon University
# 5000 Forbes Avenue
# Pittsburgh, PA 15213-3890
# (412) 268-4387, fax: (412) 268-7395
# [email protected]
#
# 4. Redistributions of any form whatsoever must retain the following
# acknowledgment: "This product includes software developed by Computing
# Services at Carnegie Mellon University (http://www.cmu.edu/computing/)."
#
# CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
# IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR ANY SPECIAL,
# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#

use strict;

use lib '/home/netreg/lib';

use Data::Dumper;
use CGI qw/:standard/;
my $q = new CGI;
use CMU::WebInt;
use CMU::Netdb;
use CMU::Netdb::reports;
use CMU::WebInt::helper;
use CMU::WebInt::interface;
use POSIX qw/ctime/;

my ($LOGOUT_URL, $LOGOUT_TEXT, $SYSTEM_MAIN_URL, $COOKIE_DESTROY, $vres);

($vres, $LOGOUT_URL) = CMU::Netdb::config::get_multi_conf_var('webint',
'LOGOUT_URL');
($vres, $LOGOUT_TEXT) = CMU::Netdb::config::get_multi_conf_var('webint',
'LOGOUT_TEXT');
($vres, $SYSTEM_MAIN_URL) = CMU::Netdb::config::get_multi_conf_var
('webint', 'SYSTEM_MAIN_URL');
($vres, $COOKIE_DESTROY) = CMU::Netdb::config::get_multi_conf_var
('webint', 'COOKIE_DESTROY');

my @SquishCookies;
my @CD;
if (ref $COOKIE_DESTROY eq 'ARRAY') {
@CD = @$COOKIE_DESTROY;
}else{
@CD = [$COOKIE_DESTROY];
}


foreach my $CName (@CD) {
my ($Name, $Domain) = ('', '');
if ($CName =~ /\@/) {
($Name, $Domain) = split('@', $CName, 2);
}else{
$Name = $CName;
}

if ($Domain ne '') {
push(@SquishCookies, $q->cookie(-name => $Name, -value => '', -path => '/',
-domain => $Domain, -expires => 'now', -secure => 1));
}else{
push(@SquishCookies, $q->cookie(-name => $Name, -value => '', -path => '/',
-expires => 'now', -secure => 1));
}
}

print $q->header(-cookie => \@SquishCookies,
-title => 'NetReg Logout');

if ($LOGOUT_URL ne '') {
print $q->start_html(-title => 'NetReg Logout',
-BGCOLOR => 'white',
-head=>meta({-http_equiv => 'Refresh',
-content => "60;url=$LOGOUT_URL"}));
}else{
print $q->start_html(-title => 'NetReg Logout',
-BGCOLOR => 'white');
}
print "<img src=/img/netreg.jpg><br>\n";

&title("Network Registration Signoff");

my $now = ctime(time());
chomp($now);

print "<hr><br>\n";

my $dbh = db_connect();
my $lsref = list_scheduled($dbh, 'netreg', '');
if (ref $lsref) {
shift(@$lsref);

print "<table width=610><tr><td>";
print CMU::WebInt::subHeading("Logoff");
print "<font face=\"Arial,Helvetica,Geneva,Charter\">";
print "<ul>\n";
print "<li>You have been signed off from the NetReg system as of: $now.\n";

if ($LOGOUT_URL ne '' &&
$LOGOUT_TEXT ne '') {
print "<li>$LOGOUT_TEXT\n";
}
print "<li>If you would like to continue using NetReg, ".
"<a href=\"$SYSTEM_MAIN_URL\">click here</a>.\n";
print "</ul></font>\n";

print subHeading("System Updates").
"<i>Note: In most cases, DNS and DHCP propagation is complete within 15 minutes following
the \"Next Update\" time.
\n</i><br>\n";
print "<table border=1><tr bgcolor=$CMU::WebInt::interface::TACOLOR><th><font face=\"Arial,Helvetica,Geneva,Charter\">System</th>
<th><font face=\"Arial,Helvetica,Geneva,Charter\">Last Update</th>
<th><font face=\"Arial,Helvetica,Geneva,Charter\">Next Update</th></tr>\n";

foreach(@$lsref) {
if ($_->[4] eq 'Create DNS Zones') {
print "<tr><td><b><font face=\"Arial,Helvetica,Geneva,Charter\">DNS</b></td>
<td>".$_->[2]."</td><td>".$_->[3]."</td></tr>\n";
}elsif($_->[4] eq 'Create DHCP Configuration') {
print "<tr><td><b><font face=\"Arial,Helvetica,Geneva,Charter\">DHCP</b></td>
<td>".$_->[2]."</td><td>".$_->[3]."</td></tr>\n";
}elsif($_->[4] eq 'Enable/Disable Ports') {
print "<tr><td><b><font face=\"Arial,Helvetica,Geneva,Charter\">Outlet Enabling</b></td>
<td>".$_->[2]."</td><td>".$_->[3]."</td></tr>\n";
}
}
print "</table>\n";
}

print stdftr($q);

99 changes: 99 additions & 0 deletions bin/netreg-nonint.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/usr/bin/perl
#
# netreg-nonint.pl
#
# This is the script that will be used by programs accessing netreg
# remotely. I.e. not user access, non-interactive access.
#
# Copyright (c) 2000-2002 Carnegie Mellon University. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. The name "Carnegie Mellon University" must not be used to endorse or
# promote products derived from this software without prior written
# permission. For permission or any legal details, please contact:
# Office of Technology Transfer
# Carnegie Mellon University
# 5000 Forbes Avenue
# Pittsburgh, PA 15213-3890
# (412) 268-4387, fax: (412) 268-7395
# [email protected]
#
# 4. Redistributions of any form whatsoever must retain the following
# acknowledgment: "This product includes software developed by Computing
# Services at Carnegie Mellon University (http://www.cmu.edu/computing/)."
#
# CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
# IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR ANY SPECIAL,
# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# $Id: netreg-nonint.pl,v 1.6 2008/03/27 19:42:08 vitroth Exp $
#
# $Log: netreg-nonint.pl,v $
# Revision 1.6 2008/03/27 19:42:08 vitroth
# Merging changes from duke merge branch to head, with some minor type corrections
# and some minor feature additions (quick jump links on list pages, and better
# handling of partial range allocations in the subnet map)
#
# Revision 1.5.22.1 2007/10/04 22:00:00 vitroth
# commit duke changes in /bin (trivial changes)
#
# Revision 1.5.20.1 2007/09/20 18:42:58 kevinm
# Committing all local changes to CVS repository
#
# Revision 1.1.1.1 2004/11/17 18:12:39 kcmiller
#
#
# Revision 1.5 2002/08/11 16:21:54 kevinm
# * Removed non-useful path
#
# Revision 1.4 2002/01/30 21:48:48 kevinm
# Fixed copyright
#
# Revision 1.3 2001/11/29 06:53:46 kevinm
# Added deptadmin clear
#
# Revision 1.2 2001/07/20 22:22:19 kevinm
# Copyright info
#
# Revision 1.1 2001/06/25 19:18:08 vitroth
# Initial checkin of netreg noninteractive interface. Partially implemented.
#
#
#

use strict;

use lib '/home/netreg/lib';

use CMU::NonInt;
use CMU::Netdb;
use CGI::Carp qw(fatalsToBrowser);
use CGI;# qw(-debug);

my $q = new CGI;

my $op = $q->param('op');
CMU::Netdb::auth::clear_user_admin_status();
CMU::Netdb::auth::clear_user_group_admin_status();
CMU::Netdb::auth::clear_user_deptadmin_status();

if ($op eq '' || !defined $CMU::NonInt::vars::opcodes{$op}) {
die "No operation specified, $op";
} else {
$CMU::NonInt::vars::opcodes{$op}->($q);
};


43 changes: 43 additions & 0 deletions bin/netreg-soap.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /usr/bin/perl

use strict;
use lib "/usr/ng/lib/perl5";
use SOAP::Transport::HTTP;

my $debug = 2;

# FCGI module available?
if (eval "require FCGI") {
# Well known FastCGI bug workaround
my $ignore;
while (($ignore) = each %ENV) {
}

# Are we running under FastCGI?
my $req = FCGI::Request();
my $is_fcgi = $req->IsFastCGI();
if ($is_fcgi) {
warn "FastCGI? yes." if ($debug >= 2);

while ($req->Accept() >= 0) {
SOAP::Transport::HTTP::CGI
-> dispatch_to("CMU::Netdb::SOAPAccess")
-> handle
;
}
exit;
} else {
warn "FastCGI? no." if ($debug >= 2);
# Fall through to non-FCGI case
}

}

# running without FCGI

SOAP::Transport::HTTP::CGI
-> dispatch_to("CMU::Netdb::SOAPAccess")
-> handle
;


43 changes: 43 additions & 0 deletions bin/netreg-usermaint-soap.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /usr/bin/perl

use strict;
use lib "/usr/ng/lib/perl5";
use SOAP::Transport::HTTP;

my $debug = 2;

# FCGI module available?
if (eval "require FCGI") {
# Well known FastCGI bug workaround
my $ignore;
while (($ignore) = each %ENV) {
}

# Are we running under FastCGI?
my $req = FCGI::Request();
my $is_fcgi = $req->IsFastCGI();
if ($is_fcgi) {
warn "FastCGI? yes." if ($debug >= 2);

while ($req->Accept() >= 0) {
SOAP::Transport::HTTP::CGI
-> dispatch_to("CMU::Netdb::UserMaint::SOAPAccess")
-> handle
;
}
exit;
} else {
warn "FastCGI? no." if ($debug >= 2);
# Fall through to non-FCGI case
}

}

# running without FCGI

SOAP::Transport::HTTP::CGI
-> dispatch_to("CMU::Netdb::UserMaint::SOAPAccess")
-> handle
;


Loading

0 comments on commit 3f8e4ed

Please sign in to comment.