Jonathan,

Here is a simple perl test app that shows how to do it.
#!/usr/bin/perl
use strict; 
# Modules
use LWP::UserAgent;
use HTTP::Request::Common qw(GET POST);

# Variables
# Initialize with default values
my $CCA_Manager = 'https://cca-manager.domain.edu/admin/cisco_api.jsp';
my $CCA_Admin   = '';
my $CCA_Passwd  = '';

print <<USAGE;
This is a test stub.  Please edit the file to change the username, password, and URL
to match your CCA user account.  For descriptions of each function, go to
$CCA_Manager with a web browser.
Uncomment the function below that you want to test.
USAGE

my $success;
my $ua = LWP::UserAgent->new;

# Create a request
my $req;


# Get a list of reports from the CCA Agent logins
# print "Testing getreports\n";
# $req = POST $CCA_Manager,
# 	[   
# 		admin		=>  $CCA_Admin, 
# 		passwd		=>  $CCA_Passwd,
# 		op			=>  'getreports',
# # 		status		=>	'failure',
# 		timeRange	=>  '-12,now',
# 		reqName		=>	'',
# # 		reqName		=>	'Any AV Definitions Check - Audit',
# 		reqStatus	=>	'any',
# 		orderBy		=>	'time',
# 		orderDir	=>  'asc'
# 	];

# Print the Online User list
# print "Testing getuserinfo\n";
# $req = POST $CCA_Manager,
# 	[	
# 		admin		=>  $CCA_Admin, 
# 		passwd		=>  $CCA_Passwd,
# 		op			=>  'getuserinfo',
# 		qtype		=>  'all',
# 		qval		=>	''
# 	];

# Print the Certified User list
# print "Testing getcleanuserinfo\n";
# $req = POST $CCA_Manager,
# 	[	
# 		admin		=>  $CCA_Admin, 
# 		passwd		=>  $CCA_Passwd,
# 		op			=>  'getcleanuserinfo',
# 		qtype		=>  'all',
# 		qval		=>	''
# 	];

# Add a filter by MAC address to a certain role
# print "Testing addmac\n";
# $req = POST $CCA_Manager,
#     [   admin		=>  $CCA_Admin, 
#         passwd		=>  $CCA_Passwd,
#         op			=>  'addmac',
#         type		=>	'userole',
#         role		=>	'Game Console',
# 		mac			=>	'00:02:c7:00:00:00',
# 	    desc		=>	'USERID: test DEVICE TYPE: Game Console CREATED BY: Michael Grinnell  DATE: 05/13/2008 11:45'
# 	];

# Add a filter to exempt a MAC address
# print "Testing addmac\n";
# $req = POST $CCA_Manager,
#     [   admin		=>  $CCA_Admin, 
#         passwd		=>  $CCA_Passwd,
#         op			=>  'addmac',
#         type		=>	'allow',
# 		mac			=>	'00:02:c7:00:00:00',
# 	    desc		=>	'USERID: test DEVICE TYPE: Exempted CREATED BY: Michael Grinnell  DATE: 05/13/2008 11:45'
# 	];

# Remove a filter by MAC address (Doesn't seem to work)
# print "Testing removemac\n";
# $req = POST $CCA_Manager,
#     [   admin		=>  $CCA_Admin, 
#         passwd		=>  $CCA_Passwd,
#         op			=>  'removemac',
# 		mac			=>	'00:02:c7:00:00:00'
# 	];

if ($req) {
	# Pass request to the user agent and get a response back
	my $res = $ua->request($req);
	
	# Check the outcome of the response
	if ($res->is_success) {
		print $res->content, "\n";
	} else {
		print "Error: ";
		print $res->status_line, "\n";
	}
}

__DATA__
# vim:tabstop=4:smartindent:shiftwidth=4



Let me know if you have questions.

Michael Grinnell
Information Security Administrator
The American University

On May 13, 2008, at 1:01 PM, Holman, Jonathan wrote:
Hello,
We have just started on the Clean Access path, and have found ourselves in a bit of a quandary. Does anyone have a recent example of a game console registration page we could modify for our environment? I have already looked at Alex Lanstein's examples and am a bit confused as I have never developed through PHP, being server side myself. A few questions I would have is where is the file functions.php (called in cam_functions.phps)? I have seen a couple people commenting on adding some additional code to get their registration to work, is this a new issue? I suspect that if we can't get this registration page up soon, I may just end up adding in wildcard mac addresses. So the second question would be does anyone have a recent list of mac addresses from the vendors?

Thanks,

Jonathan

Jonathan Holman
System Coordinator, System Support Services
Communication and Information Technologies
Tennessee State University
3500 John Merritt Boulevard
Nashville, Tennessee 37209
(615) 963-7688

Reply via email to