Changeset 1734
- Timestamp:
- 10/04/2004 08:03:52 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-user.php
r1525 r1734 1 1 <?php 2 2 3 function verify_login($user, $password) {4 global $wpdb ;5 $user = $wpdb->escape($user);6 $password = $password;3 function login($username, $password, $already_md5 = false) { 4 global $wpdb, $error; 5 if ( !$already_md5 ) 6 $pwd = md5($password); 7 7 8 if ( $user = $wpdb->get_row("SELECT user_login, user_pass FROM $wpdb->users WHERE user_login = '$user'") ) { 9 if ( $user->user_pass = md5($password) ) 10 return true; 11 else 12 return false; 13 } else { 8 if ( !$username ) 14 9 return false; 15 }16 }17 10 18 function verify_current() { 19 if (!empty($_COOKIE['wordpressuser_' . COOKIEHASH])) { 20 $user_login = $_COOKIE['wordpressuser_' . COOKIEHASH]; 21 $user_pass = $_COOKIE['wordpresspass_' . COOKIEHASH]; 22 } else { 11 if ( !$password ) { 12 $error = __('<strong>Error</strong>: The password field is empty.'); 23 13 return false; 24 14 } 25 15 26 if ('' == $user_login) 16 $login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'"); 17 18 if (!$login) { 19 $error = __('<strong>Error</strong>: Wrong login.'); 20 $pwd = ''; 27 21 return false; 28 if ('' == $user_pass) 29 return false; 22 } else { 30 23 31 if ( verify_login($user_login, $user_pass) ) { 32 return true; 33 } else { 34 header('Expires: Wed, 11 Jan 1984 05:00:00 GMT'); 35 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); 36 header('Cache-Control: no-cache, must-revalidate'); 37 header('Pragma: no-cache'); 38 header('Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']) ); 39 exit(); 24 if ( $login->user_login == $username && $login->user_pass == $pwd ) { 25 return true; 26 } else { 27 $error = __('<strong>Error</strong>: Incorrect password.'); 28 $pwd = ''; 29 return false; 30 } 40 31 } 41 32 } -
trunk/wp-includes/functions.php
r1733 r1734 560 560 // ( or just any time between timer_start() and timer_stop() ) 561 561 562 function timer_start() {563 global $timestart;564 $mtime = microtime();565 $mtime = explode(' ',$mtime);566 $mtime = $mtime[1] + $mtime[0];567 $timestart = $mtime;568 return true;569 }570 571 562 function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal 572 563 global $timestart, $timeend; -
trunk/wp-login.php
r1733 r1734 1 1 <?php 2 2 require('./wp-config.php'); 3 4 function login($username, $password, $already_md5 = false) {5 global $wpdb, $error;6 if ( !$already_md5 )7 $pwd = md5($password);8 9 if ( !$username )10 return false;11 12 if ( !$password ) {13 $error = __('<strong>Error</strong>: The password field is empty.');14 return false;15 }16 17 $login = $wpdb->get_row("SELECT ID, user_login, user_pass FROM $wpdb->users WHERE user_login = '$username'");18 19 if (!$login) {20 $error = __('<strong>Error</strong>: Wrong login.');21 $pwd = '';22 return false;23 } else {24 25 if ( $login->user_login == $username && $login->user_pass == $pwd ) {26 return true;27 } else {28 $error = __('<strong>Error</strong>: Incorrect password.');29 $pwd = '';30 return false;31 }32 }33 }34 3 35 4 if (!function_exists('add_magic_quotes')) { -
trunk/wp-settings.php
r1712 r1734 10 10 die( 'Your server is running PHP version ' . phpversion() . ' but WordPress requires at least 4.1' ); 11 11 12 function timer_start() { 13 global $timestart; 14 $mtime = explode(' ', microtime() ); 15 $mtime = $mtime[1] + $mtime[0]; 16 $timestart = $mtime; 17 return true; 18 } 19 timer_start(); 12 20 13 21 // Change to E_ALL for development/debugging … … 41 49 42 50 require (ABSPATH . WPINC . '/functions.php'); 43 timer_start();44 51 require (ABSPATH . WPINC . '/functions-formatting.php'); 45 52 require (ABSPATH . WPINC . '/functions-user.php'); -
trunk/wp-trackback.php
r1708 r1734 35 35 $excerpt = $_POST['excerpt']; 36 36 $blog_name = $_POST['blog_name']; 37 $charset = $_POST['charset']; 38 39 if ($charset) 40 $charset = strtoupper( trim($charset) ); 41 else 42 $charset = 'auto'; 43 44 if ( function_exists('mb_convert_encoding') ) { 45 $title = mb_convert_encoding($title, get_settings('blog_charset'), $charset); 46 $excerpt = mb_convert_encoding($excerpt, get_settings('blog_charset'), $charset); 47 $blog_name = mb_convert_encoding($blog_name, get_settings('blog_charset'), $charset); 48 } 37 49 38 50 if ( is_single() )
Note: See TracChangeset
for help on using the changeset viewer.