[cgiapp] access permission

2004-05-02 Thread Jan Dworschak
Hi,
hope i'm in the right list for that question, sorry if not ;)
I'm writing a cgi-perl-script. In that I want to get access to an file 
on an Linux Server.
The problem is that when I start it from the web-browser I run the 
script under the user of the web-server.
But only the owner of the file has read and write permissions 
(rw---) !!!
So, I have to authorize me. How can I make that in Perl?

I found nothing in the archives to that special problem.

thanks for all recommendations

jan

p.s.
it is no option to alter the permissions of the file!
-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
 http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [cgiapp] CGI::App, CGI::Session and CGI::Simple

2004-05-02 Thread Ron Savage
On Tue, 27 Apr 2004 00:27:53 -0400, Cees Hek wrote:

Hi Cees

Taste and try before you buy!

http://savage.net.au/CGI.pm-3.05.patch.tgz

--
Ron Savage, [EMAIL PROTECTED] on 3/05/2004. Room EF 312
Deakin University, 221 Burwood Highway, Burwood, VIC 3125, Australia
Phone: +61-3-9251 7067, Fax: +61-3-9251 7604
http://www.deakin.edu.au/~rsav



-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] CGI::App, CGI::Session and CGI::Simple

2004-05-02 Thread Cees Hek
Ron Savage wrote:
Lincoln Stein says he's too busy at the moment (surprise!) and has 
asked me to whip up a can() method. I'll do that now.
Cool!  Thanks for following up on this Ron.

If you have any suggestions, post them to this list (I'm subscribed).
Here is a first stab at a solution.  I haven't really tested it 
thoroughly enough, but it should give you some ideas of how it can be 
implemented.  Also, I'm sure Lincoln will want a .t test file as well.

First, a couple of notes...  The reason I am compiling the function if 
it doesn't already exist is because UNIVERSAL::can returns a reference 
to the function on success, so the function will need to be compiled 
when 'can' is called...  I was hoping there was a way to write 'can' so 
that the function wouldn't need to be compiled, but I can't come up with 
one...

Also, you have to check with UNIVERSAL::can first, since the function 
may already exist in the inheritance tree somewhere (in a subclass or 
superclass).  The checks for existence need to be made in the same order 
that they would occur if the function was called directly (instead of 
through 'can').  Since AUTOLOAD gets called last, after the entire 
inheritance tree is searched, the copy in the inheritance tree takes 
presidence over any AUTOLOADed method.  This situation could arise if 
someone wrote a class that inherited from CGI.pm and then overrode say 
the 'cookie' method.  This subclass would inherit CGI::can as well, so 
it should return a reference to the overridden cookie method, and not 
compile the one in CGI.pm and return a reference to that.

Anyway, here is my attempt.  Hope it helps:

# custom 'can' method for autoloaded subroutines
sub can {
my $class = shift;
my $func_name = shift;
# See if UNIVERSAL::can finds it
if (my $func = $class->SUPER::can($func_name)) {
return $func;
}
# Try to compile the function
eval {
# _compile looks at $AUTOLOAD for the function name
local $AUTOLOAD = join "::",$class,$func_name;
&_compile;
};
# now that the function is loaded (if it exists)
#  just use UNIVERSAL::can again to do the work
return $class->SUPER::can($func_name);
}
Cheers,

Cees

-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
 http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [cgiapp] CGI::App, CGI::Session and CGI::Simple

2004-05-02 Thread Ron Savage

Try this:

#!/usr/bin/perl

use strict;
use warnings;

use CGI;

# --

my(%method);

for my $tag (keys %CGI::EXPORT_TAGS)
{
$method{$_} = 1 for grep{! /^:/} (@{$CGI::EXPORT_TAGS{$tag} });
}

print "$_. \n" for (sort keys %method);
--
Ron Savage, [EMAIL PROTECTED] on 3/05/2004. Room EF 312
Deakin University, 221 Burwood Highway, Burwood, VIC 3125, Australia
Phone: +61-3-9251 7067, Fax: +61-3-9251 7604
http://www.deakin.edu.au/~rsav



-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] CGI::App, CGI::Session and CGI::Simple

2004-05-02 Thread Ron Savage
On Tue, 27 Apr 2004 00:27:53 -0400, Cees Hek wrote:

Hi Cees

> What probably should be done is to ask the CGI.pm maintainer to
> include
> a custom 'can' method that is able to specify what functions are
> available in the module.

Lincoln Stein says he's too busy at the moment (surprise!) and has
asked me to whip up a can() method. I'll do that now.

If you have any suggestions, post them to this list (I'm subscribed).
--
Ron Savage, [EMAIL PROTECTED] on 3/05/2004. Room EF 312
Deakin University, 221 Burwood Highway, Burwood, VIC 3125, Australia
Phone: +61-3-9251 7067, Fax: +61-3-9251 7604
http://www.deakin.edu.au/~rsav



-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] User authentication

2004-05-02 Thread Ron Savage
On Mon, 3 May 2004 02:45:37 +0300 (IDT), Gabor Szabo wrote:

Hi Gabor

>> Perhaps CGI::Session::MembersArea?
> nice, can it use flat files as the "database" for authentication ?

Thanx :-).

> (hmm, maybe via DBD::Sprite ?)

I assume so but I did not actually test it with DBD::Sprite.

> sure that would be Cheesepizza I just cannot type.

Got it. Thanx.

--
Ron Savage, [EMAIL PROTECTED] on 3/05/2004. Room EF 312
Deakin University, 221 Burwood Highway, Burwood, VIC 3125, Australia
Phone: +61-3-9251 7067, Fax: +61-3-9251 7604
http://www.deakin.edu.au/~rsav



-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] User authentication

2004-05-02 Thread Cees Hek
Gabor Szabo wrote:
I might missing something seriously and it is late at night
but is there a module that can be plugged in easily that would
provide authentication in a regular CGI environment ?
[snip]
ps. maybe CGI::Session::Auth is what I am looking for ?
I have been using CGI::Session::Auth for several months now, and am very 
happy with it.  However, it is not finished, and I had to do some 
patching to get it working properly for my needs.  After accepting one 
simple patch I sent to the author, I haven't heard from him in a while 
regarding the other fixes and additions I made.  It really is a good 
start for an authentication module based on CGI::Session though, and it 
works well with CGI::Application, hence that is why I am using it.

If you do choose to use it, let me know and I will send you my patches.

Cheers,

Cees

-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
 http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [cgiapp] User authentication

2004-05-02 Thread Gabor Szabo
On Mon, 3 May 2004, Ron Savage wrote:

> Perhaps CGI::Session::MembersArea?
nice, can it use flat files as the "database" for authentication ?
(hmm, maybe via DBD::Sprite ?)

>
> > While I know about Cheespizza I am thinking about a lot less
>
> I Googled for Cheespizza just in case you were serious :-) but did not
> find anything...

sure that would be Cheesepizza I just cannot type.
and it was the 2nd hit for me.

Gabor


-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [cgiapp] User authentication

2004-05-02 Thread Ron Savage
On Mon, 3 May 2004 02:15:44 -0200 (GMT+2), Gabor Szabo wrote:

Hi Gabor

> I might missing something seriously and it is late at night
> but is there a module that can be plugged in easily that would
> provide authentication in a regular CGI environment ?

Perhaps CGI::Session::MembersArea?

> While I know about Cheespizza I am thinking about a lot less

I Googled for Cheespizza just in case you were serious :-) but did not
find anything...
--
Ron Savage, [EMAIL PROTECTED] on 3/05/2004. Room EF 312
Deakin University, 221 Burwood Highway, Burwood, VIC 3125, Australia
Phone: +61-3-9251 7067, Fax: +61-3-9251 7604
http://www.deakin.edu.au/~rsav



-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[cgiapp] User authentication

2004-05-02 Thread Gabor Szabo

I might missing something seriously and it is late at night
but is there a module that can be plugged in easily that would
provide authentication in a regular CGI environment ?

Does something like that exist for CGI::Application ?

While I know about Cheespizza I am thinking about a lot less involved
thing that only handles login/logout and restricting users to access
certain pages (or run modes).


Gabor
ps. maybe CGI::Session::Auth is what I am looking for ?


-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[cgiapp] HTTP_REFERER & Virtual Hosts

2004-05-02 Thread Linda Jen
I have been trying to find a way to get the absolute path for the url
returned  in HTTP_REFERER.  The url may referce an alias, virtual host,
or simply some subdirectory but will not be defined by DOCUMENTROOT in
httpd.conf.  I have looked at faq but found nothing.  Help anyone?


-Linda Jen




-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]