cvs: php-gtk-web /include cvs-auth.inc

[email protected] ("Steph Fox") Fri, 07 Jul 2006 13:32:36 -0000
Newsgroups php.gtk.webmaster
Message-ID <cvssfox1152279156@cvsserver>
sfox		Fri Jul  7 13:32:36 2006 UTC

  Modified files:              
    /php-gtk-web/include	cvs-auth.inc 
  Log:
  h'okay, let's get the ball rolling...
  
http://cvs.php.net/viewvc.cgi/php-gtk-web/include/cvs-auth.inc?r1=1.5&r2=1.6&diff_format=u
Index: php-gtk-web/include/cvs-auth.inc
diff -u php-gtk-web/include/cvs-auth.inc:1.5 php-gtk-web/include/cvs-auth.inc:1.6
--- php-gtk-web/include/cvs-auth.inc:1.5	Wed Jul  5 01:01:06 2006
+++ php-gtk-web/include/cvs-auth.inc	Fri Jul  7 13:32:36 2006
@@ -1,5 +1,5 @@
 <?php
-/* $Id: cvs-auth.inc,v 1.5 2006/07/05 01:01:06 sfox Exp $ */
+/* $Id: cvs-auth.inc,v 1.6 2006/07/07 13:32:36 sfox Exp $ */
 require_once('config.inc');
 
 function get_auth($name, $pass, $connect=null) {
@@ -37,7 +37,7 @@
 
 	$cvs = fsockopen('cvs.php.net', 2401, $errno, $errstr);
 	if (!$cvs)
-		return $errstr;
+		return false;
 
 	$pkt = "BEGIN VERIFICATION REQUEST\n/repository\n$name\n$encoded\nEND VERIFICATION REQUEST\n";
 
@@ -50,11 +50,14 @@
 function verify_password($user, $pass) {
 
 	if (strlen($user) > 0 && strlen($pass) > 0) {
+
 		if (!isset($_COOKIE['GTK'])) {
+
 			$auth = get_auth($user, $pass, true);
-			if (is_bool($auth) && $auth == true) {
+
+			if ($auth == true) {
 				$encoded = get_auth($user, $pass);
-				setcookie('GTK', base64_encode($user.':'.$encoded), time()+(3600*24), '/' );
+				setcookie('GTK', base64_encode($user.':'.$encoded), time()+(3600*24), '/');
 				file_put_contents(DB_DIR."/$user.txt", $encoded);
 			}
 		}