[wp-cvs] wordpress/wp-admin auth.php,1.5,1.5.4.1

Ryan Boren rboren at users.sourceforge.net
Sat Nov 27 22:54:54 UTC 2004


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

Modified Files:
      Tag: WordPress-Ver-1_2-Branch
	auth.php 
Log Message:
Login cleanup.  Port from 1.3.

Index: auth.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/auth.php,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -C2 -d -r1.5 -r1.5.4.1
*** auth.php	19 May 2004 07:05:40 -0000	1.5
--- auth.php	27 Nov 2004 22:54:52 -0000	1.5.4.1
***************
*** 1,49 ****
  <?php
  
! require_once('../wp-config.php');
! 
! /* Checking login & pass in the database */
! function veriflog() {
! 	global $cookiehash;
! 	global $tableusers, $wpdb;
! 
! 	if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) {
! 		$user_login = $_COOKIE['wordpressuser_' . $cookiehash];
! 		$user_pass_md5 = $_COOKIE['wordpresspass_' . $cookiehash];
! 	} else {
! 		return false;
! 	}
! 
! 	if ('' == $user_login)
! 		return false;
! 	if (!$user_pass_md5)
! 		return false;
! 
! 	$login = $wpdb->get_row("SELECT user_login, user_pass FROM $tableusers WHERE user_login = '$user_login'");
! 
! 	if (!$login) {
! 		return false;
! 
! 	} else {
! 		if ($login->user_login == $user_login && md5($login->user_pass) == $user_pass_md5) {
! 			return true;
! 		} else {
! 			return false;
! 		}
! 	}
! }
! 
! if ( !veriflog() ) {
! 	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');
! 	if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) {
! 		$error= __("<strong>Error</strong>: wrong login or password.");
! 	}
! 	$redir = 'Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']);
! 	header($redir);
  	exit();
  }
  
! ?>
\ No newline at end of file
--- 1,15 ----
  <?php
+ require_once(ABSPATH . '/wp-config.php');
  
! if ( (!empty($_COOKIE['wordpressuser_' . $cookiehash]) && !wp_login($_COOKIE['wordpressuser_' . $cookiehash], $_COOKIE['wordpresspass_' . $cookiehash], true))
! 	|| (empty($_COOKIE['wordpressuser_' . $cookiehash])) ) {
! 	header('Expires: Wed, 5 Jun 1979 23:41:00 GMT'); // Michel's birthday
  	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();
  }
  
! ?>




More information about the cvs mailing list