[wp-cvs] wordpress/wp-includes functions.php,1.222,1.223
Matthew Mullenweg
saxmatt at users.sourceforge.net
Tue Dec 14 03:00:58 UTC 2004
- Previous message: [wp-cvs] wordpress/wp-admin admin.php, 1.2, 1.3 index.php, 1.9,
1.10 profile.php, 1.35, 1.36 auth.php, 1.15, NONE
- Next message: [wp-cvs] wordpress/wp-admin install.php,1.49,1.50
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8348/wp-includes
Modified Files:
functions.php
Log Message:
Move all auth stuff into functions.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.222
retrieving revision 1.223
diff -C2 -d -r1.222 -r1.223
*** functions.php 12 Dec 2004 20:41:17 -0000 1.222
--- functions.php 14 Dec 2004 03:00:55 -0000 1.223
***************
*** 1955,1958 ****
--- 1955,1959 ----
}
+ if ( !function_exists('wp_login') ) :
function wp_login($username, $password, $already_md5 = false) {
global $wpdb, $error;
***************
*** 1983,1986 ****
--- 1984,2005 ----
}
}
+ endif;
+
+ if ( !function_exists('auth_redirect') ) :
+ function auth_redirect() {
+ // Checks if a user is logged in, if not redirects them to the login page
+ 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();
+ }
+ }
+ endif;
function is_plugin_page() {
- Previous message: [wp-cvs] wordpress/wp-admin admin.php, 1.2, 1.3 index.php, 1.9,
1.10 profile.php, 1.35, 1.36 auth.php, 1.15, NONE
- Next message: [wp-cvs] wordpress/wp-admin install.php,1.49,1.50
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cvs
mailing list