473,498 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

authentication problem

I have installed the open source PHP Deadlock authentication system.
It uses .htpasswd and .htaccess files. This works well apart from it
doesn't allow user logout without closing their browser. The logout
script is shown below.

Any suggestions to make it work? Or any other php authentication
system that allows user registration, email confirmation, forgotten
password reminders, and logout.

<?
/
************************************************** ****************************
* This file is part of the Deadlock PHP User Management
System. *
*
*
* File Description: Logs a user out of the protected
area. *
*
*
* Deadlock is free software; you can redistribute it and/or
modify *
* it under the terms of the GNU General Public License as published
by *
* the Free Software Foundation; either version 2 of the License,
or *
* (at your option) any later
version. *
*
*
* Deadlock is distributed in the hope that it will be
useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty
of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the *
* GNU General Public License for more
details. *
*
*
* You should have received a copy of the GNU General Public
License *
* along with Deadlock; if not, write to the Free
Software *
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA *
************************************************** ****************************/

/*
Enter the path to deadlock that is relative to the document root
For example, if deadlock is at http://yoursite.com/deadlock/, here
you would
just enter the /deadlock/. Be sure to enter a trailing forward
slash!
*/
$deadlock_path = '/deadlock/';

/*
Below, you should specify the page to redirect to when the user has
been logged out.
*/
$redirect = 'http://yoursite.com/logged_out.html';

/* You do NOT need to modify below this line
-------------------------------------------------------------------------------------------
*/

require($_SERVER['DOCUMENT_ROOT'].$deadlock_path.'db_config.php');

mysql_connect($mysql['host'],$mysql['username'],$mysql['password']) or
die('Could not connect to mysql.');
mysql_select_db($mysql['database']) or die('Could not select mysql
database.');

if($result = mysql_query('SELECT * FROM '.$mysql['prefix'].'config'))
{
while (($row = mysql_fetch_array($result)) != false) {
$config[$row['option_name']] = $row['value'];
}
} else {
die('MySQL query failed. MySQL said: '.mysql_error());
}

if($config['digest_auth'] == 'true'){
die('The logout script does not support digest authentication.');
}

header("WWW-Authenticate: Basic realm=
\"{$config['protected_area_name']}\"");
header("Status: 401 Unauthorized");
header("HTTP-Status: 401 Unauthorized");
header("Location: ".$redirect);
exit;

?>

Apr 4 '07 #1
1 1620
ab**********@yahoo.com wrote:
I have installed the open source PHP Deadlock authentication system.
It uses .htpasswd and .htaccess files. This works well apart from it
doesn't allow user logout without closing their browser.
Yes - it can't - that's the way HTTP authentication was designed.
>
Any suggestions to make it work? Or any other php authentication
system that allows user registration, email confirmation, forgotten
password reminders, and logout.
Use PHP sessions.

And if you must send a password from the client...
die('The logout script does not support digest authentication.');
....always make sure its encrypted.

C.

Apr 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
9259
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
5
673
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
4
1921
by: Paul M | last post by:
hi there, i've got a website i created, that i've put onto my test server on the web. I have a login page, that when the user comes to it, it first pops up a windows authentication dialog box,...
5
2841
by: Gavin Stevens | last post by:
I'm trying to figure out the ASP.NET Forms Auth I have 3 or 4 pages i want to allow anonymous access to.. Then I have 5 or 6 pages I placed in another directory in the webproject. These I want...
4
2176
by: Chris Gatto | last post by:
Hi, I'm having what should be a minor problem but has turned into a 2 day slug fest with ASP.Net. I am simply attempting to authenticate my asp.net application users against users in an AD...
6
3297
by: Ming Zhang | last post by:
Hi guys, I have couple of ASP.NET applications that only support digest windows authentication, and credentials are managed in a central AD. When users login to one app, they can easily navigate...
4
4645
by: pjdouillard | last post by:
Hello all, Here is the context of my problem: We have an ASP.NET 1.1 application that has its own application pool setup and that runs under the identity of a NT Domain service account (this...
3
1557
by: KNC | last post by:
Hi all, I'm developing a website and deployed on webserver, it always display an authentication dialog that user must login with valid Windows user. Would anyone helps to instruct how to...
2
7499
by: Frank Swarbrick | last post by:
I am trying to understand "client authentication" works. My environment is DB2/UDB LUW 8.2 on zSeries SLES9 as the database server and DB2 for VSE 7.4 as the client. We currently have DB2/LUW set...
4
424
by: =?Utf-8?B?R3V1czEyMw==?= | last post by:
Hi, I created a web site on a remote server. To logon the user must enter a user id and password. The site is uses Forms Authentication. The web config file looks as follows: ...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.