cvs: docweb /include cvs-auth.inc

[email protected] ("Philip Olson")
Newsgroups php.doc.web
Message-ID <cvsphilip1112747556@cvsserver>
philip		Tue Apr  5 20:32:36 2005 EDT

  Modified files:              
    /docweb/include	cvs-auth.inc 
  Log:
  Use sqlite_query() instead of sqlite_exec() as _exec() is undefined on this server.
  
  
http://cvs.php.net/diff.php/docweb/include/cvs-auth.inc?r1=1.4&r2=1.5&ty=u
Index: docweb/include/cvs-auth.inc
diff -u docweb/include/cvs-auth.inc:1.4 docweb/include/cvs-auth.inc:1.5
--- docweb/include/cvs-auth.inc:1.4	Fri Feb 18 13:07:48 2005
+++ docweb/include/cvs-auth.inc	Tue Apr  5 20:32:36 2005
@@ -18,7 +18,7 @@
  * |          Jacques Marneweck <[email protected]>                         |
  * +----------------------------------------------------------------------+
  *
- * $Id: cvs-auth.inc,v 1.4 2005/02/18 18:07:48 nlopess Exp $
+ * $Id: cvs-auth.inc,v 1.5 2005/04/06 00:32:36 philip Exp $
  */
 
 require_once(dirname(__FILE__) . '/../build-ops.php');
@@ -75,6 +75,10 @@
 
 	$res = sqlite_query ($idx, "SELECT * FROM auth WHERE username='" . sqlite_escape_string($user) . "'");
 
+	if (!$res) {
+		return false;
+	}
+
 	if (!$data = sqlite_fetch_array($res, SQLITE_ASSOC)) {
 		return false;
 	}
@@ -109,7 +113,7 @@
 
 	if (auth_vs_cvs($user, $pass)) {
 
-		sqlite_exec($idx, "REPLACE INTO auth VALUES ('" . sqlite_escape_string($user) . "', '" . sha1($pass) . "', '" . time() . "')");
+		sqlite_query($idx, "REPLACE INTO auth VALUES ('" . sqlite_escape_string($user) . "', '" . sha1($pass) . "', '" . time() . "')");
 		sqlite_close($idx);
 
 		return $user;
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.