• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_userdatabylogin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_userdatabylogin函数的典型用法代码示例。如果您正苦于以下问题:PHP get_userdatabylogin函数的具体用法?PHP get_userdatabylogin怎么用?PHP get_userdatabylogin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_userdatabylogin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wp_check_bind_user

function wp_check_bind_user($username, $password)
{
    if (empty($password)) {
        return __('<strong>ERROR</strong>: The password field is empty.');
    }
    $userdata = get_userdatabylogin($username);
    if (!$userdata) {
        return sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login'));
    }
    if (is_multisite()) {
        // Is user marked as spam?
        if (1 == $userdata->spam) {
            return __('<strong>ERROR</strong>: Your account has been marked as a spammer.');
        }
        // Is a user's blog marked as spam?
        if (!is_super_admin($userdata->ID) && isset($userdata->primary_blog)) {
            $details = get_blog_details($userdata->primary_blog);
            if (is_object($details) && $details->spam == 1) {
                return __('Site Suspended.');
            }
        }
    }
    $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
    if (is_wp_error($userdata)) {
        return;
    }
    if (!wp_check_password($password, $userdata->user_pass, $userdata->ID)) {
        return sprintf(__('<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?'), $username, site_url('wp-login.php?action=lostpassword', 'login'));
    }
}
开发者ID:liangwei1988,项目名称:wordpress,代码行数:30,代码来源:signup.php


示例2: username_exists

/**
 * Checks whether the given username exists.
 *
 * @since 2.0.0
 *
 * @param string $username Username.
 * @return null|int The user's ID on success, and null on failure.
 */
function username_exists( $username ) {
	if ( $user = get_userdatabylogin( $username ) ) {
		return $user->ID;
	} else {
		return null;
	}
}
开发者ID:realfluid,项目名称:umbaugh,代码行数:15,代码来源:registration.php


示例3: msum_maybe_add_roles

function msum_maybe_add_roles($user_login)
{
    $userdata = get_userdatabylogin($user_login);
    if ($userdata != false && get_user_meta($userdata->ID, 'msum_has_caps', true) != 'true') {
        msum_add_roles($userdata->ID);
    }
}
开发者ID:howardlei82,项目名称:IGSM-Website,代码行数:7,代码来源:ms-user-management.php


示例4: php_exec_process

function php_exec_process($phpexec_text)
{
    $phpexec_userdata = get_userdatabylogin(the_author('login', false));
    if ($phpexec_userdata->user_level >= php_exec_getuserlevel()) {
        $phpexec_doeval = true;
    }
    $phpexec_textarr = preg_split("/(<phpcode>.*<\\/phpcode>)/Us", $phpexec_text, -1, PREG_SPLIT_DELIM_CAPTURE);
    // capture the tags as well as in between
    $phpexec_stop = count($phpexec_textarr);
    // loop stuff
    for ($phpexec_i = 0; $phpexec_i < $phpexec_stop; $phpexec_i++) {
        $phpexec_content = $phpexec_textarr[$phpexec_i];
        if (preg_match("/^<phpcode>(.*)<\\/phpcode>/Us", $phpexec_content, $phpexec_code)) {
            // If it's a phpcode
            $phpexec_php = $phpexec_code[1];
            if ($phpexec_doeval) {
                ob_start();
                eval("?>" . $phpexec_php . "<?php ");
                $phpexec_output .= ob_get_clean();
            } else {
                $phpexec_output .= htmlspecialchars($phpexec_php);
            }
        } else {
            $phpexec_output .= $phpexec_content;
        }
    }
    return $phpexec_output;
}
开发者ID:rajankz,项目名称:webspace,代码行数:28,代码来源:phpexec.php


示例5: wp_authenticate_username_password

function wp_authenticate_username_password($user, $username, $password)
{
    if (is_a($user, 'WP_User')) {
        return $user;
    }
    if (empty($username) || empty($password)) {
        $error = new WP_Error();
        if (empty($username)) {
            $error->add('empty_username', __('<strong>ERROR</strong>: The username field is empty.'));
        }
        if (empty($password)) {
            $error->add('empty_password', __('<strong>ERROR</strong>: The password field is empty.'));
        }
        return $error;
    }
    $userdata = get_userdatabylogin($username);
    if (!$userdata || $userdata->user_login != $username) {
        return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Invalid username.'));
    }
    $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
    if (is_wp_error($userdata)) {
        return $userdata;
    }
    if (!wp_check_password($password, $userdata->user_pass, $userdata->ID)) {
        return new WP_Error('incorrect_password', __('<strong>ERROR</strong>: Incorrect password.'));
    }
    $user = new WP_User($userdata->ID);
    return $user;
}
开发者ID:schr,项目名称:wordpress,代码行数:29,代码来源:user.php


示例6: widget_author_info_card

function widget_author_info_card($args)
{
    if (get_query_var('author_name')) {
        $curauth = get_userdatabylogin(get_query_var('author_name'));
    } else {
        $curauth = get_userdata(get_query_var('author'));
    }
    extract($args);
    echo $before_widget . $before_title;
    // If its the author page.
    if (get_option('sa_add_to_author_page') == 'yes' && is_author()) {
        $title = $curauth->display_name;
        echo $title . $after_title;
        echo sa_author_info_card($curauth);
    } else {
        $title = "List of Authors";
        echo $title . $after_title;
        ob_start();
        wp_list_authors('show_fullname=1&optioncount=1');
        $author_list = ob_get_contents();
        ob_end_clean();
        echo "<ul>{$author_list}</ul>";
    }
    echo $after_widget;
}
开发者ID:ranveerkunal,项目名称:showauthor,代码行数:25,代码来源:showauthor.php


示例7: retrieve_password

/**
 * Handles sending password retrieval email to user.
 *
 * @uses $wpdb WordPress Database object
 *
 * @return bool|WP_Error True: when finish. WP_Error on error
 */
function retrieve_password()
{
    global $wpdb;
    $errors = new WP_Error();
    if (empty($_POST['user_login']) && empty($_POST['user_email'])) {
        $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
    }
    if (strpos($_POST['user_login'], '@')) {
        $user_data = get_user_by_email(trim($_POST['user_login']));
        if (empty($user_data)) {
            $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
        }
    } else {
        $login = trim($_POST['user_login']);
        $user_data = get_userdatabylogin($login);
    }
    do_action('lostpassword_post');
    if ($errors->get_error_code()) {
        return $errors;
    }
    if (!$user_data) {
        $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.'));
        return $errors;
    }
    // redefining user_login ensures we return the right case in the email
    $user_login = $user_data->user_login;
    $user_email = $user_data->user_email;
    do_action('retreive_password', $user_login);
    // Misspelled and deprecated
    do_action('retrieve_password', $user_login);
    $allow = apply_filters('allow_password_reset', true, $user_data->ID);
    if (!$allow) {
        return new WP_Error('no_password_reset', __('Password reset is not allowed for this user'));
    } else {
        if (is_wp_error($allow)) {
            return $allow;
        }
    }
    $user_email = $_POST['user_email'];
    $user_login = $_POST['user_login'];
    $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->users} WHERE user_login = %s", $user_login));
    if (empty($user)) {
        return new WP_Error('invalid_key', __('Invalid key'));
    }
    $new_pass = wp_generate_password(12, false);
    do_action('password_reset', $user, $new_pass);
    wp_set_password($new_pass, $user->ID);
    update_usermeta($user->ID, 'default_password_nag', true);
    //Set up the Password change nag.
    $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
    $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n";
    $message .= site_url() . '/?ptype=affiliate' . "\r\n";
    $title = sprintf(__('[%s] Your new password'), get_option('blogname'));
    $title = apply_filters('password_reset_title', $title);
    $message = apply_filters('password_reset_message', $message, $new_pass);
    if ($message && !wp_mail($user_email, $title, $message)) {
        die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');
    }
    return true;
}
开发者ID:annguyenit,项目名称:getdeal,代码行数:67,代码来源:affiliate_login.php


示例8: get_currentuserinfo

function get_currentuserinfo()
{
    // a bit like get_userdata(), on steroids
    global $user_login, $userdata, $user_level, $user_ID, $user_nickname, $user_email, $user_url, $user_pass_md5, $cookiehash, $xoopsUser;
    // *** retrieving user's data from cookies and db - no spoofing
    /*
    	$user_login = $_COOKIE['wordpressuser_'.$cookiehash];
    	$userdata = get_userdatabylogin($user_login);
    	$user_level = $userdata->user_level;
    	$user_ID = $userdata->ID;
    	$user_nickname = $userdata->user_nickname;
    	$user_email = $userdata->user_email;
    	$user_url = $userdata->user_url;
    	$user_pass_md5 = md5($userdata->user_pass);
    */
    if ($xoopsUser) {
        $user_login = $xoopsUser->uname();
        $userdata = get_userdatabylogin($user_login);
        $user_level = $userdata->user_level;
        $user_ID = $userdata->ID;
        $user_nickname = $userdata->user_nickname;
        $user_email = $userdata->user_email;
        $user_url = $userdata->user_url;
        //		$user_pass_md5 = md5($userdata->user_pass);
        $user_pass_md5 = $xoopsUser->pass();
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:27,代码来源:functions.php


示例9: comber_login_guest

function comber_login_guest()
{
    if (isset($_POST['comber_user_login']) && wp_verify_nonce($_POST['comber_login_nonce'], 'comber-login-nonce')) {
        // this returns the user ID and other info from the user name
        $user = get_userdatabylogin($_POST['comber_user_login']);
        if (!$user) {
            // if the user name doesn't exist
            comber_errors()->add('empty_username', __('Invalid username'));
        }
        if (!isset($_POST['comber_user_pass']) || $_POST['comber_user_pass'] == '') {
            // if no password was entered
            comber_errors()->add('empty_password', __('Please enter a password'));
        }
        // check the user's login with their password
        if (!wp_check_password($_POST['comber_user_pass'], $user->user_pass, $user->ID)) {
            // if the password is incorrect for the specified user
            comber_errors()->add('empty_password', __('Incorrect password'));
        }
        // retrieve all error messages
        $errors = comber_errors()->get_error_messages();
        // only log the user in if there are no errors
        if (empty($errors)) {
            wp_setcookie($_POST['comber_user_login'], $_POST['comber_user_pass'], true);
            wp_set_current_user($user->ID, $_POST['comber_user_login']);
            do_action('wp_login', $_POST['comber_user_login']);
            wp_redirect(home_url($_POST['current_page']));
            exit;
        } else {
            wp_redirect(home_url($_POST['current_page'] . '/?login=true&fail=true'));
            exit;
        }
    }
}
开发者ID:SaloCreative,项目名称:thecomberwedding.co.uk,代码行数:33,代码来源:process.php


示例10: wp_authenticate_username_password

function wp_authenticate_username_password($user, $username, $password)
{
    if (is_a($user, 'WP_User')) {
        return $user;
    }
    if (empty($username) || empty($password)) {
        $error = new WP_Error();
        if (empty($username)) {
            $error->add('empty_username', __('<strong>ERROR</strong>: The username field is empty.'));
        }
        if (empty($password)) {
            $error->add('empty_password', __('<strong>ERROR</strong>: The password field is empty.'));
        }
        return $error;
    }
    $userdata = get_userdatabylogin($username);
    if (!$userdata) {
        return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login')));
    }
    $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
    if (is_wp_error($userdata)) {
        return $userdata;
    }
    if (!wp_check_password($password, $userdata->user_pass, $userdata->ID)) {
        return new WP_Error('incorrect_password', sprintf(__('<strong>ERROR</strong>: Incorrect password. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login')));
    }
    $user = new WP_User($userdata->ID);
    return $user;
}
开发者ID:jao,项目名称:jpcamargo,代码行数:29,代码来源:user.php


示例11: hm_parse_user

/**
 * hm_parse_user function.
 *
 * @access public
 * @param mixed $user. (default: null)
 * @return void
 */
function hm_parse_user($user = null)
{
    // We're we passed an object with ID
    if (is_object($user) && is_numeric($user->ID)) {
        return get_userdata($user->ID);
    }
    // We're we passed an object with user_id
    if (is_object($user) && is_numeric($user->user_id)) {
        return get_userdata($user->user_id);
    }
    // We're we passed an array
    if (is_array($user) && is_numeric($user['ID'])) {
        return get_userdata($user['ID']);
    }
    // ID
    if (is_numeric($user)) {
        return get_userdata($user);
    }
    // username
    if (is_string($user)) {
        return get_userdatabylogin($user);
    }
    // null
    global $current_user;
    return get_userdata($current_user->ID);
}
开发者ID:newsapps,项目名称:hm-core,代码行数:33,代码来源:hm-core.functions.php


示例12: retrieve_password

/**
 * Handles sending password retrieval email to user.
 *
 * @uses $wpdb WordPress Database object
 *
 * @return bool|WP_Error True: when finish. WP_Error on error
 */
function retrieve_password()
{
    global $wpdb;
    $errors = new WP_Error();
    if (empty($_POST['user_login']) && empty($_POST['user_email'])) {
        $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.', 'templatic'));
    }
    if (strpos($_POST['user_login'], '@')) {
        $user_data = get_user_by_email(trim($_POST['user_login']));
        if (empty($user_data)) {
            $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.', 'templatic'));
        }
    } else {
        $login = trim($_POST['user_login']);
        $user_data = get_userdatabylogin($login);
    }
    do_action('lostpassword_post');
    if ($errors->get_error_code()) {
        return $errors;
    }
    if (!$user_data) {
        $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.', 'templatic'));
        return $errors;
    }
    // redefining user_login ensures we return the right case in the email
    $user_login = $user_data->user_login;
    $user_email = $user_data->user_email;
    do_action('retreive_password', $user_login);
    // Misspelled and deprecated
    do_action('retrieve_password', $user_login);
    $user_email = $_POST['user_email'];
    $user_login = $_POST['user_login'];
    $user = $wpdb->get_row("SELECT * FROM {$wpdb->users} WHERE user_login like \"{$user_login}\" or user_email like \"{$user_login}\"");
    if (empty($user)) {
        return new WP_Error('invalid_key', __('Invalid key', 'templatic'));
    }
    $new_pass = wp_generate_password(12, false);
    do_action('password_reset', $user, $new_pass);
    wp_set_password($new_pass, $user->ID);
    update_usermeta($user->ID, 'default_password_nag', true);
    //Set up the Password change nag.
    $message = '<p><b>Your login Information :</b></p>';
    $message .= '<p>' . sprintf(__('Username: %s', 'templatic'), $user->user_login) . "</p>";
    $message .= '<p>' . sprintf(__('Password: %s', 'templatic'), $new_pass) . "</p>";
    $message .= '<p>You can login to : <a href="' . site_url() . '/?ptype=login' . "\">Login</a> or the URL is :  " . site_url() . "/?ptype=login</p>";
    $message .= '<p>Thank You,<br> ' . get_option('blogname') . '</p>';
    $user_email = $user_data->user_email;
    $user_name = $user_data->user_nicename;
    $fromEmail = get_site_emailId();
    $fromEmailName = get_site_emailName();
    $title = sprintf(__('[%s] Your new password', 'templatic'), get_option('blogname'));
    $title = apply_filters('password_reset_title', $title);
    $message = apply_filters('password_reset_message', $message, $new_pass);
    if (get_option('pttthemes_send_mail') == 'Enable' || get_option('pttthemes_send_mail') == '') {
        templ_sendEmail($fromEmail, $fromEmailName, $user_email, $user_name, $title, $message, $extra = '');
        ///forgot password email
    }
    return true;
}
开发者ID:annguyenit,项目名称:getdeal,代码行数:66,代码来源:registration.php


示例13: username_exists

function username_exists( $username ) {
	global $wpdb;
	$username = sanitize_user( $username );
	$user = get_userdatabylogin($username);
	if ( $user )
		return $user->ID;

	return null;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:9,代码来源:registration-functions.php


示例14: user_pass_ok

function user_pass_ok($user_login,$user_pass) {
	global $cache_userdata;
	if ( empty($cache_userdata[$user_login]) ) {
		$userdata = get_userdatabylogin($user_login);
	} else {
		$userdata = $cache_userdata[$user_login];
	}
	return (md5($user_pass) == $userdata->user_pass);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:9,代码来源:user.php


示例15: synlogin

 function synlogin($get, $post)
 {
     !API_SYNLOGIN && exit(API_RETURN_FORBIDDEN);
     $user = get_userdatabylogin($get['username']);
     if ($user) {
         header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
         wp_set_auth_cookie($user->ID, false, '');
     }
     exit(API_RETURN_SUCCEED);
 }
开发者ID:heartshare,项目名称:ucenter-integration,代码行数:10,代码来源:uc.php


示例16: wpi_get_current_author

function wpi_get_current_author()
{
    global $author, $author_name;
    if (is_get('author_name')) {
        $user = get_userdatabylogin($author_name);
    } else {
        $user = get_userdata(intval($author));
    }
    return $user;
}
开发者ID:Creativebq,项目名称:wp-istalker,代码行数:10,代码来源:author.php


示例17: retrieve_password

/**
 * Handles sending password retrieval email to user.
 *
 * @uses $wpdb WordPress Database object
 *
 * @return bool|WP_Error True: when finish. WP_Error on error
 */
function retrieve_password()
{
    global $wpdb, $General, $Cart, $Product;
    $errors = new WP_Error();
    if (empty($_POST['user_login']) && empty($_POST['user_email'])) {
        $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
    }
    if (strpos($_POST['user_login'], '@')) {
        $user_data = get_user_by_email(trim($_POST['user_login']));
        if (empty($user_data)) {
            $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
        }
    } else {
        $login = trim($_POST['user_login']);
        $user_data = get_userdatabylogin($login);
    }
    do_action('lostpassword_post');
    if ($errors->get_error_code()) {
        return $errors;
    }
    if (!$user_data) {
        $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.'));
        return $errors;
    }
    // redefining user_login ensures we return the right case in the email
    $user_login = $user_data->user_login;
    $user_email = $user_data->user_email;
    //do_action('retreive_password', $user_login);  // Misspelled and deprecated
    //do_action('retrieve_password', $user_login);
    //$allow = apply_filters('allow_password_reset', true, $user_data->ID);
    ////////////////////////////////////
    //forget pw changed on 1st april 2010 start//
    $user_email = $_POST['user_email'];
    $user_login = $_POST['user_login'];
    $user = $wpdb->get_row("SELECT * FROM {$wpdb->users} WHERE user_login = \"{$user_login}\" or user_email = \"{$user_login}\"");
    $new_pass = wp_generate_password(12, false);
    wp_set_password($new_pass, $user->ID);
    if ($General->is_send_forgot_pw_email()) {
        $message = '<p>' . sprintf(__('Username: %s'), $user_data->user_login) . '</p>';
        $message .= '<p>' . sprintf(__('Password: %s'), $new_pass) . "</p>";
        $message .= '<p>You can <a href="' . $General->get_url_login(site_url('/?ptype=login')) . '">Login</a> now</p>';
        $title = sprintf(__('[%s] Your new password'), get_option('blogname'));
        $user_email = $user_data->user_email;
        $user_login = $user_data->user_login;
        $title = apply_filters('password_reset_title', $title);
        $message = apply_filters('password_reset_message', $message, $new_pass);
        //forget pw changed on 1st april 2010 end//
        global $General;
        $fromEmail = $General->get_site_emailId();
        $fromEmailName = $General->get_site_emailName();
        $General->sendEmail($fromEmail, $fromEmailName, $user_email, $user_login, $title, $message, $extra = '');
        ///To clidne email
    }
    return true;
}
开发者ID:exploit86,项目名称:Devoncha,代码行数:62,代码来源:registration.php


示例18: msum_maybe_add_roles

/**
 * The 'wpmu_activate_user', 'wpmu_new_user' & 'wpmu_activate_blog' actions can only be 
 * hooked if the plugin is in the mu-plugins folder, which is a PITA. 
 * 
 * This function calls @see msum_add_roles from the 'wp_login' action.  
 */
function msum_maybe_add_roles($user_login)
{
    if (function_exists('get_user_by')) {
        $userdata = get_user_by('login', $user_login);
    } else {
        $userdata = get_userdatabylogin($user_login);
    }
    if ($userdata != false && get_user_meta($userdata->ID, 'msum_has_caps', true) != 'true') {
        msum_add_roles($userdata->ID);
    }
}
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:17,代码来源:ms-user-management.php


示例19: retrieve_password

function retrieve_password() {
	global $wpdb;

	$errors = new WP_Error();

	if ( empty( $_POST['user_login'] ) && empty( $_POST['user_email'] ) )
		$errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));

	if ( strstr($_POST['user_login'], '@') ) {
		$user_data = get_user_by_email(trim($_POST['user_login']));
		if ( empty($user_data) )
			$errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
	} else {
		$login = trim($_POST['user_login']);
		$user_data = get_userdatabylogin($login);
	}

	do_action('lostpassword_post');

	if ( $errors->get_error_code() )
		return $errors;

	if ( !$user_data ) {
		$errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.'));
		return $errors;
	}

	// redefining user_login ensures we return the right case in the email
	$user_login = $user_data->user_login;
	$user_email = $user_data->user_email;

	do_action('retreive_password', $user_login);  // Misspelled and deprecated
	do_action('retrieve_password', $user_login);

	$key = $wpdb->get_var($wpdb->prepare("SELECT user_activation_key FROM $wpdb->users WHERE user_login = %s", $user_login));
	if ( empty($key) ) {
		// Generate something random for a key...
		$key = wp_generate_password();
		do_action('retrieve_password_key', $user_login, $key);
		// Now insert the new md5 key into the db
		$wpdb->query($wpdb->prepare("UPDATE $wpdb->users SET user_activation_key = %s WHERE user_login = %s", $key, $user_login));
	}
	$message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
	$message .= get_option('siteurl') . "\r\n\r\n";
	$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
	$message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
	$message .= get_option('siteurl') . "/wp-login.php?action=rp&key=$key\r\n";

	if ( !wp_mail($user_email, sprintf(__('[%s] Password Reset'), get_option('blogname')), $message) )
		die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');

	return true;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:53,代码来源:wp-login.php


示例20: wordpress_login

 public function wordpress_login($user_login)
 {
     //$user_login = 'admin';
     $user = get_userdatabylogin($user_login);
     //print_r($user);
     //exit;
     $user_id = $user->ID;
     wp_set_current_user($user_id, $user_login);
     wp_set_auth_cookie($user_id);
     do_action('wp_login', $user_login);
     //return $this->redirect()->toUrl('http://blog.ovessence.loc/wp-admin/');
 }
开发者ID:riteshkmr33,项目名称:ovessnce,代码行数:12,代码来源:FrontEndAuth.php



注:本文中的get_userdatabylogin函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_usergroups函数代码示例发布时间:2022-05-15
下一篇:
PHP get_userdata函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap