cvs: docweb /include lib_auth.inc.php
| From: | Jacques Marneweck | Date: | Thu, 13 Jan 2005 17:22:40 +0000 |
| Subject: | cvs: docweb /include lib_auth.inc.php | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-463@lists.php.net to get a copy of this message | ||
jacques Thu Jan 13 12:22:40 2005 EDT
Added files:
/docweb/include lib_auth.inc.php
Log:
Part one of the whole credential caching and auth code for doc.php.net
Add the following line close to the top of a file which requires users to
be authenticated:
require_once 'lib_auth.inc.php';
Currently I'm using http://master.php.net/ to do the
login parts in the
interim.
http://cvs.php.net/co.php/docweb/include/lib_auth.inc.php?r=1.1&p=1
Index: docweb/include/lib_auth.inc.php
+++ docweb/include/lib_auth.inc.php
<?php
/**
* +----------------------------------------------------------------------+
* | PHP Documentation Site Source Code |
* +----------------------------------------------------------------------+
* | Copyright (c) 1997-2005 The PHP Group |
* +----------------------------------------------------------------------+
* | This source file is subject to version 3.0 of the PHP license, |
* | that is bundled with this package in the file LICENSE, and is |
* | available at through the world-wide-web at |
* | http://www.php.net/license/3_0.txt.
|
* | If you did not receive a copy of the PHP license and are unable to |
* | obtain it through the world-wide-web, please send a note to |
* | license@php.net so we can mail you a copy immediately. |
* +----------------------------------------------------------------------+
* | Authors: Jacques Marneweck <jacques@php.net> |
* +----------------------------------------------------------------------+
*
* $Id: lib_auth.inc.php,v 1.1 2005/01/13 17:22:40 jacques Exp $
*/
require_once 'cvs-auth.inc';
$user = $pw = false;
/**
* Credential checking of the $_COOKIE['MAGIC_COOKIE']
*/
if (isset($_COOKIE['MAGIC_COOKIE'])) {
list($user, $pw) = explode(":", base64_decode($_COOKIE['MAGIC_COOKIE']));
if (!$user || !$pw || !verify_password($user,stripslashes($pw))) {
Header ("Location: http://master.php.net/manage/users.php");
exit;
}
} else {
Header ("Location: http://master.php.net/manage/users.php");
exit;
}
/* vim: set noet ts=4 sw=4 ft=php: : */