关于向drupal中添加js的问题

liangpei2008 liangpei2008 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

//请问大家有熟悉drupal的吗?我想在user.module中的user_authenticate函数中插入一段script,请问如何做?
function user_authenticate($name, $pass) {
global $user;
// Try to log in the user locally. Don't set $user unless successful.
if ($account = user_load(array('name' => $name, 'pass' => $pass, 'status' => 1))) {
// Check if the e-mail is denied by an access rule.
// Doing this check here saves us a user_load() in user_login_validate()
// and introduces less code change for a security fix.
if (drupal_is_denied('mail', $account->mail)) {
form_set_error('name', t('The name %name is registered using a reserved e-mail address and therefore could not be logged in.', array('%name' => $account->name)));
return;
}
else {
//我想在登陆成功后在这里插入一段script,请问如何插入,试了一个晚上,用drupal_add_js总是不行

$user = $account;

return $user;
}
}
...全文
评论 17
收藏 已收藏
分享
返回顶部
liangpei2008
基础编程 21,889 成员 140,329 内容