[wp-cvs] wordpress/wp-includes functions.php, 1.185, 1.186 template-functions-comment.php, 1.31, 1.32 template-functions-post.php, 1.30, 1.31 functions-user.php, 1.4, NONE

Matthew Mullenweg saxmatt at users.sourceforge.net
Sun Oct 10 18:02:32 UTC 2004


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

Modified Files:
	functions.php template-functions-comment.php 
	template-functions-post.php 
Removed Files:
	functions-user.php 
Log Message:
Move to cookiehash define, use wp_login()  function for auth.php.

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.185
retrieving revision 1.186
diff -C2 -d -r1.185 -r1.186
*** functions.php	8 Oct 2004 19:49:58 -0000	1.185
--- functions.php	10 Oct 2004 18:02:29 -0000	1.186
***************
*** 157,165 ****
  
  function get_currentuserinfo() { // a bit like get_userdata(), on steroids
! 	global $user_login, $userdata, $user_level, $user_ID, $user_nickname, $user_email, $user_url, $user_pass_md5, $cookiehash;
  	// *** retrieving user's data from cookies and db - no spoofing
  
! 	if (isset($_COOKIE['wordpressuser_' . $cookiehash])) 
! 		$user_login = $_COOKIE['wordpressuser_' . $cookiehash];
  	$userdata = get_userdatabylogin($user_login);
  	$user_level = $userdata->user_level;
--- 157,165 ----
  
  function get_currentuserinfo() { // a bit like get_userdata(), on steroids
! 	global $user_login, $userdata, $user_level, $user_ID, $user_nickname, $user_email, $user_url, $user_pass_md5;
  	// *** retrieving user's data from cookies and db - no spoofing
  
! 	if (isset($_COOKIE['wordpressuser_' . COOKIEHASH])) 
! 		$user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
  	$userdata = get_userdatabylogin($user_login);
  	$user_level = $userdata->user_level;
***************
*** 1891,1893 ****
  }
  
! ?>
--- 1891,1921 ----
  }
  
! function wp_login($username, $password, $already_md5 = false) {
! 	global $wpdb, $error;
! 
! 	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.');
! 		return false;
! 	} else {
! 
! 		if ( ($login->user_login == $username && $login->user_pass == $password) || ($already_md5 && $login->user_login == $username && md5($login->user_pass) == $password) ) {
! 			return true;
! 		} else {
! 			$error = __('<strong>Error</strong>: Incorrect password.');
! 			$pwd = '';
! 			return false;
! 		}
! 	}
! }
! 
! ?>
\ No newline at end of file

--- functions-user.php DELETED ---

Index: template-functions-comment.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-comment.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** template-functions-comment.php	30 Sep 2004 17:56:16 -0000	1.31
--- template-functions-comment.php	10 Oct 2004 18:02:29 -0000	1.32
***************
*** 18,28 ****
  
  function comments_template() {
! 	global $withcomments, $post, $wpdb, $id, $comment, $cookiehash;
  
  	if ( is_single() || $withcomments ) :
  		$req = get_settings('require_name_email');
!         $comment_author = isset($_COOKIE['comment_author_'.$cookiehash]) ? trim(stripslashes($_COOKIE['comment_author_'.$cookiehash])) : '';
! 		$comment_author_email = isset($_COOKIE['comment_author_email_'.$cookiehash]) ? trim(stripslashes($_COOKIE['comment_author_email_'.$cookiehash])) : '';
! 		$comment_author_url = isset($_COOKIE['comment_author_url_'.$cookiehash]) ? trim(stripslashes($_COOKIE['comment_author_url_'.$cookiehash])) : '';
  		$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date");
  
--- 18,28 ----
  
  function comments_template() {
! 	global $withcomments, $post, $wpdb, $id, $comment;
  
  	if ( is_single() || $withcomments ) :
  		$req = get_settings('require_name_email');
!         $comment_author = isset($_COOKIE['comment_author_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_'.COOKIEHASH])) : '';
! 		$comment_author_email = isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_email_'.COOKIEHASH])) : '';
! 		$comment_author_url = isset($_COOKIE['comment_author_url_'.COOKIEHASH]) ? trim(stripslashes($_COOKIE['comment_author_url_'.COOKIEHASH])) : '';
  		$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date");
  
***************
*** 91,95 ****
  
  function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
!     global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $cookiehash;
      global $querystring_start, $querystring_equal, $querystring_separator;
      global $comment_count_cache;
--- 91,95 ----
  
  function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
!     global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb;
      global $querystring_start, $querystring_equal, $querystring_separator;
      global $comment_count_cache;
***************
*** 106,110 ****
      } else {
          if (!empty($post->post_password)) { // if there's a password
!             if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) {  // and it doesn't match the cookie
                  echo('Enter your password to view comments');
                  return;
--- 106,110 ----
      } else {
          if (!empty($post->post_password)) { // if there's a password
!             if ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
                  echo('Enter your password to view comments');
                  return;

Index: template-functions-post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-post.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** template-functions-post.php	9 Oct 2004 02:03:37 -0000	1.30
--- template-functions-post.php	10 Oct 2004 18:02:29 -0000	1.31
***************
*** 98,107 ****
  function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
      global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages;
!     global $preview, $cookiehash;
      global $pagenow;
      $output = '';
  
      if (!empty($post->post_password)) { // if there's a password
!         if (stripslashes($_COOKIE['wp-postpass_'.$cookiehash]) != $post->post_password) {  // and it doesn't match the cookie
              $output = get_the_password_form();
              return $output;
--- 98,107 ----
  function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
      global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages;
!     global $preview;
      global $pagenow;
      $output = '';
  
      if (!empty($post->post_password)) { // if there's a password
!         if (stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password) {  // and it doesn't match the cookie
              $output = get_the_password_form();
              return $output;
***************
*** 177,185 ****
  function get_the_excerpt($fakeit = true) {
      global $id, $post;
-     global $cookiehash;
      $output = '';
      $output = $post->post_excerpt;
      if (!empty($post->post_password)) { // if there's a password
!         if ($_COOKIE['wp-postpass_'.$cookiehash] != $post->post_password) {  // and it doesn't match the cookie
              $output = __('There is no excerpt because this is a protected post.');
              return $output;
--- 177,184 ----
  function get_the_excerpt($fakeit = true) {
      global $id, $post;
      $output = '';
      $output = $post->post_excerpt;
      if (!empty($post->post_password)) { // if there's a password
!         if ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
              $output = __('There is no excerpt because this is a protected post.');
              return $output;




More information about the cvs mailing list