login ok but the function is stopped
-
I’ve this function to login in, but after this i’ve other operations that necessary the login like current_user_can…the login work but after this the other operations are stopped, why ?
function panel_user_login() {
$user_login = '';
$user_pass = '';
$using_cookie = false;if( $_POST ) {
$user_login = $_POST['log'];
$user_login = sanitize_user( $user_login );
$user_pass = $_POST['pwd'];
$rememberme = $_POST['rememberme'];
} else {
$cookie_login = wp_get_cookie_login();
if ( ! empty($cookie_login) ) {
$using_cookie = true;
$user_login = $cookie_login['login'];
$user_pass = $cookie_login['password'];
}
}do_action('wp_authenticate', array(&$user_login, &$user_pass));
if ( $user_login && $user_pass ) {
$user = new WP_User(0, $user_login);if ( wp_login($user_login, $user_pass, $using_cookie) ) {
if ( !$using_cookie )
wp_setcookie($user_login, $user_pass, false, '', '', $rememberme);
do_action('wp_login', $user_login);
} else {
if ( $using_cookie )
$error = __('Your session has expired.');
}
}
}panel_user_login();
- The topic ‘login ok but the function is stopped’ is closed to new replies.