Some code cleanups.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-12-18 20:56:26 +00:00
parent b3a3894b2a
commit fef86c9964
4 changed files with 16 additions and 47 deletions

View File

@ -1,6 +1,6 @@
<?php
require_once('admin.php');
$title = __('Template &amp; file editing');
$title = __('Template &amp; File Editing');
$parent_file = 'edit.php';
$wpvarstoreset = array('action','redirect','profile','error','warning','a','file');

View File

@ -43,10 +43,6 @@ header('Pragma: no-cache');
$location = get_permalink($comment_post_ID);
if ($is_IIS) {
header("Refresh: 0;url=$location");
} else {
header("Location: $location");
}
?>

View File

@ -107,7 +107,6 @@ $wp_gecko_correction['out'] = array(
// Server detection
$is_apache = strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') ? 1 : 0;
$is_IIS = strstr($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') ? 1 : 0;
// if the config file does not provide the smilies array, let's define it here
if (!isset($wpsmiliestrans)) {

View File

@ -1,23 +1,7 @@
<?php
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"];
}
}
}
$action = $_REQUEST['action'];
$error = '';
header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
@ -36,9 +20,6 @@ case 'logout':
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
if ($is_IIS)
header('Refresh: 0;url=wp-login.php');
else
header('Location: wp-login.php');
exit();
@ -141,9 +122,8 @@ default:
}
$user = get_userdatabylogin($user_login);
if (0 == $user->user_level) {
if ( 0 == $user->user_level )
$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
}
if ($user_login && $user_pass) {
if ( wp_login($user_login, $user_pass, $using_cookie) ) {
@ -153,9 +133,6 @@ default:
setcookie('wordpresspass_'. COOKIEHASH, $user_pass, time() + 31536000, COOKIEPATH);
}
if ($is_IIS)
header("Refresh: 0;url=$redirect_to");
else
header("Location: $redirect_to");
exit();
} else {
@ -163,7 +140,8 @@ default:
$error = __('Your session has expired.');
}
}
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">
@ -173,7 +151,6 @@ default:
<link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/wp-admin.css" type="text/css" />
<script type="text/javascript">
function focusit() {
// focus on first input field
document.getElementById('log').focus();
}
window.onload = focusit;
@ -191,12 +168,9 @@ if ($error)
<form name="loginform" id="loginform" action="wp-login.php" method="post">
<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'); ?> &raquo;" 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 class="submit">
<input type="submit" name="submit" value="<?php _e('Login'); ?> &raquo;" tabindex="3" />
<input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" />
</p>
</form>
<ul>