Did I write that code?

Found myself today with a wee bit of extra time on my hands. Not that there isn't plenty to do, mind you. After all, I have a MPLS Internet connection to plan for, which means a firewall to upgrade, an email server that needs upgrading, more computers to roll along (wich also means old PC re-location), garbage to toss (soo many boxes from the last PC roll-out), the list goes on, but I'd rather not bore you.

But instead I decided to have a look at some old Visual Basic ASP code I wrote some time last year. Skimming it over, I begin to wonder: Did I write that code? What in the name of heck was I thinking? I can't read this!

"Hold on, there", I tell myself. I suppose that I actually sat down to re-read it thouroughly, it would make some kind of sense. Even the nested For-Next loop that determines if ip address falls within a certain subnet.

Anyway, what the ASP script is supposed to do is decide via the ip address of the visitor is supported to be linked directly into a link or be sent somewhere else: Say you have a website that is used both inside the library and by patrons at home, and there are licensed databases on that website. This script allows the users from inside the library to go directly into the vendor's database, while users outside the library are sent to a web page that requests authentication (is that individual a library patron?).

I know most vendors already provide this type of functionality with their database service, but our case specifically involves a multi-library joint venture on true authentication to discover if a library member in good standing at the library, and whether or not grant that patron access to the licensed database.

So, this means that unless the URL is parsed by some kind of script, only one URL is allowed to be contained in an HREF tag. In our case it would be the link to the authentication page for our patrons at home. And that means every time library staff clicked on a database from our web site, they would be asked to authenicate. Bummer, dude.

Now that background on the whole script is over with, I was debating on ways on improving it. Not that the script isn't good already. After all, it can parse the correct url based on network subnets (255.255.255.0). I was thinking of including it in our weblinks database (project also written in ASP) somehow. But it need it own seperate database table because of the extra url, additional fields to handle hit counts. It was not that part that stopped me from enhancing the script this way, it was thought of re-writing our database links page.

More work than I got in time right now.

On the bright side I cleaned up the databases page, ditching an unneeded table and removing tonnes of whitespace. Ah, the little things that make us feel good.

If anyone is interested in the source of either of these to mini-projects just email me pverhagen-at-sapl.ab.ca and I'd be happy to send it to you.

Syndicate content