[wp-cvs] wordpress/wp-includes functions-user.php, 1.2, 1.3 functions.php, 1.176, 1.177

Matthew Mullenweg saxmatt at users.sourceforge.net
Mon Oct 4 08:03:53 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26011/wp-includes

Modified Files:
	functions-user.php functions.php 
Log Message:
Code cleanup and some fixes from the WP Japan folks.

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.176
retrieving revision 1.177
diff -C2 -d -r1.176 -r1.177
*** functions.php	4 Oct 2004 07:44:04 -0000	1.176
--- functions.php	4 Oct 2004 08:03:50 -0000	1.177
***************
*** 560,572 ****
  // ( or just any time between timer_start() and timer_stop() )
  
- function timer_start() {
- 	global $timestart;
- 	$mtime = microtime();
- 	$mtime = explode(' ',$mtime);
- 	$mtime = $mtime[1] + $mtime[0];
- 	$timestart = $mtime;
- 	return true;
- }
- 
  function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
  	global $timestart, $timeend;
--- 560,563 ----

Index: functions-user.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions-user.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** functions-user.php	9 Aug 2004 09:06:49 -0000	1.2
--- functions-user.php	4 Oct 2004 08:03:50 -0000	1.3
***************
*** 1,41 ****
  <?php
  
! function verify_login($user, $password) {
! 	global $wpdb;
! 	$user = $wpdb->escape($user);
! 	$password = $password;
  
! 	if ( $user = $wpdb->get_row("SELECT user_login, user_pass FROM $wpdb->users WHERE user_login = '$user'") ) {
! 		if ( $user->user_pass = md5($password) )
! 			return true;
! 		else
! 			return false;
! 	} else {
  		return false;
- 	}
- }
  
! function verify_current() {
! 	if (!empty($_COOKIE['wordpressuser_' . COOKIEHASH])) {
! 		$user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
! 		$user_pass = $_COOKIE['wordpresspass_' . COOKIEHASH];
! 	} else {
  		return false;
  	}
  
! 	if ('' == $user_login)
! 		return false;
! 	if ('' == $user_pass)
! 		return false;
  
! 	if ( verify_login($user_login, $user_pass) ) {
! 		return true;
  	} else {
! 		header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
! 		header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
! 		header('Cache-Control: no-cache, must-revalidate');
! 		header('Pragma: no-cache');
! 		header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']) );
! 		exit();
  	}
  }
--- 1,32 ----
  <?php
  
! function login($username, $password, $already_md5 = false) {
! 	global $wpdb, $error;
! 	if ( !$already_md5 )
! 		$pwd = md5($password);
  
! 	if ( !$username )
  		return false;
  
! 	if ( !$password ) {
! 		$error = __('<strong>Error</strong>: The password field is empty.');
  		return false;
  	}
  
! 	$login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");
  
! 	if (!$login) {
! 		$error = __('<strong>Error</strong>: Wrong login.');
! 		$pwd = '';
! 		return false;
  	} else {
! 
! 		if ( $login->user_login == $username && $login->user_pass == $pwd ) {
! 			return true;
! 		} else {
! 			$error = __('<strong>Error</strong>: Incorrect password.');
! 			$pwd = '';
! 			return false;
! 		}
  	}
  }




More information about the cvs mailing list