cvs: docweb /include lib_auth.inc.php

[email protected] ("Jacques Marneweck")
Newsgroups php.doc.web
Message-ID <cvsjacques1108286482@cvsserver>
jacques		Sun Feb 13 04:21:22 2005 EDT

  Modified files:              
    /docweb/include	lib_auth.inc.php 
  Log:
  Forgot to commit this last nite.
  
  
http://cvs.php.net/diff.php/docweb/include/lib_auth.inc.php?r1=1.2&r2=1.3&ty=u
Index: docweb/include/lib_auth.inc.php
diff -u docweb/include/lib_auth.inc.php:1.2 docweb/include/lib_auth.inc.php:1.3
--- docweb/include/lib_auth.inc.php:1.2	Sat Feb 12 19:15:57 2005
+++ docweb/include/lib_auth.inc.php	Sun Feb 13 04:21:22 2005
@@ -16,7 +16,7 @@
  * | Authors: Jacques Marneweck <[email protected]>                         |
  * +----------------------------------------------------------------------+
  *
- * $Id: lib_auth.inc.php,v 1.2 2005/02/13 00:15:57 jacques Exp $
+ * $Id: lib_auth.inc.php,v 1.3 2005/02/13 09:21:22 jacques Exp $
  */
 
 require_once 'cvs-auth.inc';
@@ -33,6 +33,19 @@
 		Header ("Location: http://doc.php.net/login.php");
 		exit;
 	}
+} elseif (isset($_POST['username']) && isset($_POST['passwd'])) {
+	if (!$_POST['username'] || !$_POST['passwd'] || !verify_password($_POST['username'], stripslashes($_POST['passwd']))) {
+		Header ("Location: http://doc.php.net/login.php");
+		exit;
+	}
+
+	setcookie(
+		"MAGIC_COOKIE",
+		base64_encode("{$_POST['username']}:{$_POST['passwd']}"),
+		time()+3600*24*12,
+		'/',
+		'.php.net'
+	);
 } else {
 	Header ("Location: http://doc.php.net/login.php");
 	exit;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.