用于注册和提交的 Drupal hook_user 开关
当 Drupal 完成注册时,我需要将注册详细信息发送到其他地方。 我找不到开关的正确变量。我尝试过这个,但它不起作用。该功能位于我的模块“externalnewsletter”中。
function externalnewsletter_user($op, &$edit, &$account, $category = NULL) {
if ($op == 'register' && $category == 'submit') {
// do stuff...
}
}
谢谢
I need to send registration details somewhere else when Drupal completes a registration.
I can't find the correct variables for the switch. I tried this but it's not working. This function is in my module "externalnewsletter".
function externalnewsletter_user($op, &$edit, &$account, $category = NULL) {
if ($op == 'register' && $category == 'submit') {
// do stuff...
}
}
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 Drupal 6 的触发器和操作来进行设置,无需太多编码。首先创建一个操作,如果您愿意,您可以在此处放置自定义代码。然后您可以转到管理|网站建设|触发器,在“用户”选项卡中,您将找到用于创建帐户的触发器。
这里有一个编写操作的指南:http://drupal.org/node/172152
You can use Drupal 6's Triggers and Actions to set this up without much coding. First create an action, this is where you can put your custom code if you like. Then you can go to Administer | Site Building | Triggers, and in the Users tab you will find a trigger for account creation.
There is a guide for writing actions here: http://drupal.org/node/172152
我想通了。我需要像这样查找“插入”:
现在的问题是我需要他们在 Drupal 使用 MD5 之前输入的未加密的密码。我需要所有其他 $_POST 变量,因为我向用户配置文件添加了一些字段。当我 print_r($_POST);它只打印“1”。
如何获取 $_POST 变量或以某种方式从表单中获取所有其他变量?
谢谢
I figured it out. I needed to look for the "insert" like this:
The problem now is I need the password they entered unencrypted BEFORE Drupal uses MD5. And I need all the other $_POST vars because I added a few fields to the user profiles. When I print_r($_POST); it just prints "1".
How do I get the $_POST vars or somehow get all the other vars from the form?
thanks