Re: [PHP] pass variable from vbscript to php

2005-04-05 Thread David Bevan
Another way you can get around passing info to the
server is to use hidden fields and make the entire
page into a form with each link in turn submitting the
form to the target script.  You avoid putting
sensitive info into the address bar and you can take
advantage of header encryption if you need it.

Regards,
David

--- Ashley [EMAIL PROTECTED] wrote:
 I have a unique problem that may be able to be
 solved another way, but I 
 don't know how.
 
 What I need to do is pass a variable from a vbscript
 into php for use.
 
 I am using vbscript to access an activeX control on
 the computer that 
 grabs the currently logged in user.  This works
 fine, but I cannot 
 determine how I can get that value into php so that
 I can use it.
 
 This is for an Intranet app.  Basically I want to
 use the currently 
 logged in user so that they don't have to log into
 the Intranet app.
 
 I am running this on a Netware 6.5 server running
 Apache 2.5.
 
 This may not be the best way to go about this, but
 it is the only thing 
 that I have been able to find so I am open to
 suggestions.
 
 Thanks in advance,
 Ashley
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] pass variable from vbscript to php

2005-04-05 Thread David Bevan
Please address replies to the list
--- Rory Browne [EMAIL PROTECTED] wrote:
 I'm not sure how you'd go about this from a security
 point of view,
 but perhaps for an Intranet, you could, check their
 IP address from
 $_SERVER['REMOTE_ADDR'], and check your login server
 to see who is
 logged in from that IP.
 
 Perhaps considering that you seem to have a way of
 providing such
 information to the Browser, you could use cookies.
 For your clientside
 code you could do something like the following:
 
 Bare in mind that I don't really know vbs, and the
 usual disclaimers apply.
 script type=text/vbscript
for each tree in NWSess1.ConnectedTrees
anyTree=tree.FullName
anyUser=NWSess1.LoginName(anyTree)
document.cookie=userid= + anyUser +
 ; + document.cookie
next
 /script
 
 You can then get the information then in PHP using
 $_COOKIE['userid'].
 I wouldn't normally advocate such a solution, you're
 relying on the
 user to tell you their name, and to tell you it
 accurately. You are
 assuming that they can't change document.cookie to
 userid=somebody_elses_name. That assumption only
 holds true if the
 person in question doesn't know how to use a
 browser.
 
 The situation you're describing suggests a strong
 lack of security. 
 
 On Apr 5, 2005 1:28 PM, David Bevan
 [EMAIL PROTECTED] wrote:
  Another way you can get around passing info to the
  server is to use hidden fields and make the entire
  page into a form with each link in turn submitting
 the
  form to the target script.  You avoid putting
  sensitive info into the address bar and you can
 take
  advantage of header encryption if you need it.
  
  Regards,
  David
  
  --- Ashley [EMAIL PROTECTED] wrote:
   I have a unique problem that may be able to be
   solved another way, but I
   don't know how.
  
   What I need to do is pass a variable from a
 vbscript
   into php for use.
  
   I am using vbscript to access an activeX control
 on
   the computer that
   grabs the currently logged in user.  This works
   fine, but I cannot
   determine how I can get that value into php so
 that
   I can use it.
  
   This is for an Intranet app.  Basically I want
 to
   use the currently
   logged in user so that they don't have to log
 into
   the Intranet app.
  
   I am running this on a Netware 6.5 server
 running
   Apache 2.5.
  
   This may not be the best way to go about this,
 but
   it is the only thing
   that I have been able to find so I am open to
   suggestions.
  
   Thanks in advance,
   Ashley
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit:
 http://www.php.net/unsub.php
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit:
 http://www.php.net/unsub.php
  
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] pass variable from vbscript to php

2005-04-04 Thread Ashley
Ok, apparently I wasn't clear enough with my explanation due to the 
responses I have received.

I have a webserver (not on the same computer as the users) that is 
hosting an Intranet app.  I want to obtain the username of the current 
person logged into the workstation that is connecting to the Intranet.

From what I have read this is impossible to accomplish from the server 
without prompting for a username/password.  I found an activeX control 
(called NWSess from Novell) that will provide the currently logged in user.

The problem is that I need to take this variable (provided by the 
activeX control to a vbscript) and pass it to PHP so that it can be 
used.  I don't typically use vbscript so I would really like to put the 
variable in PHP so that I can use it for other things.

I hope this explains what I am trying to accomplish a little better and 
thank you for the responses thus far.

Ashley
Burhan Khalid wrote:
Ashley wrote:
I have a unique problem that may be able to be solved another way, but 
I don't know how.

What I need to do is pass a variable from a vbscript into php for use.
I am using vbscript to access an activeX control on the computer that 
grabs the currently logged in user.  This works fine, but I cannot 
determine how I can get that value into php so that I can use it.

If PHP is running on the same computer that the user is logged into, 
then you can use $_SERVER['REMOTE_USER'] to get the current logged in user.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] pass variable from vbscript to php

2005-04-04 Thread Jason Barnett
Ashley wrote:
 Ok, apparently I wasn't clear enough with my explanation due to the
 responses I have received.

 I have a webserver (not on the same computer as the users) that is
 hosting an Intranet app.  I want to obtain the username of the current
 person logged into the workstation that is connecting to the Intranet.


OK.

 From what I have read this is impossible to accomplish from the server
 without prompting for a username/password.  I found an activeX control
 (called NWSess from Novell) that will provide the currently logged in user.


sarcasmApparently it's not impossible to do this without prompting for
the username / password then eh?/sarcasm

ActiveX controls are in the COM family.  If you don't know about COM
then you can start by looking here:
http://www.microsoft.com/com/default.mspx

Now... when you find the list of commands / variables that you will need
from the ActiveX container then you can make those calls with PHP.  The
relevant part of the PHP manual is:
http://php.net/manual/en/ref.com.php

P.S. this sounds pretty interesting.  I (and probably others) would
appreciate it if you would post back to the list with a [SOLVED]
response that shows PHP code you used to get this working.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] pass variable from vbscript to php

2005-04-04 Thread Ashley
Just so that I don't start working in the wrong direction, do you mean 
that I can get the same information from the activeX control directly 
from PHP rather than having to do it with vbscript?

I am not much of a coder so any help porting the vbscript to PHP would 
be great.  The code that I am using to get the information from the 
activeX control is:
--
script type=text/vbscript
	for each tree in NWSess1.ConnectedTrees		
		anyTree=tree.FullName
		anyUser=NWSess1.LoginName(anyTree)
		output=output+Tree:+anyTree+, userID:+anyUser+vbcrlf		
	next
	//msgbox output
/script
--

I found this code on Novell's site so I didn't make this myself.
In the mean time, I will look at the information that you gave me and 
see if I can figure it out.

Thanks,
Ashley

Jason Barnett wrote:
Ashley wrote:
Ok, apparently I wasn't clear enough with my explanation due to the
responses I have received.
I have a webserver (not on the same computer as the users) that is
hosting an Intranet app.  I want to obtain the username of the current
person logged into the workstation that is connecting to the Intranet.

OK.

From what I have read this is impossible to accomplish from the server
without prompting for a username/password.  I found an activeX control
(called NWSess from Novell) that will provide the currently logged in user.

sarcasmApparently it's not impossible to do this without prompting for
the username / password then eh?/sarcasm
ActiveX controls are in the COM family.  If you don't know about COM
then you can start by looking here:
http://www.microsoft.com/com/default.mspx
Now... when you find the list of commands / variables that you will need
from the ActiveX container then you can make those calls with PHP.  The
relevant part of the PHP manual is:
http://php.net/manual/en/ref.com.php
P.S. this sounds pretty interesting.  I (and probably others) would
appreciate it if you would post back to the list with a [SOLVED]
response that shows PHP code you used to get this working.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] pass variable from vbscript to php

2005-04-04 Thread Ashley
Ok, I did a quick scan of the COM section on PHP's site (linked below) 
and found this requirement:
COM functions are only available for the Windows version of PHP.

In my first post, I mentioned that I am running my webserver on a 
Netware 6.5 server.

In light of this I am guessing that this suggestion will not work.  Is 
this in fact the case or is there another way around this?

Ashley
Jason Barnett wrote:
Ashley wrote:
Ok, apparently I wasn't clear enough with my explanation due to the
responses I have received.
I have a webserver (not on the same computer as the users) that is
hosting an Intranet app.  I want to obtain the username of the current
person logged into the workstation that is connecting to the Intranet.

OK.

From what I have read this is impossible to accomplish from the server
without prompting for a username/password.  I found an activeX control
(called NWSess from Novell) that will provide the currently logged in user.

sarcasmApparently it's not impossible to do this without prompting for
the username / password then eh?/sarcasm
ActiveX controls are in the COM family.  If you don't know about COM
then you can start by looking here:
http://www.microsoft.com/com/default.mspx
Now... when you find the list of commands / variables that you will need
from the ActiveX container then you can make those calls with PHP.  The
relevant part of the PHP manual is:
http://php.net/manual/en/ref.com.php
P.S. this sounds pretty interesting.  I (and probably others) would
appreciate it if you would post back to the list with a [SOLVED]
response that shows PHP code you used to get this working.
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] pass variable from vbscript to php

2005-04-04 Thread Jason Barnett
Ashley wrote:
 Just so that I don't start working in the wrong direction, do you mean
 that I can get the same information from the activeX control directly
 from PHP rather than having to do it with vbscript?

Yes, that is exactly what I mean.


 I am not much of a coder so any help porting the vbscript to PHP would
 be great.  The code that I am using to get the information from the
 activeX control is:
 --
 script type=text/vbscript
 for each tree in NWSess1.ConnectedTrees
 anyTree=tree.FullName
 anyUser=NWSess1.LoginName(anyTree)
 output=output+Tree:+anyTree+, userID:+anyUser+vbcrlf
 next
 //msgbox output
 /script
 --


You should be able to translate all of the above code into PHP.  Send us
another message if you have trouble with some part of it.  Exact process
will depend on PHP4/PHP5 though.  Again, refer to this link:
http://php.net/manual/en/ref.com.php

Personally, I'd code this for use in a PHP5 parser.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


Re: [PHP] pass variable from vbscript to php

2005-04-04 Thread Satyam
One way you can do it is to put an invisible iframe on the same page as 
the object which provides you the user information.  When you get, via 
vbscript or javascript, the userid, then you set the src property of the 
iframe to that of a page where you will process that info, appended with 
the information taken from the object.

iframe id=iframename/iframe
object id=objectname blah, blah, blah /

Asiming the property of the ActiveX object you want to send to the PHP 
server is called UserId, whenever you are sure you can read it (perhaps an 
event or whatever) you do:

document.getElementById('iframename').src = 'ValidateUser.php?UserId=' + 
document.getElementById('objectname').UserId


The page ValidateUser.php would receive the UserId as an argument in the URL 
(and you can add as many as you want) and may reply with whatever response 
is apropriate.  That answer will go into the body of the iframe document.

Thus, assuming that you reply with a 0 or 1, you will get that by having an 
function attached to the onLoad event of the iframe.  The onLoad will be 
triggered when a response is finally received.

The reply you will get as

document.getElementById('iframename').document.body.innerHTML

which you could check by doing a:


iframe id=iframename 
onLoad=alert(document.getElementById('iframename').document.body.innerHTML); 
/

Satyam


Ashley [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Ok, apparently I wasn't clear enough with my explanation due to the 
 responses I have received.

 I have a webserver (not on the same computer as the users) that is hosting 
 an Intranet app.  I want to obtain the username of the current person 
 logged into the workstation that is connecting to the Intranet.

 From what I have read this is impossible to accomplish from the server 
 without prompting for a username/password.  I found an activeX control 
 (called NWSess from Novell) that will provide the currently logged in 
 user.

 The problem is that I need to take this variable (provided by the activeX 
 control to a vbscript) and pass it to PHP so that it can be used.  I don't 
 typically use vbscript so I would really like to put the variable in PHP 
 so that I can use it for other things.

 I hope this explains what I am trying to accomplish a little better and 
 thank you for the responses thus far.

 Ashley


 Burhan Khalid wrote:
 Ashley wrote:

 I have a unique problem that may be able to be solved another way, but I 
 don't know how.

 What I need to do is pass a variable from a vbscript into php for use.

 I am using vbscript to access an activeX control on the computer that 
 grabs the currently logged in user.  This works fine, but I cannot 
 determine how I can get that value into php so that I can use it.


 If PHP is running on the same computer that the user is logged into, then 
 you can use $_SERVER['REMOTE_USER'] to get the current logged in user. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] pass variable from vbscript to php

2005-04-04 Thread Mikey
  From what I have read this is impossible to accomplish from 
 the server 
  without prompting for a username/password.  I found an 
 activeX control 
  (called NWSess from Novell) that will provide the currently 
 logged in user.
 

You have not mentioned what network you are running. IF it is a Windows
network, AND you run PHP on IIS, the server variable NT_AUTH_USER is defined
for you.  However, I suspect from the fact that you are looking at COM
objects from Novell that you are running a Novell network.

 sarcasmApparently it's not impossible to do this without 
 prompting for the username / password then eh?/sarcasm
 
 ActiveX controls are in the COM family.  If you don't know 
 about COM then you can start by looking here:
 http://www.microsoft.com/com/default.mspx
 
 Now... when you find the list of commands / variables that 
 you will need from the ActiveX container then you can make 
 those calls with PHP.  The relevant part of the PHP manual is:
 http://php.net/manual/en/ref.com.php
 
 P.S. this sounds pretty interesting.  I (and probably others) 
 would appreciate it if you would post back to the list with a 
 [SOLVED] response that shows PHP code you used to get this working.

However, I believe this response was a little hasty as I do not believe that
the question involves running an ActiveX Control on a server, but on a
client.  In this case, the variables that are passed into your VBScript need
to be then added to an HTML form (via hidden input tags) and the form needs
to be submitted.

Thing is though, this means transmitting user network login details via POST
and this means that it would be possible for anyone on your network to watch
this traffic and get logins for anybody that uses your system.

Maybe a better solution in this case would be to associate a user account
with a network login when the account is created and store this information
in your user database.

HTH,

Mikey

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] pass variable from vbscript to php

2005-04-02 Thread Burhan Khalid
Ashley wrote:
I have a unique problem that may be able to be solved another way, but I 
don't know how.

What I need to do is pass a variable from a vbscript into php for use.
I am using vbscript to access an activeX control on the computer that 
grabs the currently logged in user.  This works fine, but I cannot 
determine how I can get that value into php so that I can use it.
If PHP is running on the same computer that the user is logged into, 
then you can use $_SERVER['REMOTE_USER'] to get the current logged in user.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] pass variable from vbscript to php

2005-04-01 Thread Chris W. Parker
Ashley mailto:[EMAIL PROTECTED]
on Friday, April 01, 2005 2:32 PM said:

 I have a unique problem that may be able to be solved another way,
 but I don't know how.

Another way? What's the first way? :|

 What I need to do is pass a variable from a vbscript into php for use.
 
 I am using vbscript to access an activeX control on the computer that
 grabs the currently logged in user.  This works fine, but I cannot
 determine how I can get that value into php so that I can use it.

[snip /]

 This may not be the best way to go about this, but it is the only
 thing that I have been able to find so I am open to suggestions.

I must be missing something. Where is the first way?

In any case, here is another way:

You need to pass the variable through the querystring:

http://intranet/page.php?yourvariable=yourvalue


HTH,
Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php