[wp-cvs] wordpress wp-comments-post.php, 1.22, 1.23 wp-login.php,
1.46, 1.47
Matthew Mullenweg
saxmatt at users.sourceforge.net
Sat Dec 18 20:56:28 UTC 2004
Update of /cvsroot/cafelog/wordpress
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23480
Modified Files:
wp-comments-post.php wp-login.php
Log Message:
Some code cleanups.
Index: wp-comments-post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-comments-post.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** wp-comments-post.php 17 Dec 2004 08:44:30 -0000 1.22
--- wp-comments-post.php 18 Dec 2004 20:56:25 -0000 1.23
***************
*** 44,52 ****
$location = get_permalink($comment_post_ID);
! if ($is_IIS) {
! header("Refresh: 0;url=$location");
! } else {
! header("Location: $location");
! }
?>
\ No newline at end of file
--- 44,48 ----
$location = get_permalink($comment_post_ID);
! header("Location: $location");
?>
\ No newline at end of file
Index: wp-login.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-login.php,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** wp-login.php 16 Dec 2004 02:56:57 -0000 1.46
--- wp-login.php 18 Dec 2004 20:56:25 -0000 1.47
***************
*** 2,22 ****
require( dirname(__FILE__) . '/wp-config.php' );
! $wpvarstoreset = array('action');
!
! for ($i = 0; $i < count($wpvarstoreset); $i = $i + 1) {
! $wpvar = $wpvarstoreset[$i];
! if (!isset($$wpvar)) {
! if (empty($_POST["$wpvar"])) {
! if (empty($_GET["$wpvar"])) {
! $$wpvar = '';
! } else {
! $$wpvar = $_GET["$wpvar"];
! }
! } else {
! $$wpvar = $_POST["$wpvar"];
! }
! }
! }
!
$error = '';
--- 2,6 ----
require( dirname(__FILE__) . '/wp-config.php' );
! $action = $_REQUEST['action'];
$error = '';
***************
*** 37,44 ****
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
! if ($is_IIS)
! header('Refresh: 0;url=wp-login.php');
! else
! header('Location: wp-login.php');
exit();
--- 21,25 ----
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
! header('Location: wp-login.php');
exit();
***************
*** 129,138 ****
if( !empty($_POST) ) {
$user_login = $_POST['log'];
! $user_pass = $_POST['pwd'];
$redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_POST['redirect_to']);
} elseif ( !empty($_COOKIE) ) {
! if (! empty($_COOKIE['wordpressuser_' . COOKIEHASH]))
$user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
! if (! empty($_COOKIE['wordpresspass_' . COOKIEHASH])) {
$user_pass = $_COOKIE['wordpresspass_' . COOKIEHASH];
$using_cookie = true;
--- 110,119 ----
if( !empty($_POST) ) {
$user_login = $_POST['log'];
! $user_pass = $_POST['pwd'];
$redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_POST['redirect_to']);
} elseif ( !empty($_COOKIE) ) {
! if (! empty($_COOKIE['wordpressuser_' . COOKIEHASH]) )
$user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
! if (! empty($_COOKIE['wordpresspass_' . COOKIEHASH]) ) {
$user_pass = $_COOKIE['wordpresspass_' . COOKIEHASH];
$using_cookie = true;
***************
*** 142,148 ****
$user = get_userdatabylogin($user_login);
! if (0 == $user->user_level) {
$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
- }
if ($user_login && $user_pass) {
--- 123,128 ----
$user = get_userdatabylogin($user_login);
! if ( 0 == $user->user_level )
$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
if ($user_login && $user_pass) {
***************
*** 154,161 ****
}
! if ($is_IIS)
! header("Refresh: 0;url=$redirect_to");
! else
! header("Location: $redirect_to");
exit();
} else {
--- 134,138 ----
}
! header("Location: $redirect_to");
exit();
} else {
***************
*** 164,169 ****
}
}
!
! ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
--- 141,147 ----
}
}
! if ( isset($_REQUEST['redirect_to']) )
! $redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_REQUEST['redirect_to']);
! ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
***************
*** 174,178 ****
<script type="text/javascript">
function focusit() {
- // focus on first input field
document.getElementById('log').focus();
}
--- 152,155 ----
***************
*** 185,189 ****
<h1><a href="http://wordpress.org/">WordPress</a></h1>
<?php
! if ($error)
echo "<div id='login_error'>$error</div>";
?>
--- 162,166 ----
<h1><a href="http://wordpress.org/">WordPress</a></h1>
<?php
! if ( $error )
echo "<div id='login_error'>$error</div>";
?>
***************
*** 192,201 ****
<p><label><?php _e('Login') ?>: <input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label></p>
<p><label><?php _e('Password') ?>: <input type="password" name="pwd" value="" size="20" tabindex="2" /></label></p>
! <p class="submit"><input type="submit" name="submit" value="<?php _e('Login'); ?> »" tabindex="3" />
! <?php if (isset($_GET["redirect_to"])) { ?>
! <input type="hidden" name="redirect_to" value="<?php echo $_GET["redirect_to"] ?>" />
! <?php } else { ?>
! <input type="hidden" name="redirect_to" value="wp-admin/" />
! <?php } ?>
</p>
</form>
--- 169,175 ----
<p><label><?php _e('Login') ?>: <input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label></p>
<p><label><?php _e('Password') ?>: <input type="password" name="pwd" value="" size="20" tabindex="2" /></label></p>
! <p class="submit">
! <input type="submit" name="submit" value="<?php _e('Login'); ?> »" tabindex="3" />
! <input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" />
</p>
</form>
More information about the cvs
mailing list