惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
IT之家
IT之家
月光博客
月光博客
U
Unit 42
K
Kaspersky official blog
T
Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Engineering at Meta
Engineering at Meta
Recorded Future
Recorded Future
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security @ Cisco Blogs
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Schneier on Security
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog RSS Feed
The Last Watchdog
The Last Watchdog
P
Palo Alto Networks Blog
爱范儿
爱范儿
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 热门话题
C
Cisco Blogs
Spread Privacy
Spread Privacy
F
Full Disclosure
博客园 - 聂微东
T
The Blog of Author Tim Ferriss

博客园 - h2appy

可以使用任何字体的gvim for windows vim编辑二进制文件 数据库连接字符串大全(Database Connection Strings) 在中文下安装PrimeOCR 4.5会出现“Failed open exe”错误 组件的初始化和终止,为什么实现 Dispose 类、组件和控件 ScintillaNet 2.0的中文问题 转帖:使用 Microsoft Visual Studio 2005 时可能遇到的问题 Vmware 6.5.1正式版在Ubuntu 8.10下面运行非常缓慢的解决方法 - h2appy 给控件加上图标,让界面看起来更丰富 开源的.net图表库(A flexible charting library for .NET) 免费的中文OCR软件 转帖:一英文软件安装时出现”Failed to open EXE”问题解决 改变RichTextBox光标(caret)的形状 一款小软件gbridge 7zip美化 转帖:字符编码笔记:ASCII,Unicode和UTF-8 转帖:Endian的由来 字符编码(Character encoding)
让WordPress注册时不发邮件,直接显示密码
h2appy · 2009-01-10 · via 博客园 - h2appy

from:

http://www.v2op.com/blog/2008/08/wordpress%E6%B3%A8%E5%86%8C%E7%9B%B4%E6%8E%A5%E6%98%BE%E7%A4%BA%E5%AF%86%E7%A0%81/

WordPress的用户注册机制是,填写用户名、邮箱,由 WordPress生成随机密码,并发送到用户注册时填写的邮箱地址。但很多人的服务器并没有配置邮件服务(比如我正在用的这台服务器),或者由于邮件运 行商的反垃圾邮件功能等原因,导致注册之后收不到WordPress发送的密码邮件,无法完成注册。

很不方便…

既然如此,不如我们hacks一下wordpress。让WordPress注册时不发邮件,直接显示密码得了。
怎么改呢?很简单,只需改动WordPress根目录下的 wp-login.php 即可。

1、搜索下面这句,位于 register_new_user 函数中。用于注册成功后发送通知。找到后把它注释掉。
wp_new_user_notification($user_id, $user_pass);

2、并在上面这句的下一行加上两句:
setcookie("u", $user_login);
setcookie("user_pass", $user_pass);

目的是把注册时填写的用户名,以及wordpress随机生成的密码写入cookies,以便在后面调用。

3、搜索下面这句
$errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');

并把它替换为

$errors->add('registered', __(' ^__^ 注册成功!用户名:'.$_COOKIE[“u”].'密码:'.$_COOKIE["user_pass"].'(登录后自行修改成您便于记忆的密码)'), 'message');

到此,就修改完成了。保存,上传。

注:本文基于 WordPress 2.6.1。其它版本的没看,应该没啥大的变化。