Restricting access to on-campus users with PHP

Discussions pertaining to programming of backend systems and released UNL template code.

Restricting access to on-campus users with PHP

Postby saltybeagle » Wed Apr 25, 2007 9:45 am

A while ago I needed to restrict a page to only on campus users - which led to this small script in PHP:

http://pastebin.unl.edu/13

The script checks the remote users IP and determines if it is within the set of allowed IP ranges. Most people just check for an address beginning with 129.93, but the university has some extension offices using other IP ranges outside of that.

The network masks for UNL IP addresses are:
129.93.0.0/16
65.123.32.0/19
64.39.240.0/20
216.128.208.0/20

I will update this if I hear that anything has changed.

I figured this might be useful for some others to use.
Brett Bieber
Image
saltybeagle
 
Posts: 376
Joined: Fri Jan 16, 2004 3:10 pm
Location: 321 Admin

Postby tbachman2 » Wed Nov 18, 2009 11:40 am

Hi Brett,

Are these still valid?

Thanks,

=Tyler
- If not now, when -
tbachman2
 
Posts: 3
Joined: Fri Mar 27, 2009 8:56 am
Location: Lincoln, NE

Postby saltybeagle » Wed Nov 18, 2009 11:42 am

as far as I know
Brett Bieber
Image
saltybeagle
 
Posts: 376
Joined: Fri Jan 16, 2004 3:10 pm
Location: 321 Admin


Return to Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron