php-general Digest 27 Nov 2009 12:34:28 -0000 Issue 6463

Topics (messages 300131 through 300136):

Re: php htaccess logins and logouts
        300131 by: Andy Shellam (Mailing Lists)

connection to SSL enabled ldap problem
        300132 by: Tanveer Chowdhury

PHP APACHE SAVE AS
        300133 by: Julian Muscat Doublesin
        300134 by: Tanveer Chowdhury
        300135 by: Lester Caine
        300136 by: Jonathan Tapicer

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Hi,

> 
> IIRC if you unset $_SERVER['PHP_AUTH_USER'] and
> $_SERVER['PHP_AUTH_PW'] it will log you out.

I've done some research on this in the past - and not all browsers/web servers 
honour that as it's the browser that keeps the username/password cached and 
sends it after a 401 response, so the server knows nothing about the "login" - 
i.e.

1. User visits page 1
2. Server sends 401 Unauthorised header
3. Browser does not have any login details for the realm and prompts user
4. User inputs credentials, browser re-submits the request with the credentials 
attached
5. User visits page 2
6. Server sends 401 Unauthorised header
7. Browser has login details for the realm and re-submits the request with the 
credentials attached

From the conclusion I came to after my research, there is no reliable way for 
the server to de-authorise a login after a 401 request.

There are tricks you can do on the server, such as changing the authentication 
realm when the user has logged out - but if the user visits the same site again 
the realms will match and they will be logged in.

I've seen a "hack" which uses a cookie on the user's machine - if the user has 
the cookie, the correct authentication realm is returned in the authentication 
request.  If the user doesn't have the cookie, the server sends a random realm 
to trick the browser into thinking it's not logged in.  By the time you've done 
all that, you might as well just use sessions.

Regards,
Andy

--- End Message ---
--- Begin Message ---
Hi all
I am having a problem in connection to an SSL enabled ldap server.
In localhost is easily connects to the ldap server with SSL but if try to
connect remotely then it cannot bind to ldap server but can connect.

In the slapd.conf I added the 3 lines to enable SSL
TLSCACertificateFile /usr/local/openssl/misc/demoCA/cacert.pem
TLSCertificateFile /usr/local/openssl/misc/server-cert.pem
TLSCertificateKeyFile /usr/local/openssl/misc/server-key.pem

and then restarted the ldap which is also working in 636 port.

Currently its working in default port without SSL but whenever use the ssl
then it gives the message :
"Could not bind to ldap database"

I have installed the rpms and in phpinfo there is a --with-ssl option too.
Though I have generated the CA and server certificates with compiled
openssl.

Here is ldapconnect code;
<?php
// Ldap bind user credentials
$LDAP_Auth_User = "cn=Manager,dc=example,dc=com";
$LDAP_Auth_PWD = "password";

// Connecting to ldap server
$ldapconnect = ldap_connect ("ldaps://dc.example.com") or die ("Cannot
Connect to OpenLDAP Server");

// Checking whether ldap connection is successful
if ($ldapconnect) {
$bindldap = ldap_bind($ldapconnect,$LDAP_Auth_User, $LDAP_Auth_PWD) or die
("Could not bind to LDAP Database");
}
?>

Any idea.

--- End Message ---
--- Begin Message ---
Hello Everyone,

I have installed PHP, Apache and MySQL on a Windows 7 machine :(......... I
would prefer linux or unix :)

These have been setup and working correctly. However when I access a php
page. I get the save as dialog. Has anyone ever experinced such a situation.
Can anyone please advise.

Thank you very much in advance.

Julian

--- End Message ---
--- Begin Message ---
That means its not recognizing the php code and thats why its giving the
download prompt. why not install xampp or wamp.

On Fri, Nov 27, 2009 at 4:24 AM, Julian Muscat Doublesin <
[email protected]> wrote:

> Hello Everyone,
>
> I have installed PHP, Apache and MySQL on a Windows 7 machine :(......... I
> would prefer linux or unix :)
>
> These have been setup and working correctly. However when I access a php
> page. I get the save as dialog. Has anyone ever experinced such a
> situation.
> Can anyone please advise.
>
> Thank you very much in advance.
>
> Julian
>



-- 
- Ŧ₳ᶇṾḛḗƦ

--- End Message ---
--- Begin Message ---
Julian Muscat Doublesin wrote:
Hello Everyone,

I have installed PHP, Apache and MySQL on a Windows 7 machine :(......... I
would prefer linux or unix :)

These have been setup and working correctly. However when I access a php
page. I get the save as dialog. Has anyone ever experinced such a situation.
Can anyone please advise.

Thank you very much in advance.

Apache obviously does not know how to handle the .php files, so you need to update httpd.conf so it can both handle them and load php.

Things get a little tricky depending on WHICH pache and php which you do not say, but http://uk3.php.net/manual/en/install.windows.apache2.php should point you in the right direction ...

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
You are probably missing something like this in the apache httpd.conf:

LoadModule php5_module "c:/PHP/php5apache2_2.dll"
PHPIniDir "c:/PHP/php.ini"
AddType application/x-httpd-php .php
DirectoryIndex index.php index.html index.html.var

Regards,

Jonathan

On Fri, Nov 27, 2009 at 6:24 AM, Julian Muscat Doublesin
<[email protected]> wrote:
> Hello Everyone,
>
> I have installed PHP, Apache and MySQL on a Windows 7 machine :(......... I
> would prefer linux or unix :)
>
> These have been setup and working correctly. However when I access a php
> page. I get the save as dialog. Has anyone ever experinced such a situation.
> Can anyone please advise.
>
> Thank you very much in advance.
>
> Julian
>

--- End Message ---

Reply via email to