function wp_login($username, $password, $already_md5 = false) { global $db, $error; if ('' == $username) { return false; } if ('' == $password) { $error = __('<strong>Error</strong>: The password field is empty.'); return false; } $user = new WP_User($username); if (!$user || !$user->ID) { $error = __('<strong>Error</strong>: Wrong username.'); return false; } if (!WP_Pass::check_password($password, $user->data->user_pass, $user->ID)) { $error = __('<strong>Error</strong>: Incorrect password.'); $pwd = ''; return false; } if (!$user->has_cap('supporter') && !$user->has_cap('supportpressadmin')) { return false; } return true; }
/** * Set $this as the current user if $password patches this user's password */ function login($password) { if (!WP_Pass::check_password($password, $this->user_pass, $this->id)) { return false; } $this->set_as_current(); return true; }
function bb_check_password($password, $hash, $user_id = '') { return WP_Pass::check_password($password, $hash, $user_id); }