If it has a plug, it's IT stuff » 2008 » September2014-10-28T19:44:14Zhttp://itknowledgeexchange.techtarget.com/it-support/feed/atom/alessandro.panzettahttp://itknowledgeexchange.techtarget.com/it-support/http://itknowledgeexchange.techtarget.com/it-support/tlbat-intranet-upload-files/2008-09-30T07:22:03Z2008-09-30T07:22:03ZSo here uit comes the first post in the Admin section of our Download Center!

In order to have an upload feature in our administration section I used the Persist ASP Upload component that gave me a better control on the upload process. I know it’s not free but when I designed this project (about 2002!!!) this is what I used so if you prefer another component justuse your own

A file that we can now download for free is the aspupload.inc …you don’t even have to download it, just copy the code below and save it to your disc to a text file named aspupload.inc

]]>0alessandro.panzettahttp://itknowledgeexchange.techtarget.com/it-support/http://itknowledgeexchange.techtarget.com/it-support/tlbat-intranet-the-administration-section/2008-09-29T09:31:50Z2008-09-29T09:31:50ZIn the previous posts I’ve described how to restrict the download of certain software packages by using the group membership in an Active Directory.

As already anticipated the Download Center allows to download software from the closest intranet server (called Distribution Point) butthere’s also a section where we need to define the distribuition points, manage the replication between those, add and configure the software packages and so on.

In the next posts we will be covering all these matters so, as usual, stay tuned!!

]]>0alessandro.panzettahttp://itknowledgeexchange.techtarget.com/it-support/http://itknowledgeexchange.techtarget.com/it-support/tlbat-intranet-request_packageasp/2008-09-25T16:24:45Z2008-09-25T15:16:08ZIn the previous post we have seen the code that stays behind the scenes and that checks if a user is allowed to download the file. But what happens if the user is not allowed to download the requested software?

If you check the ASP code in my previous post you will see that there is a subroutine called RequestPack that accepts two parameters: NEEDED_GROUP and FILE. So whenever a user is not allowed there is an IF/THEN clause that, in case of not allowance to download a file, redirects the user to the RequestPack subroutine.

if Licensed = True then

Call GimmePack(FILE)

else

Call RequestPack(NEEDED_GROUP, FILE)

End if

What the RequestPack will do is to redirect the user to a page called request_package.asp where he/she will be asked if they want to request access to this package, if yes an email will be sent to the Download Center administrator with all necessary information.

Here is the RequestPack routine, present in the download_special.asp page, that builds the link to the request_package.asp page:

Hereafter the code for the request_package.asp page, in the next post we will start seeing the Administration part of the Download Center where we can add/remove packages, define site’ subnets, configure the replication between distribution points and so on so….stay tuned!!!

]]>0alessandro.panzettahttp://itknowledgeexchange.techtarget.com/it-support/http://itknowledgeexchange.techtarget.com/it-support/tlbat-intranet-an-image-is-worth-1000-words/2008-09-24T12:55:18Z2008-09-24T12:52:13ZHi folks, I just found out that I had an image of the concept behind the Download Center so I think it’s much better to post it so this can clearly explain how the whole thing works…here it is!

]]>0alessandro.panzettahttp://itknowledgeexchange.techtarget.com/it-support/http://itknowledgeexchange.techtarget.com/it-support/tlbat-intranet-the-download_specialasp/2008-09-24T12:40:11Z2008-09-24T12:36:44ZSo we’re finally at the “interesting” stuff: the page that checks if a user is allowed or not to download a certain package.

As in previous posts in order to allow a user to download a certain file he/she must be a member of a given group; e.g. we want to restrict the downloads of MySoftware.exe and make this available only to the members of the grp_MySoftware group. We defined then in our database that this file has the following entry:

PackageDesc = “My beautiful software 1.0″

PackageName = “MySoftware.exe”

PackageType = “Special”

NeededGroup = “grp_MySoftware”

The code that you find below will check if the user that is visiting the page is part of the grp_MySoftware group and, if successful, build the download link by redirecting him/her to the closest distribution point. Example http://192.168.xxx.1/files/MySoftware.exe where xxx is the subnet of the client visiting the page.

So now let’s see the code and remember to change the MyDomain = “contoso” to your domain name (E.g. if you have mycompany.com just type mycompany).

The code that follows is self-explanatory so just…read it and check the commented lines!

]]>0alessandro.panzettahttp://itknowledgeexchange.techtarget.com/it-support/http://itknowledgeexchange.techtarget.com/it-support/time-wont-leave-as-i-am/2008-09-17T15:07:44Z2008-09-17T15:07:44Z…but time won’t take the boy out of this man! (U2 – City of blinding lights)

Some of you probably notices that I’m not updating as frequently as before…oh well…soooooooorry but this new job is sucking taking all of my time in styudying, exams and so on. So pleas ebe patient, I’ll be updating soon with other TLBAT stuff for our Download center…stay tuned!

]]>0alessandro.panzettahttp://itknowledgeexchange.techtarget.com/it-support/http://itknowledgeexchange.techtarget.com/it-support/tlbat-intranet-downloadasp/2008-09-11T10:14:35Z2008-09-11T10:13:34ZIn this post we will build the page that downloads the packages that we have defined as: STANDARD, GOODIE or PATCH. These software packages are the ones that are available to all users in our domain so no special need is required except being a user in the domain.

What the page will do is to identify in which IP subnet the user is located and build the download URL relative to his or her site; this will save bandwidth and reduce download times for the users.

The page uses an ASP Server Variable that is used to obtain the client’s IP address and then compare this to our sites’ definition in our database, indeed if we look at the code we will see the: Request.ServerVariables(“REMOTE_ADDR”)string, this variable is the IP address of the computer that is visiting the page.

As an example let’s consider the IP address 192.168.39.123, in this page we will check the 3rd octet of the IP address and compare it to our database; in this case the “39” part identifies the Italian site located in Milan so the final URL will be “http://iis_ita1/download/free/myfile.exe ” where the myfile.exe is passed by the default.asp page.

The page then will also log the hit for the given file to the hits database; this is done by calling the LogHit subroutine.

The next post will discuss the SPECIAL packages where in order to be allowed to download a given file, the user is required to be member of a given domain group…stay tuned!!

]]>0alessandro.panzettahttp://itknowledgeexchange.techtarget.com/it-support/http://itknowledgeexchange.techtarget.com/it-support/tlbat-intranet-the-home-page/2008-09-10T15:47:36Z2008-09-10T15:21:33ZIn this post I’ll present the home page and will explain how this works….so let’s play J

First in order to have this working we need a file called adovbs.inc that can be downloaded here, this file contains all instructions for connecting to the database via ADO.The we need to download some images that will be used in the pages, the images are available here. So now go to the directorywhere your site will be hosted (E.g. c:\inetpub\wwwroot) and unzip images in a directory called images. Also create a folder named dbwhere you will save the downloads.mdb file that you created as in my previous post so in the end you will have a folder structure as follows:

c:\inetpub\wwwroot\Download_Center

c:\inetpub\wwwroot\Download_Center\images

c:\inetpub\wwwroot\Download_Center\db

Now we need to create our default.asp page, the code is at the bottom of this post. let’s discuss on this code.

It consists of some basic HTML that uses some internal subroutines to build 4 tables (see screen shot) that contain: the software available to everyone, the software for users in given groups, the patches and the goodies.

In order to dynamically build these tables a subroutine called DoTD is called, this subroutine accepts an option that specifies whic table must be built; possible values are STANDARD, SPECIAL,PATCH, GOODIE.

In addition to this procedure there’s also a Counter subroutine that is called by the DoTD and that shows how many times the given package has been downloaded. In order fr this to work you need a hits.mdb file (available here) where the hits will be recorded; remember to save this file in the db directory.

Once you have finished downloading the files described above, create a new default.asp page with the following code andsave it in the root folder of your website.

For now this is enough, in the next post I’ll describe the download_special.asp file that is the one that checks if the user visiting the page is allowed to download a certain file or not….stay tuned!!!