English 中文(简体)
3. 要求新密码
原标题:Require new password on first login to Wordpress

I am trying to set up a Wordpress site that requires users to login. The usernames are going to be pre-populated into the db, with 1 default password for all. Once they enter the default password, they need to be taken to another login screen that will act as a registration page for them. They cannot change their username, but are required to change their password. I cannot find any plugins that accomplish this (if someone knows of a pre-existing plugin, that would be great!). Anyone have any suggestions on how to accomplish this or point me in the right direction on where someone has accomplished this already? Thanks J

问题回答

这就是我如何这样做。 2. 确立您的标志,以接受用户名和密码。 如果密码等于缺省密码,则在用户气象表中设定任意价值。 在您的登陆网页上,如果存在这种用户元值,就进行逻辑核对,显示形成新密码的形式。 在成功修改密码后,删除用户元值。

在这里,你开始......有些困难。

var $creds = array();
$creds[ user_login ] =  example ;
$creds[ user_password ] =  plaintextpw ;
$creds[ remember ] = true;

if ($creds[ user_password ]== default ){
$metakey =  mustchangepw ;
$metavalue =  true ;
update_usermeta( $userid, $metakey, $metavalue ); 
}

$user = wp_signon( $creds, false );




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签