Re: File paths on a web server

2008-04-11 Thread Sarah Reichelt
On Fri, Apr 11, 2008 at 5:06 PM, Brian Yennie <[EMAIL PROTECTED]> wrote:
> Could you use AppleScript? That might get you out of the sandbox where the
> CGI is running. What is probably stopping you is that Apache typically is
> run by a different user than the current "logged in" user, for security
> purposes.
>
>  tell application "System Events"
> set username to the current user's name
> return username
>  end tell

Thanks Brian, I'll give that a go. The other possibility that occurred
to me was to list all the folders in "/Users" to get a list of the
users on that computer, then check the Public folder of each to see
which contained the files & folders I needed. Then I could save that
data to a preference file and update it any time the correct files
could not be found.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: File paths on a web server

2008-04-11 Thread Jan Schenkel
--- Sarah Reichelt <[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I've run into this problem before and solved it with
> Ken Ray's help,
> but now (with Leopard) the old solution doesn't
> work.
> 
> I need to find the name of the current user on the
> web server
> computer. The cgi stacks need to be able to find a
> file in the current
> user's public folder, but I can't get to it if I
> don't know the name
> of the user. I've tried my previous solution using
> the shell command
> "who", but although "who" works fine in Terminal, it
> doesn't return
> anything when used in a CGI script. I've also tried
> "whoami" and even
> specialFolderPath().
> 
> Any ideas? I can't use a different file arrangement
> because that isn't
> mine to control.
> 
> Cheers,
> Sarah
> 

The tricky part is that the cgi-engine is started from
the Apache process, which in turn is running as the
'httpd' user - not the user currently logged on to
your computer. This 'httpd' user has no home
directory.
I'm afraid you'll have to find a way to transfer the
user id in your query, or read it from a configuration
file in a fixed location.

Hope this helped,

Jan Schenkel.

Quartam Reports & PDF Library for Revolution


=
"As we grow older, we grow both wiser and more foolish at the same time."  (La 
Rochefoucauld)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: File paths on a web server

2008-04-11 Thread Brian Yennie
Could you use AppleScript? That might get you out of the sandbox  
where the CGI is running. What is probably stopping you is that  
Apache typically is run by a different user than the current "logged  
in" user, for security purposes.


tell application "System Events"
set username to the current user's name
return username
end tell


Hi All,

I've run into this problem before and solved it with Ken Ray's help,
but now (with Leopard) the old solution doesn't work.

I need to find the name of the current user on the web server
computer. The cgi stacks need to be able to find a file in the current
user's public folder, but I can't get to it if I don't know the name
of the user. I've tried my previous solution using the shell command
"who", but although "who" works fine in Terminal, it doesn't return
anything when used in a CGI script. I've also tried "whoami" and even
specialFolderPath().

Any ideas? I can't use a different file arrangement because that isn't
mine to control.

Cheers,
Sarah


---
Brian Yennie


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


File paths on a web server

2008-04-10 Thread Sarah Reichelt
Hi All,

I've run into this problem before and solved it with Ken Ray's help,
but now (with Leopard) the old solution doesn't work.

I need to find the name of the current user on the web server
computer. The cgi stacks need to be able to find a file in the current
user's public folder, but I can't get to it if I don't know the name
of the user. I've tried my previous solution using the shell command
"who", but although "who" works fine in Terminal, it doesn't return
anything when used in a CGI script. I've also tried "whoami" and even
specialFolderPath().

Any ideas? I can't use a different file arrangement because that isn't
mine to control.

Cheers,
Sarah

OS X 10.5.2, Rev 2.9.0, Apache 2
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution