RE: [SQU] Interesting Question

From: Kieran Skinner <kieran.skinner@dont-contact.us>
Date: Thu, 1 Mar 2001 12:18:53 -0000

Can't you just use some form of wildcard in your redirector?

if http://www.allowed.com/% the rewrite to http://www.allowed.com/%
elsif http://www.allowed2.com/% the rewrite to http://www.allowed2.com/%
else rewrite to http://accessdenied/

Obviously you can do some nice allow ro disallow lists if you want.

 

e.g.

#!/usr/local/bin/perl
$|=1;

use DBI;
my $dbh = DBI->connect("dbi:Oracle:mars.xal", "BME", "BME");
while ($redir_params = <STDIN>)
{
    chomp ($redir_params);
    open(LOGFILE, ">>/usr/local/squid/logs/redirlog");
    print LOGFILE "i=$redir_params\n";
    @redir_params = split(" ", $redir_params);

        $sth = $dbh->prepare( "BEGIN ? := iAccount.mValidate(
                                pDNIS => ?,
                                pAccountNo => ?);
                               END;"
                );
        $sth->bind_param_inout( 1, \$ret, 50 );
        #strip protcol and serever parts from url
        $sth->bind_param( 2, substr(@redir_params[0],0,
index(@redir_params[0],
 "/", 7) + 1 ));
        #$sth->bind_param( 2, @redir_params[0]);
        $sth->bind_param( 3, @redir_params[2] );

       if ($ret == 0)
          {
          $_ = $redir_params;
          s@http://sun.xal@http://moser.xal@;
          s@http://members.mars.xal@http://private.mars.xal@;
          $redir_params = $_;
          }
          else
          {
          @redir_params[0] =
"http://merkur.xal/skika/auth_failed.pl?username=@r
edir_params[2]&authresult=$ret&serviceurl=@redir_params[0]";
          $redir_params = join(" ", @redir_params);
          }
          print LOGFILE "o=$redir_params\n";
          close(LOGFILE);
          print STDOUT "$redir_params\n";
}
$dbh->disconnect;

-----Original Message-----
From: Devin Teske [mailto:devinteske@hotmail.com]
Sent: 01 March 2001 05:25
To: squid-users@ircache.net
Subject: Re: [SQU] Interesting Question

Oh noooooooo. You have no idea how upset this has made me. I really need a
way of letting whole pages pass through. Is there no way?

>Squid does not know about pages, only objects as indicated by URLs.
>
>The HTML code is one URL
>Each and every image is another URL
>Style sheets are URLs
>mpeg movies are URLs
>ware downloads are URLs
>porn images are URLs
>[the list continues]
>
>--
>Henrik Nordstrom
>Squid hacker
>
>Devin Teske wrote:
> >
> > Hello,
> >
> > I have an interesting question for you all. I am building a site filter
>in
> > perl that I will use as the redirector. I wanted to know a little more
>about
> > how this works.
> >
> > Let's say, hypothetically, that the only site i want my users to be able

>to
> > go to is http://apple.excite.com and every object in the page too.
>Though I
> > don't want to know what is in that page.
> >
> > So does the redirector ask you about every single object in the page or
>just
> > the page? I only want to be asked about the initial page and then accept

>the
> > entire pages content. Is this possible?
> >
> > Thanks in advance,
> > Devin Teske
> >
> > PS. sorry if this message got sent more than once, hotmail is acting
> > screwy.squid-users@ircache.net
> > Hello,
> >
> > I have an interesting question for you all. I am building a site filter
>in
> > perl that I will use as the redirector. I wanted to know a little more
>about
> > how this works.
> >
> > Let's say, hypothetically, that the only site i want my users to be able

>to
> > go to is http://apple.excite.com and every object in the page too.
>Though I
> > don't want to know what is in that page.
> >
> > So does the redirector ask you about every single object in the page or
>just
> > the page? I only want to be asked about the initial page and then accept

>the
> > entire pages content. Is this possible?
> >
> > Thanks in advance,
> > Devin Teske
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
--
To unsubscribe, see http://www.squid-cache.org/mailing-lists.html
Received on Thu Mar 01 2001 - 05:22:25 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:58:27 MST